Skip to content

Commit 1ba9dcd

Browse files
committed
Prettier fixes
1 parent bfafd5a commit 1ba9dcd

61 files changed

Lines changed: 219 additions & 219 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.migrations/00000-media-by-apikey.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ db.users.find().forEach(async (user) => {
33
if (firstApikey) {
44
await db.media.updateMany(
55
{ userId: user._id },
6-
{ $set: { apikey: firstApikey.key } }
6+
{ $set: { apikey: firstApikey.key } },
77
);
88
console.log(`Updated ${user.email} media`);
99
}

.migrations/00002-set-unique-id-to-apikeys.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ async function updateCollection() {
2727
const doc = await cursor.next();
2828
await collection.updateOne(
2929
{ _id: doc._id },
30-
{ $set: { keyId: nanoid() } }
30+
{ $set: { keyId: nanoid() } },
3131
);
3232
}
3333
} finally {

LICENSE.md

Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -204,23 +204,23 @@ produce it from the Program, in the form of source code under the
204204
terms of section 4, provided that you also meet all of these
205205
conditions:
206206

207-
- a) The work must carry prominent notices stating that you modified
208-
it, and giving a relevant date.
209-
- b) The work must carry prominent notices stating that it is
210-
released under this License and any conditions added under
211-
section 7. This requirement modifies the requirement in section 4
212-
to "keep intact all notices".
213-
- c) You must license the entire work, as a whole, under this
214-
License to anyone who comes into possession of a copy. This
215-
License will therefore apply, along with any applicable section 7
216-
additional terms, to the whole of the work, and all its parts,
217-
regardless of how they are packaged. This License gives no
218-
permission to license the work in any other way, but it does not
219-
invalidate such permission if you have separately received it.
220-
- d) If the work has interactive user interfaces, each must display
221-
Appropriate Legal Notices; however, if the Program has interactive
222-
interfaces that do not display Appropriate Legal Notices, your
223-
work need not make them do so.
207+
- a) The work must carry prominent notices stating that you modified
208+
it, and giving a relevant date.
209+
- b) The work must carry prominent notices stating that it is
210+
released under this License and any conditions added under
211+
section 7. This requirement modifies the requirement in section 4
212+
to "keep intact all notices".
213+
- c) You must license the entire work, as a whole, under this
214+
License to anyone who comes into possession of a copy. This
215+
License will therefore apply, along with any applicable section 7
216+
additional terms, to the whole of the work, and all its parts,
217+
regardless of how they are packaged. This License gives no
218+
permission to license the work in any other way, but it does not
219+
invalidate such permission if you have separately received it.
220+
- d) If the work has interactive user interfaces, each must display
221+
Appropriate Legal Notices; however, if the Program has interactive
222+
interfaces that do not display Appropriate Legal Notices, your
223+
work need not make them do so.
224224

225225
A compilation of a covered work with other separate and independent
226226
works, which are not by their nature extensions of the covered work,
@@ -239,42 +239,42 @@ sections 4 and 5, provided that you also convey the machine-readable
239239
Corresponding Source under the terms of this License, in one of these
240240
ways:
241241

242-
- a) Convey the object code in, or embodied in, a physical product
243-
(including a physical distribution medium), accompanied by the
244-
Corresponding Source fixed on a durable physical medium
245-
customarily used for software interchange.
246-
- b) Convey the object code in, or embodied in, a physical product
247-
(including a physical distribution medium), accompanied by a
248-
written offer, valid for at least three years and valid for as
249-
long as you offer spare parts or customer support for that product
250-
model, to give anyone who possesses the object code either (1) a
251-
copy of the Corresponding Source for all the software in the
252-
product that is covered by this License, on a durable physical
253-
medium customarily used for software interchange, for a price no
254-
more than your reasonable cost of physically performing this
255-
conveying of source, or (2) access to copy the Corresponding
256-
Source from a network server at no charge.
257-
- c) Convey individual copies of the object code with a copy of the
258-
written offer to provide the Corresponding Source. This
259-
alternative is allowed only occasionally and noncommercially, and
260-
only if you received the object code with such an offer, in accord
261-
with subsection 6b.
262-
- d) Convey the object code by offering access from a designated
263-
place (gratis or for a charge), and offer equivalent access to the
264-
Corresponding Source in the same way through the same place at no
265-
further charge. You need not require recipients to copy the
266-
Corresponding Source along with the object code. If the place to
267-
copy the object code is a network server, the Corresponding Source
268-
may be on a different server (operated by you or a third party)
269-
that supports equivalent copying facilities, provided you maintain
270-
clear directions next to the object code saying where to find the
271-
Corresponding Source. Regardless of what server hosts the
272-
Corresponding Source, you remain obligated to ensure that it is
273-
available for as long as needed to satisfy these requirements.
274-
- e) Convey the object code using peer-to-peer transmission,
275-
provided you inform other peers where the object code and
276-
Corresponding Source of the work are being offered to the general
277-
public at no charge under subsection 6d.
242+
- a) Convey the object code in, or embodied in, a physical product
243+
(including a physical distribution medium), accompanied by the
244+
Corresponding Source fixed on a durable physical medium
245+
customarily used for software interchange.
246+
- b) Convey the object code in, or embodied in, a physical product
247+
(including a physical distribution medium), accompanied by a
248+
written offer, valid for at least three years and valid for as
249+
long as you offer spare parts or customer support for that product
250+
model, to give anyone who possesses the object code either (1) a
251+
copy of the Corresponding Source for all the software in the
252+
product that is covered by this License, on a durable physical
253+
medium customarily used for software interchange, for a price no
254+
more than your reasonable cost of physically performing this
255+
conveying of source, or (2) access to copy the Corresponding
256+
Source from a network server at no charge.
257+
- c) Convey individual copies of the object code with a copy of the
258+
written offer to provide the Corresponding Source. This
259+
alternative is allowed only occasionally and noncommercially, and
260+
only if you received the object code with such an offer, in accord
261+
with subsection 6b.
262+
- d) Convey the object code by offering access from a designated
263+
place (gratis or for a charge), and offer equivalent access to the
264+
Corresponding Source in the same way through the same place at no
265+
further charge. You need not require recipients to copy the
266+
Corresponding Source along with the object code. If the place to
267+
copy the object code is a network server, the Corresponding Source
268+
may be on a different server (operated by you or a third party)
269+
that supports equivalent copying facilities, provided you maintain
270+
clear directions next to the object code saying where to find the
271+
Corresponding Source. Regardless of what server hosts the
272+
Corresponding Source, you remain obligated to ensure that it is
273+
available for as long as needed to satisfy these requirements.
274+
- e) Convey the object code using peer-to-peer transmission,
275+
provided you inform other peers where the object code and
276+
Corresponding Source of the work are being offered to the general
277+
public at no charge under subsection 6d.
278278

