Skip to content

Commit

Permalink
remove types
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidNic11 committed Feb 6, 2025
1 parent e27b77f commit 96ffa48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 82 deletions.
8 changes: 4 additions & 4 deletions public/jira-oidc-helpers/jira.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import chunkArray from "../utils/array/chunk-array";
import mapIdsToNames from "../utils/object/map-ids-to-names";
import { responseToText } from "../utils/fetch/response-to-text";
import { FetchJiraIssuesParams } from "../jira/shared/types";
import { Config, Issue, ProgressData, OidcJiraIssue, ChangeLog, InterimJiraIssue, ResponsesParsedJqlQueries } from "./types";
import { Config, Issue, ProgressData, OidcJiraIssue, ChangeLog, InterimJiraIssue } from "./types";
import { fetchFromLocalStorage } from "./storage";
import { fetchAllJiraIssuesWithJQLAndFetchAllChangelog } from "./fetchAllJiraIssuesWithJQLAndFetchAllChangelog";
import { uniqueKeys } from "../utils/array/unique";
Expand Down Expand Up @@ -58,7 +58,9 @@ export function fetchJiraIssuesWithJQLWithNamedFields(config: Config) {

const newParams = {
...params,
fields: params.fields?.map((f) => ((fields?.nameMap && f in fields.nameMap) ? fields.nameMap[f] : f)),
fields: params.fields?.map((f) =>
fields?.nameMap && f in fields.nameMap ? fields.nameMap[f] : f
),
};
const response = await fetchJiraIssuesWithJQL(config)(newParams);
const uniqueIssues = uniqueKeys(response.issues as OidcJiraIssue[]);
Expand Down Expand Up @@ -331,5 +333,3 @@ export function editJiraIssueWithNamedFields(config: Config) {
).then(responseToText);
};
}


78 changes: 0 additions & 78 deletions public/jira-oidc-helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,81 +74,3 @@ export type Config = {
fieldsRequest: () => FieldsRequest;
host: "jira" | "hosted";
};

export type ResponsesParsedJqlQueries = {
queries: ParsedJqlQueries[];
};

type ParsedJqlQueries = {
query: string;
structure?: {
orderBy?: {
fields: JqlQueryOrderByClauseElement[];
};
where?: CompoundClause | FieldValueClause | FieldWasClause | FieldChangeClause;
};
errors?: string[];
};

interface CompoundClause {
clauses: Array<CompoundClause | FieldValueClause | FieldWasClause | FieldChangeClause>;
operator: string;
}

interface FieldValueClause {
field: JqlQueryField;
operand: ListOperand | ValueOperand | FunctionOperand | KeywordOperand;
operator: string;
}
interface FieldWasClause {
field: JqlQueryField;
operand: ListOperand | ValueOperand | FunctionOperand | KeywordOperand;
operator: string;
predicates: JqlQueryClauseTimePredicate[];
}
interface FieldChangeClause {
field: JqlQueryField;
operator: string;
predicates: JqlQueryClauseTimePredicate[];
}

interface ListOperand {
encodedOperand?: string;
values: Array<ValueOperand | FunctionOperand | KeywordOperand>;
}

interface ValueOperand {
encodedValue?: string;
value: string;
}

interface FunctionOperand {
arguments: string[];
encodedOperand?: string;
function: string;
}

interface KeywordOperand {
keyword: string;
}

interface JqlQueryClauseTimePredicate {
operand: ListOperand | ValueOperand | FunctionOperand | KeywordOperand;
operator: string;
}

interface JqlQueryOrderByClauseElement {
direction: string;
field: JqlQueryField;
}
interface JqlQueryField {
encodedName?: string;
name: string;
property?: JqlQueryFieldEntityProperty[];
}
interface JqlQueryFieldEntityProperty {
entity: string;
key: string;
path: string;
type?: string;
}

0 comments on commit 96ffa48

Please sign in to comment.