@innspel/core 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -11,7 +11,7 @@ type CommonCorrelation = {
11
11
  /**
12
12
  * Maskinlesbar feilkode. Klienten forgrener på denne, aldri på message. Meldingen navngir feltet som feilet, aldri innsendte verdier — den kan inneholde fritekst fra innsenderen.
13
13
  */
14
- type CommonErrorCode = 'validation_failed' | 'unknown_field' | 'text_too_short' | 'text_too_long' | 'correlation_invalid' | 'unauthenticated' | 'feedback_token_required' | 'feedback_token_invalid' | 'feedback_token_expired' | 'mfa_required' | 'insufficient_role' | 'insufficient_scope' | 'screenshots_disabled' | 'submission_not_found' | 'known_issue_not_found' | 'program_not_found' | 'invitation_invalid' | 'task_not_found' | 'follow_up_not_found' | 'participant_not_found' | 'subject_not_found' | 'attachment_not_found' | 'webhook_not_found' | 'delivery_not_found' | 'product_not_found' | 'key_not_found' | 'receipt_not_found' | 'report_not_found' | 'handoff_invalid' | 'invalid_status_transition' | 'reply_exists' | 'invitation_already_answered' | 'program_incomplete' | 'program_full' | 'task_already_completed' | 'follow_up_already_answered' | 'report_frozen' | 'webhook_not_verified' | 'attachment_already_uploaded' | 'reply_required' | 'reason_code_required' | 'template_unmodified' | 'fixed_in_required' | 'canonical_is_duplicate' | 'known_issue_conflict' | 'deadline_cannot_be_extended' | 'minors_present_conflict' | 'contacts_exceed_tenant_cap' | 'data_limitations_required' | 'attachment_too_large' | 'attachment_type_not_allowed' | 'rate_limited' | 'not_implemented';
14
+ type CommonErrorCode = 'validation_failed' | 'unknown_field' | 'text_too_short' | 'text_too_long' | 'correlation_invalid' | 'unauthenticated' | 'feedback_token_required' | 'feedback_token_invalid' | 'feedback_token_expired' | 'mfa_required' | 'insufficient_role' | 'insufficient_scope' | 'screenshots_disabled' | 'submission_not_found' | 'known_issue_not_found' | 'program_not_found' | 'invitation_invalid' | 'task_not_found' | 'follow_up_not_found' | 'participant_not_found' | 'subject_not_found' | 'attachment_not_found' | 'webhook_not_found' | 'delivery_not_found' | 'product_not_found' | 'key_not_found' | 'receipt_not_found' | 'report_not_found' | 'handoff_invalid' | 'invalid_status_transition' | 'reply_exists' | 'invitation_already_answered' | 'program_incomplete' | 'program_full' | 'task_already_completed' | 'follow_up_already_answered' | 'follow_up_not_answerable' | 'report_frozen' | 'webhook_not_verified' | 'attachment_already_uploaded' | 'reply_required' | 'reason_code_required' | 'template_unmodified' | 'fixed_in_required' | 'canonical_is_duplicate' | 'known_issue_conflict' | 'deadline_cannot_be_extended' | 'minors_present_conflict' | 'contacts_exceed_tenant_cap' | 'data_limitations_required' | 'attachment_too_large' | 'attachment_type_not_allowed' | 'rate_limited' | 'not_implemented';
15
15
  /**
16
16
  * Plattformen innsendingen kom fra. Lukket liste fra dag én, inkludert storskjerm — en verdi som legges til senere er en kontraktendring hos alle SDK-er (ideer/storskjerm-qr-handoff.md).
17
17
  */
@@ -43,6 +43,14 @@ type KnownIssuesKnownIssueStatus = 'aktiv' | 'fikset';
43
43
  * paaminnelse bærer alltid fristen i teksten; tilbud_om_utgang er eneste lovlige form for den betingede kontakten når ingen oppgave er gjort (DD-34).
44
44
  */
45
45
  type ProgramsFollowUpKind = 'paaminnelse' | 'hvordan_gikk_det' | 'sjekkpunkt' | 'tilbud_om_utgang';
46
+ /**
47
+ * Svar på en oppfølging med spørsmål (kind = hvordan_gikk_det eller sjekkpunkt): tre lukkede valg (fungerte · delvis · ikke) og valgfri fritekst ≤ 140 (domain-model.md Response). Én per FollowUp. Skala 1–5 er FORKASTET 2026-09-07 — se tech-decisions.md M3.2 (forts.).
48
+ */
49
+ type ProgramsFollowUpResponseCreate = {
50
+ outcome: ProgramsTaskOutcome;
51
+ text?: string;
52
+ submissionId?: string;
53
+ };
46
54
  /**
47
55
  * En oppfølging som er sendt ut til kalleren og ikke besvart. Teksten bærer fristen når kind = paaminnelse (DD-34).
48
56
  */
@@ -138,12 +146,21 @@ type ProgramsTask = {
138
146
  estimatedMinutes: number;
139
147
  };
140
148
  /**
141
- * Én fullført oppgave, som testeren ser den.
149
+ * Testeren fullfører en oppgave med utfall (3c «Hvordan gikk det?»). text er den valgfrie setningen «Vil du si én setning om det?» ≤ 140 — vises på programsiden per oppgave, aldri i innboksen, og slettes med pseudonymet. Valgfri kobling til innspillet som ble sendt underveis.
150
+ */
151
+ type ProgramsTaskCompletionCreate = {
152
+ outcome: ProgramsTaskOutcome;
153
+ text?: string;
154
+ submissionId?: string;
155
+ };
156
+ /**
157
+ * Én fullført oppgave, som testeren ser den. text er testerens egen setning fra «Gjort» (3c), aldri fra panelet.
142
158
  */
143
159
  type ProgramsTaskCompletionView = {
144
160
  taskId: string;
145
161
  outcome: ProgramsTaskOutcome;
146
162
  at: string;
163
+ text?: string;
147
164
  submissionId?: string;
148
165
  };
149
166
  /**
@@ -547,6 +564,19 @@ interface InnspelClient {
547
564
  decline(invitationToken: string): Promise<void>;
548
565
  /** «Gå ut» (DD-36): umiddelbart, alltid tilgjengelig, og aldri en straff. Idempotent. */
549
566
  withdraw(participationId: string): Promise<ProgramsParticipationView>;
567
+ /**
568
+ * «Gjort» (3c): ett av tre lukkede utfall — fungerte · delvis · ikke — og en valgfri
569
+ * setning ≤ 140. Én per oppgave; et gjentak er 409 `task_already_completed`. En egen
570
+ * innsending kan henge ved. Teller `task_completed` med utfallet, aldri teksten.
571
+ */
572
+ completeTask(taskId: string, completion: ProgramsTaskCompletionCreate): Promise<ProgramsTaskCompletionView>;
573
+ /**
574
+ * «Hvordan gikk det?» på en utsendt oppfølging fra `list().pendingFollowUps`: de samme
575
+ * tre valgene og en valgfri setning ≤ 140. Bare `hvordan_gikk_det` og `sjekkpunkt` tar
576
+ * svar — en påminnelse eller et tilbud om utgang gir 409 `follow_up_not_answerable`.
577
+ * Engangs (409 `follow_up_already_answered`). Teller `followup_answered`.
578
+ */
579
+ respond(followUpId: string, response: ProgramsFollowUpResponseCreate): Promise<void>;
550
580
  };
