Skip to content

Commit 7dd849e

Browse files
authored
chore: dependency updates (#144)
* chore: dependency updates * Prettier formatting
1 parent 6ad8687 commit 7dd849e

22 files changed

+631
-509
lines changed

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ dist/
55
.eggs/
66
.yarn/
77
renovate.json
8+
socket.io-websocket-only.js
9+
doc/resource

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,22 @@
2525
"dist"
2626
],
2727
"devDependencies": {
28-
"@types/uuid": "^9.0.2",
29-
"cross-fetch": "^3.1.6",
30-
"dayjs": "^1.11.8",
31-
"eslint": "^8.43.0",
28+
"@types/uuid": "^9.0.4",
29+
"cross-fetch": "^4.0.0",
30+
"dayjs": "^1.11.9",
31+
"eslint": "^8.49.0",
3232
"eslint-config-react-app": "^7.0.1",
3333
"husky": "^8.0.3",
3434
"jsdom": "^22.1.0",
35-
"lint-staged": "^13.2.2",
36-
"msw": "^1.2.2",
35+
"lint-staged": "^14.0.1",
36+
"msw": "^1.3.1",
3737
"pinst": "^3.0.0",
38-
"prettier": "^2.8.8",
39-
"typescript": "^5.1.3",
40-
"vite": "^4.3.9",
41-
"vite-plugin-dts": "^2.3.0",
42-
"vitest": "^0.32.2",
43-
"ws": "^8.13.0"
38+
"prettier": "^3.0.3",
39+
"typescript": "^5.2.2",
40+
"vite": "^4.4.9",
41+
"vite-plugin-dts": "^3.5.3",
42+
"vitest": "^0.34.4",
43+
"ws": "^8.14.1"
4444
},
4545
"repository": {
4646
"type": "git",
@@ -61,7 +61,7 @@
6161
"isomorphic-ws": "^5.0.0",
6262
"loglevel": "^1.8.1",
6363
"moment": "^2.29.4",
64-
"uuid": "^9.0.0"
64+
"uuid": "^9.0.1"
6565
},
6666
"peerDependencies": {
6767
"ws": "^8.13.0"

source/error.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const ServerError = errorFactory("ServerError");
3535
* @memberof error
3636
*/
3737
export const ServerPermissionDeniedError = errorFactory(
38-
"ServerPermissionDeniedError"
38+
"ServerPermissionDeniedError",
3939
);
4040

4141
/**
@@ -51,7 +51,7 @@ export const ServerValidationError = errorFactory("ServerValidationError");
5151
* @memberof error
5252
*/
5353
export const EventServerReplyTimeoutError = errorFactory(
54-
"EventServerReplyTimeoutError"
54+
"EventServerReplyTimeoutError",
5555
);
5656

5757
/**
@@ -60,7 +60,7 @@ export const EventServerReplyTimeoutError = errorFactory(
6060
* @memberof error
6161
*/
6262
export const EventServerConnectionTimeoutError = errorFactory(
63-
"EventServerConnectionTimeoutError"
63+
"EventServerConnectionTimeoutError",
6464
);
6565

6666
/**

source/event.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class Event {
2424
constructor(
2525
topic: string,
2626
data: object,
27-
options: { [key: string]: unknown } = {}
27+
options: { [key: string]: unknown } = {},
2828
) {
2929
this._data = {
3030
topic,

source/event_hub.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ export class EventHub {
146146
serverUrl: string,
147147
apiUser: string,
148148
apiKey: string,
149-
{ applicationId = "ftrack.api.javascript" }: { applicationId?: string } = {}
149+
{
150+
applicationId = "ftrack.api.javascript",
151+
}: { applicationId?: string } = {},
150152
) {
151153
this.logger = loglevel.getLogger("ftrack_api:EventHub");
152154
this._applicationId = applicationId;
@@ -253,11 +255,11 @@ export class EventHub {
253255
}: {
254256
onReply?: EventCallback;
255257
timeout?: number;
256-
} = {}
258+
} = {},
257259
): Promise<string> {
258260
if (!this._socketIo) {
259261
throw new EventServerPublishError(
260-
"Unable to publish event, not connected to server."
262+
"Unable to publish event, not connected to server.",
261263
);
262264
}
263265

@@ -279,7 +281,7 @@ export class EventHub {
279281
if (timeout) {
280282
setTimeout(() => {
281283
const error = new EventServerConnectionTimeoutError(
282-
"Unable to connect to event server within timeout."
284+
"Unable to connect to event server within timeout.",
283285
);
284286
reject(error);
285287
}, timeout * 1000);
@@ -294,7 +296,7 @@ export class EventHub {
294296
this.logger.debug("Publishing event.", eventData);
295297
if (!this._socketIo) {
296298
throw new EventServerPublishError(
297-
"Unable to publish event, not connected to server."
299+
"Unable to publish event, not connected to server.",
298300
);
299301
}
300302
this._socketIo.emit("ftrack.event", eventData);
@@ -315,7 +317,7 @@ export class EventHub {
315317
*/
316318
publishAndWaitForReply(
317319
event: Event,
318-
{ timeout = 30 }: { timeout: number }
320+
{ timeout = 30 }: { timeout: number },
319321
): Promise<unknown> {
320322
const eventId = event.getData().id;
321323
const response = new Promise((resolve, reject) => {
@@ -328,7 +330,7 @@ export class EventHub {
328330
if (timeout) {
329331
setTimeout(() => {
330332
const error = new EventServerReplyTimeoutError(
331-
"No reply event received within timeout."
333+
"No reply event received within timeout.",
332334
);
333335
reject(error);
334336
this._removeReplyCallback(eventId);
@@ -379,7 +381,7 @@ export class EventHub {
379381
subscribe(
380382
subscription: string,
381383
callback: EventCallback,
382-
metadata?: SubscriberMetadata
384+
metadata?: SubscriberMetadata,
383385
): string {
384386
if (typeof callback !== "function") {
385387
throw new Error("Callback must be a function.");
@@ -426,7 +428,7 @@ export class EventHub {
426428
return matches[1];
427429
}
428430
throw new Error(
429-
'Only subscriptions on the format "topic=value" are supported.'
431+
'Only subscriptions on the format "topic=value" are supported.',
430432
);
431433
}
432434

@@ -446,7 +448,7 @@ export class EventHub {
446448
callback: EventCallback,
447449
metadata: SubscriberMetadata = {
448450
id: uuidV4(),
449-
}
451+
},
450452
) {
451453
// Ensure subscription is on supported format.
452454
// TODO: Remove once subscription parsing is supported.
@@ -461,7 +463,7 @@ export class EventHub {
461463

462464
if (existingSubscriber) {
463465
throw new NotUniqueError(
464-
`Subscriber with identifier "${metadata.id}" already exists.`
466+
`Subscriber with identifier "${metadata.id}" already exists.`,
465467
);
466468
}
467469

@@ -521,7 +523,7 @@ export class EventHub {
521523
*/
522524
private _IsSubscriberInterestedIn(
523525
subscriber: Subscriber,
524-
eventPayload: EventPayload
526+
eventPayload: EventPayload,
525527
) {
526528
const topic = this._getExpressionTopic(subscriber.subscription);
527529

@@ -557,7 +559,7 @@ export class EventHub {
557559
}
558560
try {
559561
const responsePromise = Promise.resolve(
560-
subscriber.callback(eventPayload)
562+
subscriber.callback(eventPayload),
561563
);
562564
promises.push(responsePromise);
563565
responsePromise.then((response) => {
@@ -571,7 +573,7 @@ export class EventHub {
571573
"Error calling subscriber for event.",
572574
error,
573575
subscriber,
574-
eventPayload
576+
eventPayload,
575577
);
576578
}
577579
}
@@ -601,7 +603,7 @@ export class EventHub {
601603
publishReply(
602604
sourceEventPayload: EventPayload,
603605
data: Data,
604-
source: Data | null = null
606+
source: Data | null = null,
605607
): Promise<string> {
606608
const replyEvent = new Event("ftrack.meta.reply", data, {
607609
target: `id=${sourceEventPayload.source.id}`,

source/operation.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export function search({
139139
export function update(
140140
type: string,
141141
keys: string[] | string,
142-
data: any
142+
data: any,
143143
): UpdateOperation {
144144
return {
145145
action: "update",
@@ -160,7 +160,7 @@ export function update(
160160
*/
161161
function deleteOperation(
162162
type: string,
163-
keys: string[] | string
163+
keys: string[] | string,
164164
): DeleteOperation {
165165
return {
166166
action: "delete",

source/project_schema.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function getStatuses(
2222
session: Session,
2323
projectSchemaId: string,
2424
entityType: string,
25-
typeId: string | null = null
25+
typeId: string | null = null,
2626
) {
2727
let response;
2828

@@ -66,9 +66,9 @@ export function getStatuses(
6666
const operations = groupedAttributes.map((select) =>
6767
operation.query(
6868
`select ${select.join(
69-
", "
70-
)} from ProjectSchema where id is ${projectSchemaId}`
71-
)
69+
", ",
70+
)} from ProjectSchema where id is ${projectSchemaId}`,
71+
),
7272
);
7373

7474
response = session.call<QueryResponse<Data>>(operations);
@@ -108,7 +108,7 @@ export function getStatuses(
108108
for (const index in data._schemas) {
109109
if (data._schemas[index].type_id === objectTypeId) {
110110
statuses = data._schemas[index].statuses.map(
111-
(status: any) => status.task_status
111+
(status: any) => status.task_status,
112112
);
113113
}
114114
}

0 commit comments

Comments
 (0)