Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.18.0
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

3 changes: 0 additions & 3 deletions src/lib/components/event/event-summary-row.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
eventOrGroupIsTerminated,
} from '$lib/models/event-groups/get-event-in-group';
import { isCloud } from '$lib/stores/advanced-visibility';
import { authUser } from '$lib/stores/auth-user';
import type { IterableEvent, WorkflowEvent } from '$lib/types/events';
import { decodeLocalActivity } from '$lib/utilities/decode-local-activity';
import { spaceBetweenCapitalLetters } from '$lib/utilities/format-camel-case';
Expand Down Expand Up @@ -187,7 +186,6 @@
primaryLocalAttribute = await decodeLocalActivity(event, {
namespace: page.params.namespace,
settings: page.data.settings,
accessToken: $authUser.accessToken,
});
} else if (
isEventGroup(event) &&
Expand All @@ -196,7 +194,6 @@
primaryLocalAttribute = await decodeLocalActivity(event.initialEvent, {
namespace: page.params.namespace,
settings: page.data.settings,
accessToken: $authUser.accessToken,
});
}
});
Expand All @@ -220,7 +217,7 @@
{#if isEventGroup(event)}
<td class="font-mono">
<div class="flex items-center gap-0.5">
{#each event.eventList as groupEvent}

Check warning on line 220 in src/lib/components/event/event-summary-row.svelte

View workflow job for this annotation

GitHub Actions / lint

Each block should have a key
<Link
data-testid="link"
href={routeForEventHistoryEvent({
Expand Down
2 changes: 0 additions & 2 deletions src/lib/components/event/payload-decoder.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import { page } from '$app/stores';

import { authUser } from '$lib/stores/auth-user';
import type { Memo } from '$lib/types';
import type { EventAttribute, WorkflowEvent } from '$lib/types/events';
import {
Expand Down Expand Up @@ -51,7 +50,6 @@
_value,
$page.params.namespace,
settings,
$authUser.accessToken,
);
const decodedAttributes = decodePayloadAttributes(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Argument of type 'WorkflowEvent | EventAttribute | IMemo | PotentiallyDecodable' is not assignable to parameter of type 'Optional<WorkflowEvent | EventAttribute | PotentiallyDecodable>'.

convertedAttributes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import { translate } from '$lib/i18n/translate';
import type { EventGroup } from '$lib/models/event-groups/event-groups';
import { setActiveGroup } from '$lib/stores/active-events';
import { authUser } from '$lib/stores/auth-user';
import {
decodeLocalActivity,
getLocalActivityMarkerEvent,
Expand Down Expand Up @@ -68,7 +67,6 @@
decodedLocalActivity = await decodeLocalActivity(localActivityEvent, {
namespace: page.params.namespace,
settings: page.data.settings,
accessToken: $authUser.accessToken,
});

if (decodedLocalActivity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import Markdown from '$lib/holocene/markdown-editor/preview.svelte';
import { translate } from '$lib/i18n/translate';
import { getWorkflowMetadata } from '$lib/services/query-service';
import { authUser } from '$lib/stores/auth-user';
import { workflowRun } from '$lib/stores/workflow-run';

const { namespace } = $derived(page.params);
Expand All @@ -34,7 +33,6 @@
},
},
settings,
$authUser?.accessToken ?? '',
);
$workflowRun.metadata = metadata;
lastFetched = new Date();
Expand Down
2 changes: 0 additions & 2 deletions src/lib/layouts/workflow-run-layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import { getPollers } from '$lib/services/pollers-service';
import { getWorkflowMetadata } from '$lib/services/query-service';
import { fetchWorkflow } from '$lib/services/workflow-service';
import { authUser } from '$lib/stores/auth-user';
import { resetLastDataEncoderSuccess } from '$lib/stores/data-encoder-config';
import { eventFilterSort, type EventSortOrder } from '$lib/stores/event-view';
import {
Expand Down Expand Up @@ -117,7 +116,6 @@
},
},
settings,
$authUser?.accessToken,
workflowRunController.signal,
).then((metadata) => {
$workflowRun.metadata = metadata;
Expand Down
5 changes: 0 additions & 5 deletions src/lib/models/event-history/get-event-attributes.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ const historyEvent = {

const namespace = 'unit-tests';
const settings = settingsFixture as unknown as Settings;
const accessToken = 'xxx.yyy.zzz';

describe('getEventAttributes', () => {
beforeEach(() => {
Expand All @@ -110,7 +109,6 @@ describe('getEventAttributes', () => {
historyEvent,
namespace,
settings,
accessToken,
});
expect(event.type).toBe(eventType);
});
Expand All @@ -123,7 +121,6 @@ describe('getEventAttributes', () => {
historyEvent,
namespace,
settings,
accessToken,
},
{
convertWithCodec,
Expand All @@ -141,7 +138,6 @@ describe('getEventAttributes', () => {
historyEvent,
namespace,
settings: { ...settings, codec: { endpoint: 'https://localhost' } },
accessToken,
},
{
convertWithCodec,
Expand All @@ -159,7 +155,6 @@ describe('getEventAttributes', () => {
historyEvent,
namespace,
settings,
accessToken,
},
{
convertWithCodec,
Expand Down
3 changes: 1 addition & 2 deletions src/lib/models/event-history/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { getEventClassification } from './get-event-classification';
import { simplifyAttributes } from './simplify-attributes';

export async function getEventAttributes(
{ historyEvent, namespace, settings, accessToken }: EventWithMetadata,
{ historyEvent, namespace, settings }: EventWithMetadata,
{
convertWithCodec = convertPayloadToJsonWithCodec,
decodeAttributes = decodePayloadAttributes,
Expand All @@ -38,7 +38,6 @@ export async function getEventAttributes(
attributes,
namespace,
settings,
accessToken,
});

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Argument of type 'EventAttribute | IFailure | PotentiallyDecodable' is not assignable to parameter of type 'Optional<WorkflowEvent | EventAttribute | PotentiallyDecodable>'.

const decodedAttributes = decodeAttributes(convertedAttributes) as object;
Expand Down
5 changes: 0 additions & 5 deletions src/lib/models/event-history/to-event-history.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ const historyEvent = {

const namespace = 'unit-tests';
const settings = settingsFixture as unknown as Settings;
const accessToken = 'token-test';

describe('getEventAttributes', () => {
beforeEach(() => {
Expand All @@ -110,7 +109,6 @@ describe('getEventAttributes', () => {
historyEvent,
namespace,
settings,
accessToken,
});
expect(event.type).toBe(eventType);
});
Expand All @@ -123,7 +121,6 @@ describe('getEventAttributes', () => {
historyEvent,
namespace,
settings,
accessToken,
},
{
convertWithCodec,
Expand All @@ -141,7 +138,6 @@ describe('getEventAttributes', () => {
historyEvent,
namespace,
settings: { ...settings, codec: { endpoint: 'https://localhost' } },
accessToken,
},
{
convertWithCodec,
Expand All @@ -159,7 +155,6 @@ describe('getEventAttributes', () => {
historyEvent,
namespace,
settings,
accessToken,
},
{
convertWithCodec,
Expand Down
8 changes: 1 addition & 7 deletions src/lib/models/pending-activities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { get } from 'svelte/store';

import { page } from '$app/stores';

import { authUser } from '$lib/stores/auth-user';
import type {
PendingActivity,
PendingActivityWithMetadata,
Expand All @@ -16,7 +15,7 @@ import {
} from '$lib/utilities/decode-payload';

export async function getActivityAttributes(
{ activity, namespace, settings, accessToken }: PendingActivityWithMetadata,
{ activity, namespace, settings }: PendingActivityWithMetadata,
{
convertWithCodec = convertPayloadToJsonWithCodec,
decodeAttributes = decodePayloadAttributes,
Expand All @@ -26,7 +25,6 @@ export async function getActivityAttributes(
attributes: activity,
namespace,
settings,
accessToken,
});

const decodedAttributes = decodeAttributes(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Argument of type 'EventAttribute | IFailure | PotentiallyDecodable' is not assignable to parameter of type 'Optional<WorkflowEvent | EventAttribute | PotentiallyDecodable>'.

Expand All @@ -39,13 +37,11 @@ const decodePendingActivity = async ({
activity,
namespace,
settings,
accessToken,
}: PendingActivityWithMetadata): Promise<PendingActivity> => {
const decodedActivity = await getActivityAttributes({
activity,
namespace,
settings,
accessToken,
});
return decodedActivity;
};
Expand All @@ -54,7 +50,6 @@ export const toDecodedPendingActivities = async (
workflow: WorkflowExecution,
namespace: string = get(page).params.namespace,
settings: Settings = get(page).data.settings,
accessToken: string = get(authUser).accessToken,
) => {
const pendingActivities = workflow?.pendingActivities ?? [];
const decodedActivities: PendingActivity[] = [];
Expand All @@ -63,7 +58,6 @@ export const toDecodedPendingActivities = async (
activity,
namespace,
settings,
accessToken,
});
decodedActivities.push(decodedActivity);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import pendingActivityWorkflow from '$fixtures/workflow.pending-activities.json'

const namespace = 'unit-tests';
const settings = settingsFixture as unknown as Settings;
const accessToken = 'access-token';

describe('toDecodedPendingActivities', () => {
it('should decode heartbeatDetails', async () => {
Expand All @@ -19,7 +18,6 @@ describe('toDecodedPendingActivities', () => {
workflow,
namespace,
settings,
accessToken,
);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Object is possibly 'null' or 'undefined'.
  • ⚠️ Object is possibly 'null' or 'undefined'.

expect(decodedHeartbeatDetails[0].heartbeatDetails.payloads[0]).toBe(2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Object is possibly 'null' or 'undefined'.
  • ⚠️ Object is possibly 'null' or 'undefined'.

Expand Down
2 changes: 0 additions & 2 deletions src/lib/pages/workflow-call-stack.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import { translate } from '$lib/i18n/translate';
import type { ParsedQuery } from '$lib/services/query-service';
import { getWorkflowStackTrace } from '$lib/services/query-service';
import { authUser } from '$lib/stores/auth-user';
import { refresh, workflowRun } from '$lib/stores/workflow-run';
import type { Eventual } from '$lib/types/global';

Expand All @@ -31,7 +30,6 @@
namespace,
},
page.data?.settings,
$authUser?.accessToken,
);

$effect(() => {
Expand Down
3 changes: 0 additions & 3 deletions src/lib/pages/workflow-query.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
getWorkflowMetadata,
type ParsedQuery,
} from '$lib/services/query-service';
import { authUser } from '$lib/stores/auth-user';
import { workflowRun } from '$lib/stores/workflow-run';
import type { Payloads } from '$lib/types';
import type { WorkflowInteractionDefinition } from '$lib/types/workflows';
Expand Down Expand Up @@ -84,7 +83,6 @@
},
},
settings,
$authUser?.accessToken,
);
$workflowRun.metadata = metadata;
};
Expand Down Expand Up @@ -121,7 +119,6 @@
queryArgs: payloads ? { payloads } : null,
},
$page.data?.settings,
$authUser?.accessToken,
).finally(() => {
reset();
});
Expand Down
16 changes: 8 additions & 8 deletions src/lib/services/data-encoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { get } from 'svelte/store';
import { page } from '$app/stores';

import { translate } from '$lib/i18n/translate';
import { authUser } from '$lib/stores/auth-user';
import {
setLastDataEncoderFailure,
setLastDataEncoderSuccess,
Expand All @@ -16,6 +15,7 @@ import {
} from '$lib/utilities/get-codec';
import { validateHttps } from '$lib/utilities/is-http';
import { stringifyWithBigInt } from '$lib/utilities/parse-with-big-int';
import { getAccessToken, getIdToken } from '$lib/utilities/token-provider';

export type PotentialPayloads = { payloads: unknown[] };

Expand All @@ -41,14 +41,14 @@ export async function codeServerRequest({

if (passAccessToken) {
if (validateHttps(endpoint)) {
let accessToken = get(authUser).accessToken;
const accessTokenExtras = get(authUser).idToken;
if (globalThis?.AccessToken) {
accessToken = await globalThis?.AccessToken();
} else if (accessTokenExtras) {
headers['Authorization-Extras'] = accessTokenExtras;
const accessToken = await getAccessToken();
const idToken = await getIdToken();
if (accessToken) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Element implicitly has an 'any' type because expression of type '"Authorization"' can't be used to index type '{ 'Content-Type': string; 'X-Namespace': string; }'.

headers['Authorization'] = `Bearer ${accessToken}`;
}
if (idToken) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • ⚠️ Element implicitly has an 'any' type because expression of type '"Authorization-Extras"' can't be used to index type '{ 'Content-Type': string; 'X-Namespace': string; }'.

headers['Authorization-Extras'] = idToken;
}
headers['Authorization'] = `Bearer ${accessToken}`;
} else {
setLastDataEncoderFailure();
return payloads;
Expand Down
11 changes: 1 addition & 10 deletions src/lib/services/query-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,12 @@ async function fetchQuery(
export async function getWorkflowMetadata(
options: WorkflowParameters,
settings: Settings,
accessToken: string,
signal?: AbortSignal,
): Promise<WorkflowMetadata> {
try {
const metadata = await getQuery(
{ ...options, queryType: '__temporal_workflow_metadata' },
settings,
accessToken,
signal,
);
if (!metadata.currentDetails) {
Expand Down Expand Up @@ -119,7 +117,6 @@ export async function getWorkflowMetadata(
export async function getQuery(
options: QueryRequestParameters,
settings: Settings,
accessToken: string,
signal?: AbortSignal,
): Promise<ParsedQuery> {
return fetchQuery(options, signal).then(async (execution) => {
Expand All @@ -132,7 +129,6 @@ export async function getQuery(
attributes: queryResult,
namespace: options.namespace,
settings,
accessToken,
});

if (
Expand All @@ -156,11 +152,6 @@ export async function getQuery(
export async function getWorkflowStackTrace(
options: WorkflowParameters,
settings: Settings,
accessToken: string,
): Promise<ParsedQuery> {
return getQuery(
{ ...options, queryType: '__stack_trace' },
settings,
accessToken,
);
return getQuery({ ...options, queryType: '__stack_trace' }, settings);
}
2 changes: 0 additions & 2 deletions src/lib/services/workflow-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
toWorkflowExecutions,
} from '$lib/models/workflow-execution';
import { isCloud } from '$lib/stores/advanced-visibility';
import { authUser } from '$lib/stores/auth-user';
import type {
SearchAttributeInput,
SearchAttributesSchema,
Expand Down Expand Up @@ -833,7 +832,6 @@ export const fetchInitialValuesForStartWorkflow = async ({
startEvent?.attributes?.input,
namespace,
get(page).data.settings,
get(authUser).accessToken,
'readable',
false,
)) as PotentiallyDecodable;
Expand Down
Loading
Loading