279279
A separable portion of the object code, whose source code is excluded
280280
from the Corresponding Source as a System Library, need not be
@@ -350,23 +350,23 @@ Notwithstanding any other provision of this License, for material you
350350
add to a covered work, you may (if authorized by the copyright holders
351351
of that material) supplement the terms of this License with terms:
352352

353-
- a) Disclaiming warranty or limiting liability differently from the
354-
terms of sections 15 and 16 of this License; or
355-
- b) Requiring preservation of specified reasonable legal notices or
356-
author attributions in that material or in the Appropriate Legal
357-
Notices displayed by works containing it; or
358-
- c) Prohibiting misrepresentation of the origin of that material,
359-
or requiring that modified versions of such material be marked in
360-
reasonable ways as different from the original version; or
361-
- d) Limiting the use for publicity purposes of names of licensors
362-
or authors of the material; or
363-
- e) Declining to grant rights under trademark law for use of some
364-
trade names, trademarks, or service marks; or
365-
- f) Requiring indemnification of licensors and authors of that
366-
material by anyone who conveys the material (or modified versions
367-
of it) with contractual assumptions of liability to the recipient,
368-
for any liability that these contractual assumptions directly
369-
impose on those licensors and authors.
353+
- a) Disclaiming warranty or limiting liability differently from the
354+
terms of sections 15 and 16 of this License; or
355+
- b) Requiring preservation of specified reasonable legal notices or
356+
author attributions in that material or in the Appropriate Legal
357+
Notices displayed by works containing it; or
358+
- c) Prohibiting misrepresentation of the origin of that material,
359+
or requiring that modified versions of such material be marked in
360+
reasonable ways as different from the original version; or
361+
- d) Limiting the use for publicity purposes of names of licensors
362+
or authors of the material; or
363+
- e) Declining to grant rights under trademark law for use of some
364+
trade names, trademarks, or service marks; or
365+
- f) Requiring indemnification of licensors and authors of that
366+
material by anyone who conveys the material (or modified versions
367+
of it) with contractual assumptions of liability to the recipient,
368+
for any liability that these contractual assumptions directly
369+
impose on those licensors and authors.
370370

371371
All other non-permissive additional terms are considered "further
372372
restrictions" within the meaning of section 10. If the Program as you

apps/api/CHANGELOG.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@
44

55
### Patch Changes
66

7-
- Updated dependencies [0ecea51]
8-
- @medialit/thumbnail@0.0.27
7+
- Updated dependencies [0ecea51]
8+
- @medialit/thumbnail@0.0.27
99

1010
## 0.0.26
1111

1212
### Patch Changes
1313

14-
- Updated dependencies [bbb81e7]
15-
- @medialit/thumbnail@0.0.26
14+
- Updated dependencies [bbb81e7]
15+
- @medialit/thumbnail@0.0.26
1616

1717
## 0.0.25
1818

1919
### Patch Changes
2020

21-
- Updated dependencies [7a07e615]
22-
- @medialit/thumbnail@0.0.25
23-
- @medialit/images@0.0.25
21+
- Updated dependencies [7a07e615]
22+
- @medialit/thumbnail@0.0.25
23+
- @medialit/images@0.0.25

