@oddington/sdk 0.1.80 → 0.1.81
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/browser.js +235 -158
- package/dist/index.js +8 -4
- package/dist/types/packages/sdk/src/public.d.ts +7 -1
- package/dist/types/shared/connection-runtime.d.ts +12 -2
- package/dist/types/shared/connections.d.ts +12 -1
- package/dist/types/shared/routine-error.d.ts +23 -0
- package/package.json +1 -1
|
@@ -12,13 +12,15 @@ export type { RoutineReference, RoutineQueueReference } from './routine-referenc
|
|
|
12
12
|
export declare const schema: import('./routine-definition-types.js').RoutineSchemaBuilders;
|
|
13
13
|
export declare const file: import('./routine-definition-types.js').RoutineFileSchema;
|
|
14
14
|
export { AIError, RoutineAIError } from '../../../shared/routine-ai-contract.js';
|
|
15
|
+
export { RoutineError } from '../../../shared/routine-error.js';
|
|
16
|
+
export type { RoutineErrorOptions } from '../../../shared/routine-error.js';
|
|
15
17
|
export type { RoutineAIOutputIssue } from '../../../shared/routine-ai-output-detail.js';
|
|
16
18
|
export type { RoutineAIErrorDetail } from '../../../shared/routine-ai-error-detail.js';
|
|
17
19
|
export { InboxContractError, asksBlock, continueAsk, defineHandler, fileBlock, question, recordBlock, recordsBlock, resolveAsk, respond, richTextBlock, selection, } from '../../../shared/inbox-contract.js';
|
|
18
20
|
export type { AskInput, AuthoredSource, DigestInput, Handler, HandlerReference, HandlerRuntime, HandlerTransition, InboxBlock, InboxFile, JsonObject, JsonValue, QualifiedRecordRef, PublishedAsk, PublishedDigest, PublishedView, PublicationRequest, Question, QuestionInput, QuestionResponse, RecordReference, RecordSource, RepositoryReceipt, Resolution, ResolutionInput, ResponseDefinition, LegacyResponseDefinition, LegacyQuestionResponse, RecordPickerSource, SelectionOptionInput, SelectionOption, SelectionDefinitionInput, SelectionDefinition, SelectionResponse, ResponseDefinitionInput, } from '../../../shared/inbox-contract.js';
|
|
19
21
|
export { AirtableOperationError } from '../../../shared/airtable-contract.js';
|
|
20
22
|
export type { AirtableField, AirtableTable, AirtableRecord, AirtableListInput, AirtableGetInput, AirtableCreateInput, AirtableUpdateInput, AirtableDeleteInput, AirtableReceipt, AirtableWriteResult, AirtableClient } from '../../../shared/airtable-contract.js';
|
|
21
|
-
export type { GmailRuntimeConnection, AirtableRuntimeConnection, DropboxRuntimeConnection, OutlookRuntimeConnection, SharePointRuntimeConnection, RuntimeConnection, RuntimeConnectionFor } from '../../../shared/connection-runtime.js';
|
|
23
|
+
export type { XeroRuntimeConnection, GmailRuntimeConnection, AirtableRuntimeConnection, DropboxRuntimeConnection, OutlookRuntimeConnection, SharePointRuntimeConnection, RuntimeConnection, RuntimeConnectionFor } from '../../../shared/connection-runtime.js';
|
|
22
24
|
export type { Connections } from '../../../shared/airtable-contract.js';
|
|
23
25
|
export declare const connections: import('../../../shared/airtable-contract.js').Connections;
|
|
24
26
|
export { DataOperationError } from '../../../shared/data-contract.js';
|
|
@@ -226,6 +228,10 @@ export type RunFailure = {
|
|
|
226
228
|
} | import('../../../shared/routine-step-output.js').RoutineStepOutputFailure | {
|
|
227
229
|
code: import('../../../shared/connection-acquisition.js').ConnectionAcquisitionCode;
|
|
228
230
|
detail: import('../../../shared/connection-error.js').ConnectionFailureDetail;
|
|
231
|
+
} | {
|
|
232
|
+
code: string;
|
|
233
|
+
retryable: boolean;
|
|
234
|
+
detail?: never;
|
|
229
235
|
});
|
|
230
236
|
export type RunHandle = {
|
|
231
237
|
current(): Promise<RunSummary>;
|
|
@@ -44,5 +44,15 @@ export type SharePointRuntimeConnection = {
|
|
|
44
44
|
accessToken: string;
|
|
45
45
|
expiresAt: string;
|
|
46
46
|
};
|
|
47
|
-
export type
|
|
48
|
-
|
|
47
|
+
export type XeroRuntimeConnection = {
|
|
48
|
+
id: `xero/${string}`;
|
|
49
|
+
provider: 'xero';
|
|
50
|
+
name: string;
|
|
51
|
+
tenantId: string;
|
|
52
|
+
tenantName: string;
|
|
53
|
+
scopes: string[];
|
|
54
|
+
accessToken: string;
|
|
55
|
+
expiresAt: string;
|
|
56
|
+
};
|
|
57
|
+
export type RuntimeConnection = GmailRuntimeConnection | AirtableRuntimeConnection | DropboxRuntimeConnection | OutlookRuntimeConnection | SharePointRuntimeConnection | XeroRuntimeConnection;
|
|
58
|
+
export type RuntimeConnectionFor<Name extends string> = string extends Name ? RuntimeConnection : Name extends `gmail/${string}` ? GmailRuntimeConnection : Name extends `airtable/${string}` ? AirtableRuntimeConnection : Name extends `dropbox/${string}` ? DropboxRuntimeConnection : Name extends `outlook/${string}` ? OutlookRuntimeConnection : Name extends `sharepoint/${string}` ? SharePointRuntimeConnection : Name extends `xero/${string}` ? XeroRuntimeConnection : never;
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
/** Public connection metadata only. No credentials, Vault references, or signers. */
|
|
2
|
-
export type ConnectionProvider = 'github' | 'gmail' | 'airtable' | 'dropbox' | 'outlook' | 'sharepoint';
|
|
2
|
+
export type ConnectionProvider = 'github' | 'gmail' | 'airtable' | 'dropbox' | 'outlook' | 'sharepoint' | 'xero';
|
|
3
3
|
export interface ConnectionConfig {
|
|
4
|
+
xero: {
|
|
5
|
+
clientId: string;
|
|
6
|
+
xeroConnectionId: string;
|
|
7
|
+
tenantId: string;
|
|
8
|
+
tenantName: string;
|
|
9
|
+
scopes: string[];
|
|
10
|
+
};
|
|
4
11
|
github: {
|
|
5
12
|
installationId: number;
|
|
6
13
|
accountId: number;
|
|
@@ -71,6 +78,10 @@ export declare function canonicalSharePointSiteUrl(value: unknown): string | und
|
|
|
71
78
|
export declare function validSharePointSiteId(value: unknown, siteUrl: string): value is string;
|
|
72
79
|
/** Explicit Google scope identifiers, not a permission policy or read-only default. */
|
|
73
80
|
export declare function validGoogleScopes(value: unknown): value is string[];
|
|
81
|
+
export declare const XERO_SCOPES: readonly ['offline_access', 'accounting.invoices', 'accounting.payments.read', 'accounting.contacts', 'accounting.settings.read'];
|
|
82
|
+
export declare function validXeroScopes(value: unknown): value is string[];
|
|
83
|
+
/** Verified organisation fields shared by saved metadata and safe test results. */
|
|
84
|
+
export declare function validXeroOrganisation(value: unknown): value is Pick<ConnectionConfig['xero'], 'xeroConnectionId' | 'tenantId' | 'tenantName' | 'scopes'>;
|
|
74
85
|
export declare function validConnectionConfig(provider: unknown, value: unknown): boolean;
|
|
75
86
|
/** Stable authorization root, independent of the human-visible App Folder name.
|
|
76
87
|
* App Folder mode must come from verified backend app registration, never input
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const ROUTINE_ERROR_CODE_PATTERN: RegExp;
|
|
2
|
+
export declare const ROUTINE_ERROR_MESSAGE_BYTES = 512;
|
|
3
|
+
export type RoutineErrorOptions = {
|
|
4
|
+
/** Stable lowercase author code for programmatic Run history. */
|
|
5
|
+
code: string;
|
|
6
|
+
/** Fixed member-safe text; never forward a caught error or provider body. */
|
|
7
|
+
message: string;
|
|
8
|
+
/** Advisory classification only. OS does not retry or replay the Run. */
|
|
9
|
+
retryable?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type RoutineErrorDeclaration = {
|
|
12
|
+
code: string;
|
|
13
|
+
message: string;
|
|
14
|
+
retryable: boolean;
|
|
15
|
+
};
|
|
16
|
+
/** Validate the complete bounded declaration retained at Run boundaries. */
|
|
17
|
+
export declare function parseRoutineErrorDeclaration(value: unknown): RoutineErrorDeclaration;
|
|
18
|
+
/** A deliberate, bounded, member-safe processing Run failure. */
|
|
19
|
+
export declare class RoutineError extends Error {
|
|
20
|
+
readonly code: string;
|
|
21
|
+
readonly retryable: boolean;
|
|
22
|
+
constructor(options: RoutineErrorOptions);
|
|
23
|
+
}
|