Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
25 changes: 23 additions & 2 deletions typespec/einnsyn.arkiv.operations.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ interface Routable<T extends Base.Base> {
* @returns The updated object.
*/
@route("/{id}")
@patch
@patch(#{ implicitOptionality: true })
update(@path id: eInnsynId<T>, @body body: T): Responses.OkResponse<T>;

/**
Expand Down Expand Up @@ -174,7 +174,14 @@ namespace Behandlingsprotokoll {
namespace Dokumentbeskrivelse {
@route("/dokumentbeskrivelse")
@tag("Dokumentbeskrivelse")
interface DokumentbeskrivelseRoutes extends Routable<Dokumentbeskrivelse> {}
interface DokumentbeskrivelseRoutes extends Routable<Dokumentbeskrivelse> {
@route("/{id}/dokumentobjekt")
@post
addDokumentobjekt(
@path id: eInnsynId<Dokumentbeskrivelse>,
@body body: ExpandableField<Dokumentobjekt.Dokumentobjekt>,
): Responses.AddResponse<Dokumentobjekt.Dokumentobjekt>;
}
}

namespace Dokumentobjekt {
Expand Down Expand Up @@ -277,6 +284,20 @@ namespace Journalpost {
@path
dokumentbeskrivelseId: eInnsynId<Dokumentbeskrivelse.Dokumentbeskrivelse>,
): Responses.OkResponse<Dokumentbeskrivelse.Dokumentbeskrivelse>;

@route("/{id}/skjerming")
@post
addSkjerming(
@path id: eInnsynId<Journalpost>,
@body skjerming: ExpandableField<Skjerming.Skjerming>,
): Responses.AddResponse<Skjerming.Skjerming>;

@route("/{id}/skjerming/{skjermingId}")
@delete
deleteSkjerming(
@path id: eInnsynId<Journalpost>,
@path skjermingId: eInnsynId<Skjerming.Skjerming>,
): Responses.OkResponse<Skjerming.Skjerming>;
}
}

Expand Down
65 changes: 59 additions & 6 deletions typespec/einnsyn.queryparameters.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ using Http;
namespace EInnsyn;

namespace QueryParameters {
/**
* A date parameter that accepts either absolute dates (ISO 8601) or relative date expressions.
*
* **Absolute date formats:**
* - ISO 8601 date: `2024-01-15`
* - ISO 8601 datetime: `2024-01-15T10:30:00Z`
*
* **Relative date syntax (similar to Grafana/Elasticsearch):**
* - `now` - current time
* - `now-<amount><unit>` - relative to now, e.g., `now-1d`, `now-7d`, `now-1M`, `now-1y`
* - `now+<amount><unit>` - future relative to now, e.g., `now+1d`
* - `now/<unit>` - rounded to unit, e.g., `now/d` (start of day), `now/M` (start of month)
* - `now-<amount><unit>/<unit>` - combined, e.g., `now-1d/d` (start of yesterday)
*
* Supported units: ms (milliseconds), s (seconds), m (minutes), h/H (hours), d (days), w (weeks), M (months), y (years)
*/
scalar timeString extends string;

model QueryParameters {}
model GetParameters extends QueryParameters {
/**
Expand Down Expand Up @@ -86,35 +104,70 @@ namespace QueryParameters {
*/
@query excludeAdministrativEnhetExact?: eInnsynId[];

/**
* Filter by title. This is a free text search.
*/
@query tittel?: string[];

/**
* Filter by sender/recipient name. This is a free text search.
*/
@query korrespondansepartNavn?: string[];

/**
* Filter by legal basis for exemption. This is a free text search.
*/
@query skjermingshjemmel?: string[];

/**
* Filter by the published date of the document.
*/
@query publisertDatoFrom?: utcDateTime | plainDate;
@query publisertDatoFrom?: timeString;

/**
* Filter by the published date of the document.
*/
@query publisertDatoTo?: utcDateTime | plainDate;
@query publisertDatoTo?: timeString;

/**
* Filter by the updated date of the document.
*/
@query oppdatertDatoFrom?: utcDateTime | plainDate;
@query oppdatertDatoFrom?: timeString;

/**
* Filter by the updated date of the document.
*/
@query oppdatertDatoTo?: utcDateTime | plainDate;
@query oppdatertDatoTo?: timeString;

/**
* Filter by journal date.
*/
@query journaldatoFrom?: timeString;

/**
* Filter by journal date.
*/
@query journaldatoTo?: timeString;

/**
* Filter by document date.
*/
@query dokumentetsDatoFrom?: timeString;

/**
* Filter by document date.
*/
@query dokumentetsDatoTo?: timeString;

/**
* Filter by the date of a meeting.
*/
@query moetedatoFrom?: utcDateTime | plainDate;
@query moetedatoFrom?: timeString;

/**
* Filter by the date of a meeting.
*/
@query moetedatoTo?: utcDateTime | plainDate;
@query moetedatoTo?: timeString;

/**
* Filter by saksaar
Expand Down
29 changes: 18 additions & 11 deletions typespec/einnsyn.web.operations.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ namespace Bruker {
): Responses.AddResponse<LagretSoek.LagretSoek>;

@route("/{id}/activate/{secret}")
@patch
@patch(#{ implicitOptionality: true })
activate(
@path id: eInnsynId<Bruker>,
@path secret: string,
): Responses.OkResponse<Bruker>;

@route("/{id}/updatePassword")
@patch
@patch(#{ implicitOptionality: true })
updatePassword(
@path id: eInnsynId<Bruker>,
@body updatePassword: {
Expand All @@ -82,7 +82,7 @@ namespace Bruker {
): Responses.OkResponse<Bruker>;

@route("/{id}/updatePassword/{secret}")
@patch
@patch(#{ implicitOptionality: true })
updatePasswordWithSecret(
@path id: eInnsynId<Bruker>,
@path secret: string,
Expand All @@ -92,7 +92,7 @@ namespace Bruker {
): Responses.OkResponse<Bruker>;

@route("/{id}/requestPasswordReset")
@patch
@patch(#{ implicitOptionality: true })
requestPasswordReset(
@path id: eInnsynId<Bruker>,
): Responses.OkResponse<Bruker>;
Expand Down Expand Up @@ -127,7 +127,7 @@ namespace InnsynskravBestilling {
): Responses.ListResponse<Innsynskrav.Innsynskrav>;

@route("/{id}/verify/{secret}")
@patch
@patch(#{ implicitOptionality: true })
verify(
@path id: eInnsynId,
@path secret: string,
Expand Down Expand Up @@ -190,14 +190,21 @@ namespace Search {
* The field to sort results by. The default is "score".
*/
@query sortBy?:
| "score"
| "id"
| "administrativEnhetNavn"
| "dokumentetsDato"
| "entity"
| "publisertDato"
| "oppdatertDato"
| "moetedato"
| "fulltekst"
| "type" = "score";
| "id"
| "journaldato"
| "journalpostnummer"
| "journalposttype"
| "korrespondansepartNavn"
| "moetedato"
| "oppdatertDato"
| "publisertDato"
| "sakssekvensnummer"
| "score"
| "tittel" = "score";
}
@route("/search")
@tag("Search")
Expand Down
Loading