apps/api/src/apikey/handlers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Apikey } from "@medialit/models";
66
export async function createApikey(
77
req: any,
88
res: any,
9-
next: (...args: any[]) => void
9+
next: (...args: any[]) => void,
1010
) {
1111
const { name } = req.body;
1212
if (!name) {
@@ -28,7 +28,7 @@ export async function createApikey(
2828
export async function getApikey(
2929
req: any,
3030
res: any,
31-
next: (...args: any[]) => void
31+
next: (...args: any[]) => void,
3232
) {
3333
const { keyId } = req.params;
3434

@@ -48,7 +48,7 @@ export async function getApikey(
4848
export async function deleteApikey(
4949
req: any,
5050
res: any,
51-
next: (...args: any[]) => void
51+
next: (...args: any[]) => void,
5252
) {
5353
const { keyId } = req.params;
5454

apps/api/src/apikey/middleware.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Apikey } from "@medialit/models";
1111
export default async function apikey(
1212
req: any,
1313
res: any,
14-
next: (...args: any[]) => void
14+
next: (...args: any[]) => void,
1515
) {
1616
const reqKey = req.body.apikey;
1717

@@ -26,15 +26,15 @@ export default async function apikey(
2626

2727
if (req.body.internalKey) {
2828
const internalApikey: Apikey | null = await getApiKeyUsingKeyId(
29-
req.body.internalKey
29+
req.body.internalKey,
3030
);
3131
if (!internalApikey) {
3232
return res.status(401).json({ error: UNAUTHORISED });
3333
}
3434
}
3535

3636
const isSubscriptionValid = await validateSubscription(
37-
apiKey!.userId.toString()
37+
apiKey!.userId.toString(),
3838
);
3939
if (!isSubscriptionValid) {
4040
return res.status(403).json({ error: SUBSCRIPTION_NOT_VALID });

apps/api/src/apikey/queries.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getUniqueId } from "@medialit/utils";
44

55
export async function createApiKey(
66
userId: string,
7-
name: string
7+
name: string,
88
): Promise<Apikey> {
99
return await ApikeyModel.create({
1010
name,
@@ -19,7 +19,7 @@ export async function getApiKeyUsingKeyId(key: string): Promise<Apikey | null> {
1919

2020
export async function getApiKeyByUserId(
2121
userId: string,
22-
keyId?: string
22+
keyId?: string,
2323
): Promise<Apikey | Apikey[] | null> {
2424
let result: Apikey | Apikey[] | null;
2525
const projections = {
@@ -38,12 +38,12 @@ export async function getApiKeyByUserId(
3838
userId,
3939
internal: false,
4040
},
41-
projections
41+
projections,
4242
);
4343
} else {
4444
result = await ApikeyModel.find(
4545
{ userId, internal: false },
46-
projections
46+
projections,
4747
);
4848
}
4949

@@ -52,7 +52,7 @@ export async function getApiKeyByUserId(
5252

5353
export async function deleteApiKey(
5454
userId: string,
55-
keyId: string
55+
keyId: string,
5656
): Promise<void> {
5757
await ApikeyModel.deleteOne({
5858
key: keyId,

apps/api/src/apikey/routes.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,25 @@ export default (passport: any) => {
99
"/create",
1010
passport.authenticate("jwt", { session: false }),
1111
subscription,
12-
createApikey
12+
createApikey,
1313
);
1414
router.post(
1515
"/get",
1616
passport.authenticate("jwt", { session: false }),
1717
subscription,
18-
getApikey
18+
getApikey,
1919
);
2020
router.post(
2121
"/get/:keyId",
2222
passport.authenticate("jwt", { session: false }),
2323
subscription,
24-
getApikey
24+
getApikey,
2525
);
2626
router.delete(
2727
"/delete/:keyId",
2828
passport.authenticate("jwt", { session: false }),
2929
subscription,
30-
deleteApikey
30+
deleteApikey,
3131
);
3232

3333
return router;

apps/api/src/config/db.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default async function (): Promise<void> {
2727
try {
2828
const dbConnection = await mongoose.connect(
2929
dbConnectionString,
30-
options
30+
options,
3131
);
3232
connection.isConnected = dbConnection.connections[0].readyState;
3333
logger.info("Database connected");

apps/api/src/media-settings/handlers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as mediaSettingsService from "./service";
77
export async function updateMediaSettingsHandler(
88
req: any,
99
res: any,
10-
next: (...args: any[]) => void
10+
next: (...args: any[]) => void,
1111
) {
1212
const mediaSettingsSchema = Joi.object({
1313
useWebP: Joi.boolean(),
@@ -50,7 +50,7 @@ export async function getMediaSettingsHandler(req: any, res: any) {
5050
try {
5151
const mediaSettings = await mediaSettingsService.getMediaSettings(
5252
req.user.id,
53-
req.apikey
53+
req.apikey,
5454
);
5555
return res.status(200).json(mediaSettings);
5656
} catch (err: any) {

0 commit comments

Comments
 (0)