@oddington/sdk 0.1.17 → 0.1.18

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.
@@ -23,7 +23,7 @@ export declare const data: {
23
23
  };
24
24
  export { FileOperationError } from '../../../shared/files-contract.js';
25
25
  export { InboxOperationError } from '../../../shared/inbox-member-contract.js';
26
- export type { InboxMember, InboxCurrent, QuestionItemSnapshot, QuestionSnapshot, ResponseConsequence, LinkedAskSnapshot, AskUpdate, DigestReadConfirmation, RecipientCandidate, RecipientAddition, ResponseAcceptance, InboxAnswerInput, InboxSearchInput } from '../../../shared/inbox-member-types.js';
26
+ export type { InboxMember, InboxCurrent, InboxItem, AnswerableQuestion, QuestionSnapshot, ResponseConsequence, LinkedAskSnapshot, AskUpdate, DigestReadConfirmation, RecipientCandidate, RecipientAddition, ResponseAcceptance, InboxAnswerInput, InboxSearchInput } from '../../../shared/inbox-member-types.js';
27
27
  export type { RecordSelectionResult } from '../../../shared/record-selection.js';
28
28
  export declare const inbox: import('../../../shared/inbox-member-types.js').InboxMember;
29
29
  export type { File, FileInput, FileStorage, FileCreateInput, FileCreateOptions, FileEnrichment, FileEnrichOptions, FileEnrichResult, FileErrorCode } from '../../../shared/files-contract.js';
@@ -1,4 +1,4 @@
1
- import type { InboxCurrent, QuestionItemSnapshot, ResponseAcceptance } from './inbox-member-types.js';
1
+ import type { InboxCurrent, InboxItem, AnswerableQuestion, ResponseAcceptance } from './inbox-member-types.js';
2
2
  export declare class InboxOperationError extends Error {
3
3
  readonly status: number;
4
4
  readonly reason: 'invalid_input' | 'access_denied' | 'authority_unavailable' | 'conflict' | 'unavailable';
@@ -6,14 +6,19 @@ export declare class InboxOperationError extends Error {
6
6
  }
7
7
  export declare const INBOX_RESULT_BYTES: number;
8
8
  export declare const INBOX_INPUT_BYTES = 8192;
9
+ /** Includes the exact declaration only on the private CLI-authenticated ingress. */
10
+ export declare const INBOX_LOCAL_INPUT_BYTES: number;
9
11
  export declare const INBOX_UUID: RegExp;
10
- export type InboxOperation = 'current' | 'items.list' | 'items.read' | 'items.see' | 'items.markDigestRead' | 'items.rename' | 'items.setLifecycle' | 'items.listRecipientCandidates' | 'items.addRecipient' | 'questions.answer' | 'questions.searchRecords' | 'files.read';
12
+ export type InboxOperation = 'current' | 'items.list' | 'items.read' | 'items.see' | 'items.markDigestRead' | 'items.rename' | 'items.setLifecycle' | 'items.listRecipientCandidates' | 'items.addRecipient' | 'questions.list' | 'questions.answer' | 'questions.searchRecords' | 'files.read';
13
+ export declare function isAppQuestionOperation(operation: InboxOperation): boolean;
11
14
  /** Closed wire vocabulary, shared by the SDK and its owning Worker. */
12
15
  export declare function parseInboxRequest(value: unknown): {
13
16
  operation: InboxOperation;
14
17
  input: Record<string, unknown>;
15
18
  };
16
19
  export declare function parseInboxCurrent(value: unknown): InboxCurrent;
17
- export declare function parseInboxItem(value: unknown): QuestionItemSnapshot;
20
+ export declare function parseInboxItem(value: unknown): InboxItem;
21
+ /** Exact app-facing vocabulary: an upstream snapshot cannot widen it. */
22
+ export declare function parseAnswerableQuestion(value: unknown): AnswerableQuestion;
18
23
  export declare function parseInboxAcceptance(value: unknown): ResponseAcceptance;
19
24
  export declare function parseInboxResult(operation: InboxOperation, value: unknown): unknown;
@@ -63,7 +63,7 @@ export type LinkedAskSnapshot = {
63
63
  state: 'unavailable';
64
64
  done: boolean;
65
65
  };
66
- export interface QuestionItemSnapshot {
66
+ export interface InboxItem {
67
67
  id: string;
68
68
  workspaceId: string;
69
69
  number: number;
@@ -115,8 +115,27 @@ export interface ResponseAcceptance {
115
115
  label?: string;
116
116
  acceptanceOrder?: number;
117
117
  }
118
+ export interface AnswerableQuestion {
119
+ item: {
120
+ id: string;
121
+ number: number;
122
+ revision: number;
123
+ title: string;
124
+ href: string;
125
+ };
126
+ origin: {
127
+ routine: string;
128
+ };
129
+ question: {
130
+ id: string;
131
+ prompt: string;
132
+ instructions: string | null;
133
+ response: ResponseDefinition;
134
+ };
135
+ recordRefs: string[];
136
+ }
118
137
  export interface AskUpdate {
119
- item: QuestionItemSnapshot;
138
+ item: InboxItem;
120
139
  activityId: number | null;
121
140
  changedAt: string | null;
122
141
  }
@@ -126,7 +145,7 @@ export interface RecipientCandidate {
126
145
  email: string;
127
146
  }
128
147
  export interface RecipientAddition {
129
- item: QuestionItemSnapshot;
148
+ item: InboxItem;
130
149
  addedPersonId: string;
131
150
  }
132
151
  export type ItemRevision = {
@@ -145,8 +164,8 @@ export type InboxSearchInput = ItemRevision & {
145
164
  export interface InboxMember {
146
165
  current(): Promise<InboxCurrent>;
147
166
  items: {
148
- list(): Promise<QuestionItemSnapshot[]>;
149
- read(itemId: string): Promise<QuestionItemSnapshot>;
167
+ list(): Promise<InboxItem[]>;
168
+ read(itemId: string): Promise<InboxItem>;
150
169
  see(itemId: string): Promise<void>;
151
170
  markDigestRead(itemId: string): Promise<DigestReadConfirmation>;
152
171
  rename(input: ItemRevision & {
@@ -162,6 +181,7 @@ export interface InboxMember {
162
181
  }): Promise<RecipientAddition>;
163
182
  };
164
183
  questions: {
184
+ list(): Promise<AnswerableQuestion[]>;
165
185
  answer(input: InboxAnswerInput): Promise<ResponseAcceptance>;
166
186
  searchRecords(input: InboxSearchInput): Promise<RecordSelectionResult>;
167
187
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oddington/sdk",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "Oddington routine and response-handler SDK",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "type": "module",