@innspel/core 0.3.0 → 0.4.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
@@ -533,7 +533,20 @@ interface InnspelClient {
533
533
  status(submissionId: string): Promise<SubmissionsSubmissionStatusView>;
534
534
  };
535
535
  readonly programs: {
536
+ /** Alt om betaprogram for innsenderen i ett kall: invitasjoner til banneret (DD-12), deltakelser til fanen, og oppfølginger som venter. */
536
537
  list(): Promise<ProgramsMyPrograms>;
538
+ /**
539
+ * Aksepterer invitasjonen etter forventningsavklaringen (DD-13, DD-32).
540
+ * Tokenet kom fra leietakerens egen kanal — plattformen sender aldri (DD-12).
541
+ * Er det brukt, utløpt eller utstedt til noen andre, kommer 404
542
+ * `invitation_invalid`. Gjentak fra samme innsender er trygt: svaret er den
543
+ * samme deltakelsen.
544
+ */
545
+ accept(invitationToken: string): Promise<ProgramsParticipationView>;
546
+ /** Avslår invitasjonen. Ingen årsak spørres. Et nei etter ja er {@link withdraw}, ikke avslag. */
547
+ decline(invitationToken: string): Promise<void>;
548
+ /** «Gå ut» (DD-36): umiddelbart, alltid tilgjengelig, og aldri en straff. Idempotent. */
549
+ withdraw(participationId: string): Promise<ProgramsParticipationView>;
537
550
  };
538
551
  readonly attachments: {
539
552
  /**
@@ -742,6 +755,6 @@ declare function dekkerAlt(rekter: readonly MaskRect[], bilde: {
742
755
  * ikke kan lese JSON, og `test/versjon.test.ts` holder den i takt med
743
756
  * `package.json`.
744
757
  */
745
- declare const VERSJON = "0.3.0";
758
+ declare const VERSJON = "0.4.0";
746
759
 
747
- 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, 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 PatternFinding, type PatternKind, type CommonPlatform as Platform, type Presenter, 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 Telemetry, type TelemetryEvent, type TextMaxLength, VEDLEGG_GRENSER, VERSJON, dekkerAlt, init, klipp, scanText, skaler, strokTilRekter, treffer, trykkTilRekt };
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 };
package/dist/index.d.ts CHANGED
@@ -533,7 +533,20 @@ interface InnspelClient {
533
533
  status(submissionId: string): Promise<SubmissionsSubmissionStatusView>;
534
534
  };
535
535
  readonly programs: {
536
+ /** Alt om betaprogram for innsenderen i ett kall: invitasjoner til banneret (DD-12), deltakelser til fanen, og oppfølginger som venter. */
536
537
  list(): Promise<ProgramsMyPrograms>;
538
+ /**
539
+ * Aksepterer invitasjonen etter forventningsavklaringen (DD-13, DD-32).
540
+ * Tokenet kom fra leietakerens egen kanal — plattformen sender aldri (DD-12).
541
+ * Er det brukt, utløpt eller utstedt til noen andre, kommer 404
542
+ * `invitation_invalid`. Gjentak fra samme innsender er trygt: svaret er den
543
+ * samme deltakelsen.
544
+ */
545
+ accept(invitationToken: string): Promise<ProgramsParticipationView>;
546
+ /** Avslår invitasjonen. Ingen årsak spørres. Et nei etter ja er {@link withdraw}, ikke avslag. */
547
+ decline(invitationToken: string): Promise<void>;
548
+ /** «Gå ut» (DD-36): umiddelbart, alltid tilgjengelig, og aldri en straff. Idempotent. */
549
+ withdraw(participationId: string): Promise<ProgramsParticipationView>;
537
550
  };
538
551
  readonly attachments: {
539
552
  /**
@@ -742,6 +755,6 @@ declare function dekkerAlt(rekter: readonly MaskRect[], bilde: {
742
755
  * ikke kan lese JSON, og `test/versjon.test.ts` holder den i takt med
743
756
  * `package.json`.
744
757
  */
745
- declare const VERSJON = "0.3.0";
758
+ declare const VERSJON = "0.4.0";
746
759
 
747
- 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, 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 PatternFinding, type PatternKind, type CommonPlatform as Platform, type Presenter, 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 Telemetry, type TelemetryEvent, type TextMaxLength, VEDLEGG_GRENSER, VERSJON, dekkerAlt, init, klipp, scanText, skaler, strokTilRekter, treffer, trykkTilRekt };
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 };
package/dist/index.js CHANGED
@@ -809,6 +809,24 @@ var configGet = (options) => (options?.client ?? client).get({
809
809
  url: "/v1/ingest/config",
810
810
  ...options
811
811
  });
