-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(OY2-26538): package action changelog #290
Changes from 5 commits
1fc40a0
48c9c23
67c3ac9
a084f38
45d1705
228972f
64f37c0
c283138
049626d
d1bc518
ac5e2b9
1efde1a
ea4f18f
bdb7bd5
43e0caf
6243d62
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
export type Hit<T> = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. here are the opensearch core type definitions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like it. Any reason why the filename is _? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Initially named it |
||
_index: string; | ||
_id: string; | ||
_score: number; | ||
_source: T; | ||
sort: Array<number>; | ||
}; | ||
export type Hits<T> = { | ||
hits: Hit<T>[]; | ||
max_score: number; | ||
total: { value: number; relation: "eq" }; | ||
}; | ||
|
||
export type Response<T> = { | ||
_shards: { | ||
total: number; | ||
failed: number; | ||
successful: number; | ||
skipped: number; | ||
}; | ||
hits: Hits<T>; | ||
total: { | ||
value: number; | ||
}; | ||
max_score: number | null; | ||
took: number; | ||
timed_out: boolean; | ||
aggregations?: AggResult; | ||
}; | ||
|
||
export type FilterType = | ||
| "term" | ||
| "terms" | ||
| "match" | ||
| "range" | ||
| "search" | ||
| "global_search" | ||
| "exists"; | ||
|
||
export type RangeValue = { gte?: string; lte?: string }; | ||
export type FilterValue = string | string[] | number | boolean | RangeValue; | ||
|
||
export type Filterable<_FIELD> = { | ||
type: FilterType; | ||
label?: string; | ||
component?: string; | ||
field: _FIELD; | ||
value: FilterValue; | ||
prefix: "must" | "must_not" | "should" | "filter"; | ||
}; | ||
|
||
export type QueryState<_FIELD> = { | ||
sort: { field: _FIELD; order: "asc" | "desc" }; | ||
pagination: { number: number; size: number }; | ||
filters: Filterable<_FIELD>[]; | ||
search?: string; | ||
}; | ||
|
||
export type AggQuery<_FIELD> = { | ||
name: string; | ||
type: FilterType; | ||
field: _FIELD; | ||
size: number; | ||
}; | ||
|
||
export type AggBucket = { key: string; doc_count: number }; | ||
|
||
export type AggResult = Record< | ||
string, | ||
{ | ||
doc_count_error_upper_bound: number; | ||
sum_other_doc_count: number; | ||
buckets: AggBucket[]; | ||
} | ||
>; | ||
|
||
export type ExportHeaderOptions<TData> = { | ||
transform: (data: TData) => string; | ||
name: string; | ||
}; | ||
|
||
export type Index = "main" | "seatool" | "changelog"; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { | ||
Response as Res, | ||
Hit, | ||
Filterable as FIL, | ||
QueryState, | ||
AggQuery, | ||
} from "./_"; | ||
|
||
export type Document = { | ||
actionType: string; | ||
additionalInformation: string; | ||
attachments?: { | ||
bucket: string; | ||
filename: string; | ||
key: string; | ||
title: string; | ||
uploadDate: number; | ||
}[]; | ||
authority: string; | ||
id: string; | ||
origin: string; | ||
packageId: string; | ||
proposedEffectiveDate: number; | ||
raiWithdrawEnabled: boolean; | ||
rais: any; | ||
requestedDate: number; | ||
responseDate: number; | ||
state: string; | ||
submitterEmail: string; | ||
submitterName: string; | ||
withdrawnDate: number; | ||
}; | ||
|
||
export type Response = Res<Document>; | ||
export type ItemResult = Hit<Document> & { | ||
found: boolean; | ||
}; | ||
|
||
export type Field = keyof Document | `${keyof Document}.keyword`; | ||
export type Filterable = FIL<Field>; | ||
export type State = QueryState<Field>; | ||
export type Aggs = AggQuery<Field>; | ||
Comment on lines
+35
to
+43
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both main and changelog Indices enforce the same naming convention |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * as changelog from "./changelog"; | ||
export * as main from "./main"; | ||
export * from "./_"; | ||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is where namespaces get defined |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { | ||
SeaToolTransform, | ||
OnemacTransform, | ||
OnemacLegacyTransform, | ||
RaiIssueTransform, | ||
RaiResponseTransform, | ||
RaiWithdrawTransform, | ||
WithdrawPackageTransform, | ||
ToggleWithdrawRaiEnabledTransform, | ||
} from ".."; | ||
|
||
import { | ||
Response as Res, | ||
Hit, | ||
Filterable as FIL, | ||
QueryState, | ||
AggQuery, | ||
} from "./_"; | ||
import { ItemResult as Changelog } from "./changelog"; | ||
|
||
export type Document = OnemacTransform & | ||
OnemacLegacyTransform & | ||
SeaToolTransform & | ||
RaiIssueTransform & | ||
RaiResponseTransform & | ||
RaiWithdrawTransform & | ||
WithdrawPackageTransform & | ||
ToggleWithdrawRaiEnabledTransform & { changelog?: Changelog[] }; | ||
|
||
export type Response = Res<Document>; | ||
export type ItemResult = Hit<Document> & { | ||
found: boolean; | ||
}; | ||
|
||
export type Field = keyof Document | `${keyof Document}.keyword`; | ||
export type Filterable = FIL<Field>; | ||
export type State = QueryState<Field>; | ||
export type Aggs = AggQuery<Field>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates the overarching
opensearch
namespace