551
581
  readonly attachments: {
552
582
  /**
@@ -755,6 +785,6 @@ declare function dekkerAlt(rekter: readonly MaskRect[], bilde: {
755
785
  * ikke kan lese JSON, og `test/versjon.test.ts` holder den i takt med
756
786
  * `package.json`.
757
787
  */
758
- declare const VERSJON = "0.4.0";
788
+ declare const VERSJON = "0.5.0";
759
789
 
760
- export { type AttachmentBody, type AttachmentInput, type SubmissionsAttachmentMime as AttachmentMime, type AttachmentOutcome, type SubmissionsAttachmentView as AttachmentView, type CaptureFeil, type CaptureInput, type CaptureOnske, type CaptureResult, type ContextInput, type CommonCorrelation as Correlation, type CommonErrorCode as ErrorCode, type FlushResult, type IdentityProvider, InnspelApiError, type InnspelClient, InnspelConfigError, type InnspelOptions, InnspelQueueFullError, type InnspelStorage, type ProgramsInvitationView as InvitationView, KONTEKST_FELTER, KO_TAK, type KnownIssuesKnownIssueCard as KnownIssueCard, type KnownIssueQuery, type SubmissionsKnownIssueRef as KnownIssueRef, type KnownIssuesKnownIssueStatus as KnownIssueStatus, type MaskPoint, type MaskRect, type ProgramsMyPrograms as MyPrograms, type MySubmission, type OpenFeedbackOptions, type ProgramsParticipationView as ParticipationView, type PatternFinding, type PatternKind, type CommonPlatform as Platform, type Presenter, type ProgramsTask as ProgramTask, type ProgramsProgramView as ProgramView, type QueuedSubmission, type SubmissionsReasonCode as ReasonCode, type SubmissionsReplyView as ReplyView, type ResolvedSettings, type SubmissionsStatusType as StatusType, type SubmissionsSubmissionStatus as SubmissionStatus, type SubmissionsSubmissionStatusView as SubmissionStatusView, type SubmissionsSubmissionType as SubmissionType, TILLATTE_MIME, type ProgramsTaskOutcome as TaskOutcome, type Telemetry, type TelemetryEvent, type TextMaxLength, VEDLEGG_GRENSER, VERSJON, dekkerAlt, init, klipp, scanText, skaler, strokTilRekter, treffer, trykkTilRekt };
790
+ export { type AttachmentBody, type AttachmentInput, type SubmissionsAttachmentMime as AttachmentMime, type AttachmentOutcome, type SubmissionsAttachmentView as AttachmentView, type CaptureFeil, type CaptureInput, type CaptureOnske, type CaptureResult, type ContextInput, type CommonCorrelation as Correlation, type CommonErrorCode as ErrorCode, type FlushResult, type ProgramsFollowUpKind as FollowUpKind, type ProgramsFollowUpResponseCreate as FollowUpResponseCreate, type ProgramsFollowUpView as FollowUpView, type IdentityProvider, InnspelApiError, type InnspelClient, InnspelConfigError, type InnspelOptions, InnspelQueueFullError, type InnspelStorage, type ProgramsInvitationView as InvitationView, KONTEKST_FELTER, KO_TAK, type KnownIssuesKnownIssueCard as KnownIssueCard, type KnownIssueQuery, type SubmissionsKnownIssueRef as KnownIssueRef, type KnownIssuesKnownIssueStatus as KnownIssueStatus, type MaskPoint, type MaskRect, type ProgramsMyPrograms as MyPrograms, type MySubmission, type OpenFeedbackOptions, type ProgramsParticipationView as ParticipationView, type PatternFinding, type PatternKind, type CommonPlatform as Platform, type Presenter, type ProgramsTask as ProgramTask, type ProgramsProgramView as ProgramView, type QueuedSubmission, type SubmissionsReasonCode as ReasonCode, type SubmissionsReplyView as ReplyView, type ResolvedSettings, type SubmissionsStatusType as StatusType, type SubmissionsSubmissionStatus as SubmissionStatus, type SubmissionsSubmissionStatusView as SubmissionStatusView, type SubmissionsSubmissionType as SubmissionType, TILLATTE_MIME, type ProgramsTaskCompletionCreate as TaskCompletionCreate, type ProgramsTaskCompletionView as TaskCompletionView, type ProgramsTaskOutcome as TaskOutcome, type Telemetry, type TelemetryEvent, type TextMaxLength, VEDLEGG_GRENSER, VERSJON, dekkerAlt, init, klipp, scanText, skaler, strokTilRekter, treffer, trykkTilRekt };
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ type CommonCorrelation = {
11
11
  /**
12
12
  * Maskinlesbar feilkode. Klienten forgrener på denne, aldri på message. Meldingen navngir feltet som feilet, aldri innsendte verdier — den kan inneholde fritekst fra innsenderen.
13
13
  */
14
- type CommonErrorCode = 'validation_failed' | 'unknown_field' | 'text_too_short' | 'text_too_long' | 'correlation_invalid' | 'unauthenticated' | 'feedback_token_required' | 'feedback_token_invalid' | 'feedback_token_expired' | 'mfa_required' | 'insufficient_role' | 'insufficient_scope' | 'screenshots_disabled' | 'submission_not_found' | 'known_issue_not_found' | 'program_not_found' | 'invitation_invalid' | 'task_not_found' | 'follow_up_not_found' | 'participant_not_found' | 'subject_not_found' | 'attachment_not_found' | 'webhook_not_found' | 'delivery_not_found' | 'product_not_found' | 'key_not_found' | 'receipt_not_found' | 'report_not_found' | 'handoff_invalid' | 'invalid_status_transition' | 'reply_exists' | 'invitation_already_answered' | 'program_incomplete' | 'program_full' | 'task_already_completed' | 'follow_up_already_answered' | 'report_frozen' | 'webhook_not_verified' | 'attachment_already_uploaded' | 'reply_required' | 'reason_code_required' | 'template_unmodified' | 'fixed_in_required' | 'canonical_is_duplicate' | 'known_issue_conflict' | 'deadline_cannot_be_extended' | 'minors_present_conflict' | 'contacts_exceed_tenant_cap' | 'data_limitations_required' | 'attachment_too_large' | 'attachment_type_not_allowed' | 'rate_limited' | 'not_implemented';
14
+ type CommonErrorCode = 'validation_failed' | 'unknown_field' | 'text_too_short' | 'text_too_long' | 'correlation_invalid' | 'unauthenticated' | 'feedback_token_required' | 'feedback_token_invalid' | 'feedback_token_expired' | 'mfa_required' | 'insufficient_role' | 'insufficient_scope' | 'screenshots_disabled' | 'submission_not_found' | 'known_issue_not_found' | 'program_not_found' | 'invitation_invalid' | 'task_not_found' | 'follow_up_not_found' | 'participant_not_found' | 'subject_not_found' | 'attachment_not_found' | 'webhook_not_found' | 'delivery_not_found' | 'product_not_found' | 'key_not_found' | 'receipt_not_found' | 'report_not_found' | 'handoff_invalid' | 'invalid_status_transition' | 'reply_exists' | 'invitation_already_answered' | 'program_incomplete' | 'program_full' | 'task_already_completed' | 'follow_up_already_answered' | 'follow_up_not_answerable' | 'report_frozen' | 'webhook_not_verified' | 'attachment_already_uploaded' | 'reply_required' | 'reason_code_required' | 'template_unmodified' | 'fixed_in_required' | 'canonical_is_duplicate' | 'known_issue_conflict' | 'deadline_cannot_be_extended' | 'minors_present_conflict' | 'contacts_exceed_tenant_cap' | 'data_limitations_required' | 'attachment_too_large' | 'attachment_type_not_allowed' | 'rate_limited' | 'not_implemented';
15
15
  /**
16
16
  * Plattformen innsendingen kom fra. Lukket liste fra dag én, inkludert storskjerm — en verdi som legges til senere er en kontraktendring hos alle SDK-er (ideer/storskjerm-qr-handoff.md).
17
17
  */
@@ -43,6 +43,14 @@ type KnownIssuesKnownIssueStatus = 'aktiv' | 'fikset';
43
43
  * paaminnelse bærer alltid fristen i teksten; tilbud_om_utgang er eneste lovlige form for den betingede kontakten når ingen oppgave er gjort (DD-34).
44
44
  */
45
45
  type ProgramsFollowUpKind = 'paaminnelse' | 'hvordan_gikk_det' | 'sjekkpunkt' | 'tilbud_om_utgang';
46
+ /**
47
+ * Svar på en oppfølging med spørsmål (kind = hvordan_gikk_det eller sjekkpunkt): tre lukkede valg (fungerte · delvis · ikke) og valgfri fritekst ≤ 140 (domain-model.md Response). Én per FollowUp. Skala 1–5 er FORKASTET 2026-09-07 — se tech-decisions.md M3.2 (forts.).
48
+ */
49
+ type ProgramsFollowUpResponseCreate = {
50
+ outcome: ProgramsTaskOutcome;
51
+ text?: string;
52
+ submissionId?: string;
53
+ };
46
54
  /**
47
55
  * En oppfølging som er sendt ut til kalleren og ikke besvart. Teksten bærer fristen når kind = paaminnelse (DD-34).
48
56
  */
@@ -138,12 +146,21 @@ type ProgramsTask = {
138
146
  estimatedMinutes: number;
139
147
  };
140
148
  /**
141
- * Én fullført oppgave, som testeren ser den.
149
+ * Testeren fullfører en oppgave med utfall (3c «Hvordan gikk det?»). text er den valgfrie setningen «Vil du si én setning om det?» ≤ 140 — vises på programsiden per oppgave, aldri i innboksen, og slettes med pseudonymet. Valgfri kobling til innspillet som ble sendt underveis.
150
+ */
151
+ type ProgramsTaskCompletionCreate = {
152
+ outcome: ProgramsTaskOutcome;
153
+ text?: string;
154
+ submissionId?: string;
155
+ };
156
+ /**
157
+ * Én fullført oppgave, som testeren ser den. text er testerens egen setning fra «Gjort» (3c), aldri fra panelet.
142
158
  */
143
159
  type ProgramsTaskCompletionView = {
144
160
  taskId: string;
145
161
  outcome: ProgramsTaskOutcome;
146
162
  at: string;
163
+ text?: string;
147
164
  submissionId?: string;
148
165
  };
149
166
  /**
@@ -547,6 +564,19 @@ interface InnspelClient {
547
564
  decline(invitationToken: string): Promise<void>;
548
565
  /** «Gå ut» (DD-36): umiddelbart, alltid tilgjengelig, og aldri en straff. Idempotent. */
549
566
  withdraw(participationId: string): Promise<ProgramsParticipationView>;
567
+ /**
568
+ * «Gjort» (3c): ett av tre lukkede utfall — fungerte · delvis · ikke — og en valgfri
569
+ * setning ≤ 140. Én per oppgave; et gjentak er 409 `task_already_completed`. En egen
570
+ * innsending kan henge ved. Teller `task_completed` med utfallet, aldri teksten.
571
+ */
572
+ completeTask(taskId: string, completion: ProgramsTaskCompletionCreate): Promise<ProgramsTaskCompletionView>;
573
+ /**
574
+ * «Hvordan gikk det?» på en utsendt oppfølging fra `list().pendingFollowUps`: de samme
575
+ * tre valgene og en valgfri setning ≤ 140. Bare `hvordan_gikk_det` og `sjekkpunkt` tar
576
+ * svar — en påminnelse eller et tilbud om utgang gir 409 `follow_up_not_answerable`.
577
+ * Engangs (409 `follow_up_already_answered`). Teller `followup_answered`.
578
+ */
579
+ respond(followUpId: string, response: ProgramsFollowUpResponseCreate): Promise<void>;
550
580
  };
551
581
  readonly attachments: {
552
582
  /**
@@ -755,6 +785,6 @@ declare function dekkerAlt(rekter: readonly MaskRect[], bilde: {
755
785
  * ikke kan lese JSON, og `test/versjon.test.ts` holder den i takt med
756
786
  * `package.json`.
757
787
  */
758
- declare const VERSJON = "0.4.0";
788
+ declare const VERSJON = "0.5.0";
759
789
 
760
- export { type AttachmentBody, type AttachmentInput, type SubmissionsAttachmentMime as AttachmentMime, type AttachmentOutcome, type SubmissionsAttachmentView as AttachmentView, type CaptureFeil, type CaptureInput, type CaptureOnske, type CaptureResult, type ContextInput, type CommonCorrelation as Correlation, type CommonErrorCode as ErrorCode, type FlushResult, type IdentityProvider, InnspelApiError, type InnspelClient, InnspelConfigError, type InnspelOptions, InnspelQueueFullError, type InnspelStorage, type ProgramsInvitationView as InvitationView, KONTEKST_FELTER, KO_TAK, type KnownIssuesKnownIssueCard as KnownIssueCard, type KnownIssueQuery, type SubmissionsKnownIssueRef as KnownIssueRef, type KnownIssuesKnownIssueStatus as KnownIssueStatus, type MaskPoint, type MaskRect, type ProgramsMyPrograms as MyPrograms, type MySubmission, type OpenFeedbackOptions, type ProgramsParticipationView as ParticipationView, type PatternFinding, type PatternKind, type CommonPlatform as Platform, type Presenter, type ProgramsTask as ProgramTask, type ProgramsProgramView as ProgramView, type QueuedSubmission, type SubmissionsReasonCode as ReasonCode, type SubmissionsReplyView as ReplyView, type ResolvedSettings, type SubmissionsStatusType as StatusType, type SubmissionsSubmissionStatus as SubmissionStatus, type SubmissionsSubmissionStatusView as SubmissionStatusView, type SubmissionsSubmissionType as SubmissionType, TILLATTE_MIME, type ProgramsTaskOutcome as TaskOutcome, type Telemetry, type TelemetryEvent, type TextMaxLength, VEDLEGG_GRENSER, VERSJON, dekkerAlt, init, klipp, scanText, skaler, strokTilRekter, treffer, trykkTilRekt };
790
+ export { type AttachmentBody, type AttachmentInput, type SubmissionsAttachmentMime as AttachmentMime, type AttachmentOutcome, type SubmissionsAttachmentView as AttachmentView, type CaptureFeil, type CaptureInput, type CaptureOnske, type CaptureResult, type ContextInput, type CommonCorrelation as Correlation, type CommonErrorCode as ErrorCode, type FlushResult, type ProgramsFollowUpKind as FollowUpKind, type ProgramsFollowUpResponseCreate as FollowUpResponseCreate, type ProgramsFollowUpView as FollowUpView, type IdentityProvider, InnspelApiError, type InnspelClient, InnspelConfigError, type InnspelOptions, InnspelQueueFullError, type InnspelStorage, type ProgramsInvitationView as InvitationView, KONTEKST_FELTER, KO_TAK, type KnownIssuesKnownIssueCard as KnownIssueCard, type KnownIssueQuery, type SubmissionsKnownIssueRef as KnownIssueRef, type KnownIssuesKnownIssueStatus as KnownIssueStatus, type MaskPoint, type MaskRect, type ProgramsMyPrograms as MyPrograms, type MySubmission, type OpenFeedbackOptions, type ProgramsParticipationView as ParticipationView, type PatternFinding, type PatternKind, type CommonPlatform as Platform, type Presenter, type ProgramsTask as ProgramTask, type ProgramsProgramView as ProgramView, type QueuedSubmission, type SubmissionsReasonCode as ReasonCode, type SubmissionsReplyView as ReplyView, type ResolvedSettings, type SubmissionsStatusType as StatusType, type SubmissionsSubmissionStatus as SubmissionStatus, type SubmissionsSubmissionStatusView as SubmissionStatusView, type SubmissionsSubmissionType as SubmissionType, TILLATTE_MIME, type ProgramsTaskCompletionCreate as TaskCompletionCreate, type ProgramsTaskCompletionView as TaskCompletionView, type ProgramsTaskOutcome as TaskOutcome, type Telemetry, type TelemetryEvent, type TextMaxLength, VEDLEGG_GRENSER, VERSJON, dekkerAlt, init, klipp, scanText, skaler, strokTilRekter, treffer, trykkTilRekt };
package/dist/index.js CHANGED
@@ -809,6 +809,19 @@ var configGet = (options) => (options?.client ?? client).get({
809
809
  url: "/v1/ingest/config",
810
810
  ...options
811
811
  });
812
+ var programsRespond = (options) => (options.client ?? client).post({
813
+ security: [{ name: "X-Innspel-Tenant-Key", type: "apiKey" }, {
814
+ key: "FeedbackTokenAuth",
815
+ scheme: "bearer",
816
+ type: "http"
817
+ }],
818
+ url: "/v1/ingest/follow-ups/{id}/respond",
819
+ ...options,
820
+ headers: {
821
+ "Content-Type": "application/json",
822
+ ...options.headers
823
+ }
824
+ });
812
825
  var programsAccept = (options) => (options.client ?? client).post({
813
826
  security: [{ name: "X-Innspel-Tenant-Key", type: "apiKey" }, {
814
827
  key: "FeedbackTokenAuth",
@@ -898,6 +911,19 @@ var submissionsStatus = (options) => (options.client ?? client).get({
898
911
  url: "/v1/ingest/submissions/{id}/status",
899
912
  ...options
900
913
  });
914
+ var programsCompleteTask = (options) => (options.client ?? client).post({
915
+ security: [{ name: "X-Innspel-Tenant-Key", type: "apiKey" }, {
916
+ key: "FeedbackTokenAuth",
917
+ scheme: "bearer",
918
+ type: "http"
919
+ }],
920
+ url: "/v1/ingest/tasks/{id}/complete",
921
+ ...options,
922
+ headers: {
923
+ "Content-Type": "application/json",
924
+ ...options.headers
925
+ }
926
+ });
901
927
 
902
928
  // src/feil.ts
903
929
  var PREFIKS = "[innspel]";
@@ -1244,11 +1270,21 @@ async function lastOppTilLagring(fetchImpl, presign, body, signal) {
1244
1270
  }
1245
1271
 
1246
1272
  // src/versjon.ts
1247
- var VERSJON = "0.4.0";
1273
+ var VERSJON = "0.5.0";
1248
1274
 
1249
1275
  // src/klient.ts
1250
1276
  var STANDARD_TIMEOUT_MS = 1e4;
1251
1277
  var noopTelemetri = { emit: () => void 0 };
1278
+ var UTFALL = ["fungerte", "delvis", "ikke"];
1279
+ var SETNING_MAKS = 140;
1280
+ function validerUtfall(input) {
1281
+ if (!UTFALL.includes(input.outcome)) {
1282
+ throw new InnspelConfigError("outcome", `m\xE5 v\xE6re ett av ${UTFALL.join(" \xB7 ")}`);
1283
+ }
1284
+ if (input.text !== void 0 && (typeof input.text !== "string" || input.text.length > SETNING_MAKS)) {
1285
+ throw new InnspelConfigError("text", `er valgfri, men aldri lengre enn ${SETNING_MAKS} tegn`);
1286
+ }
1287
+ }
1252
1288
  function krev(betingelse, felt, hva) {
1253
1289
  if (!betingelse) throw new InnspelConfigError(felt, hva);
1254
1290
  }
@@ -1616,6 +1652,41 @@ function init(options) {
1616
1652
  path: { id: participationId }
1617
1653
  })
1618
1654
  );
1655
+ },
1656
+ async completeTask(taskId, completion) {
1657
+ if (typeof taskId !== "string" || taskId.length === 0) {
1658
+ throw new InnspelConfigError("taskId", "mangler \u2014 bruk id fra program.tasks i programs.list()");
1659
+ }
1660
+ validerUtfall(completion);
1661
+ krevToken();
1662
+ const svar = await medToken(
1663
+ (h) => programsCompleteTask({
1664
+ client: klient,
1665
+ headers: h,
1666
+ signal: signal(),
1667
+ path: { id: taskId },
1668
+ body: completion
1669
+ })
1670
+ );
1671
+ telemetri.emit({ name: "task_completed", outcome: completion.outcome });
1672
+ return svar;
1673
+ },
1674
+ async respond(followUpId, response) {
1675
+ if (typeof followUpId !== "string" || followUpId.length === 0) {
1676
+ throw new InnspelConfigError("followUpId", "mangler \u2014 bruk id fra pendingFollowUps i programs.list()");
1677
+ }
1678
+ validerUtfall(response);
1679
+ krevToken();
1680
+ await medToken(
1681
+ (h) => programsRespond({
1682
+ client: klient,
1683
+ headers: h,
1684
+ signal: signal(),
1685
+ path: { id: followUpId },
1686
+ body: response
1687
+ })
1688
+ );
1689
+ telemetri.emit({ name: "followup_answered" });
1619
1690
  }
1620
1691
  },
1621
1692
  attachments: {