812
+ var programsAccept = (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/invitations/{token}/accept",
819
+ ...options
820
+ });
821
+ var programsDecline = (options) => (options.client ?? client).post({
822
+ security: [{ name: "X-Innspel-Tenant-Key", type: "apiKey" }, {
823
+ key: "FeedbackTokenAuth",
824
+ scheme: "bearer",
825
+ type: "http"
826
+ }],
827
+ url: "/v1/ingest/invitations/{token}/decline",
828
+ ...options
829
+ });
812
830
  var knownIssuesList2 = (options) => (options?.client ?? client).get({
813
831
  security: [{ name: "X-Innspel-Tenant-Key", type: "apiKey" }, {
814
832
  key: "FeedbackTokenAuth",
@@ -831,6 +849,15 @@ var knownIssuesConfirm = (options) => (options.client ?? client).post({
831
849
  ...options.headers
832
850
  }
833
851
  });
852
+ var programsWithdraw = (options) => (options.client ?? client).post({
853
+ security: [{ name: "X-Innspel-Tenant-Key", type: "apiKey" }, {
854
+ key: "FeedbackTokenAuth",
855
+ scheme: "bearer",
856
+ type: "http"
857
+ }],
858
+ url: "/v1/ingest/participations/{id}/withdraw",
859
+ ...options
860
+ });
834
861
  var programsListMine = (options) => (options?.client ?? client).get({
835
862
  security: [{ name: "X-Innspel-Tenant-Key", type: "apiKey" }, {
836
863
  key: "FeedbackTokenAuth",
@@ -1217,7 +1244,7 @@ async function lastOppTilLagring(fetchImpl, presign, body, signal) {
1217
1244
  }
1218
1245
 
1219
1246
  // src/versjon.ts
1220
- var VERSJON = "0.3.0";
1247
+ var VERSJON = "0.4.0";
1221
1248
 
1222
1249
  // src/klient.ts
1223
1250
  var STANDARD_TIMEOUT_MS = 1e4;
@@ -1327,6 +1354,14 @@ function init(options) {
1327
1354
  if (!res.response.ok) throw tilApiFeil(res.response.status, res.error, res.response);
1328
1355
  return res.data;
1329
1356
  }
1357
+ function krevInvitasjonstoken(token) {
1358
+ if (typeof token !== "string" || token.length === 0) {
1359
+ throw new InnspelConfigError(
1360
+ "invitationToken",
1361
+ "mangler \u2014 det er engangs-tokenet leietakeren sendte i sin egen kanal (dyplenke, varsel eller e-post)"
1362
+ );
1363
+ }
1364
+ }
1330
1365
  function krevToken() {
1331
1366
  if (anonym) {
1332
1367
  throw new InnspelApiError(
@@ -1540,6 +1575,47 @@ function init(options) {
1540
1575
  return medToken(
1541
1576
  (h) => programsListMine({ client: klient, headers: h, signal: signal() })
1542
1577
  );
1578
+ },
1579
+ async accept(invitationToken) {
1580
+ krevInvitasjonstoken(invitationToken);
1581
+ krevToken();
1582
+ const svar = await medToken(
1583
+ (h) => programsAccept({
1584
+ client: klient,
1585
+ headers: h,
1586
+ signal: signal(),
1587
+ path: { token: invitationToken }
1588
+ })
1589
+ );
1590
+ telemetri.emit({ name: "invitation_accepted" });
1591
+ return svar;
1592
+ },
1593
+ async decline(invitationToken) {
1594
+ krevInvitasjonstoken(invitationToken);
1595
+ krevToken();
1596
+ await medToken(
1597
+ (h) => programsDecline({
1598
+ client: klient,
1599
+ headers: h,
1600
+ signal: signal(),
1601
+ path: { token: invitationToken }
1602
+ })
1603
+ );
1604
+ telemetri.emit({ name: "invitation_declined" });
1605
+ },
1606
+ async withdraw(participationId) {
1607
+ if (typeof participationId !== "string" || participationId.length === 0) {
1608
+ throw new InnspelConfigError("participationId", "mangler \u2014 bruk id fra deltakelsen i programs.list()");
1609
+ }
1610
+ krevToken();
1611
+ return medToken(
1612
+ (h) => programsWithdraw({
1613
+ client: klient,
1614
+ headers: h,
1615
+ signal: signal(),
1616
+ path: { id: participationId }
1617
+ })
1618
+ );
1543
1619
  }
1544
1620
  },
1545
1621
  attachments: {