@oddington/sdk 0.1.31 → 0.1.33
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/README.md +32 -0
- package/dist/browser.js +150 -87
- package/dist/index.js +2 -2
- package/dist/types/packages/sdk/src/data-schema-types.d.ts +3 -1
- package/dist/types/packages/sdk/src/public.d.ts +2 -0
- package/dist/types/packages/sdk/src/source.d.ts +57 -0
- package/dist/types/shared/data-contract.d.ts +3 -0
- package/package.json +1 -1
|
@@ -142,7 +142,9 @@ type SelectedNames<Schema extends Collection, Query> = Query extends {
|
|
|
142
142
|
} ? Extract<Name, Fields<Schema>['name']> : Fields<Schema>['name'];
|
|
143
143
|
type Expanded<Schemas extends Catalogue, F, Query> = F extends {
|
|
144
144
|
kind: 'link';
|
|
145
|
-
} ? Cardinality<F, Project<Schemas, Targets<Schemas, F>, Query
|
|
145
|
+
} ? Cardinality<F, Project<Schemas, Targets<Schemas, F>, Query> & {
|
|
146
|
+
$fragment?: string;
|
|
147
|
+
}> | (F extends {
|
|
146
148
|
many: false;
|
|
147
149
|
} ? '$' extends keyof Query ? 'where' extends keyof NonNullable<Query['$']> ? null : never : never : never) : never;
|
|
148
150
|
type Project<Schemas extends Catalogue, Schema extends Collection, Query> = Schema extends Collection ? {
|
|
@@ -34,6 +34,8 @@ export declare const data: {
|
|
|
34
34
|
repository<const Name extends string>(name: Name): import('./data-schema-types.js').RepositoryFor<Name>;
|
|
35
35
|
};
|
|
36
36
|
export { FileOperationError } from '../../../shared/files-contract.js';
|
|
37
|
+
export { source } from './source.js';
|
|
38
|
+
export type { SourceLocation, OsSourceLocation, GmailSourceLocation, DropboxSourceLocation } from './source.js';
|
|
37
39
|
export { InboxOperationError } from '../../../shared/inbox-member-contract.js';
|
|
38
40
|
export type { InboxMember, InboxCurrent, InboxItem, AnswerableQuestion, QuestionSnapshot, ResponseConsequence, LinkedAskSnapshot, AskUpdate, DigestReadConfirmation, RecipientCandidate, RecipientAddition, ResponseAcceptance, InboxAnswerInput, InboxSearchInput } from '../../../shared/inbox-member-types.js';
|
|
39
41
|
export type { RecordSelectionResult } from '../../../shared/record-selection.js';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { DataValue } from '../../../shared/data-contract.js';
|
|
2
|
+
import type { File } from '../../../shared/files-contract.js';
|
|
3
|
+
export type SourceLocation = {
|
|
4
|
+
provider: string;
|
|
5
|
+
[field: string]: DataValue;
|
|
6
|
+
};
|
|
7
|
+
export type OsSourceLocation = {
|
|
8
|
+
provider: 'os';
|
|
9
|
+
file: string;
|
|
10
|
+
};
|
|
11
|
+
export type GmailSourceLocation = {
|
|
12
|
+
provider: 'gmail';
|
|
13
|
+
connection: string;
|
|
14
|
+
message: string;
|
|
15
|
+
attachment: string;
|
|
16
|
+
url?: string;
|
|
17
|
+
};
|
|
18
|
+
export type DropboxSourceLocation = {
|
|
19
|
+
provider: 'dropbox';
|
|
20
|
+
connection: string;
|
|
21
|
+
file: string;
|
|
22
|
+
revision?: string;
|
|
23
|
+
path?: string;
|
|
24
|
+
url?: string;
|
|
25
|
+
};
|
|
26
|
+
/** Pure authoring conveniences; ordinary Data validation and publication own writes. */
|
|
27
|
+
export declare const source: {
|
|
28
|
+
file(input: {
|
|
29
|
+
$ref: string;
|
|
30
|
+
file: File;
|
|
31
|
+
locations: readonly SourceLocation[];
|
|
32
|
+
}): {
|
|
33
|
+
$ref: string;
|
|
34
|
+
type: 'source';
|
|
35
|
+
kind: 'file';
|
|
36
|
+
filename: string;
|
|
37
|
+
media_type: string;
|
|
38
|
+
size_bytes: number;
|
|
39
|
+
sha256: string;
|
|
40
|
+
locations: {
|
|
41
|
+
[field: string]: DataValue;
|
|
42
|
+
provider: string;
|
|
43
|
+
}[];
|
|
44
|
+
};
|
|
45
|
+
location: {
|
|
46
|
+
os(file: Pick<File, 'id'>): OsSourceLocation;
|
|
47
|
+
gmail(input: Omit<GmailSourceLocation, 'provider'>): GmailSourceLocation;
|
|
48
|
+
dropbox(input: Omit<DropboxSourceLocation, 'provider'>): DropboxSourceLocation;
|
|
49
|
+
};
|
|
50
|
+
locations: {
|
|
51
|
+
merge(existing: readonly SourceLocation[], incoming: readonly SourceLocation[]): SourceLocation[];
|
|
52
|
+
};
|
|
53
|
+
csv: {
|
|
54
|
+
/** One-based CSV record position; a present header is record 1. */
|
|
55
|
+
row(baseRef: string, row: number): string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -94,6 +94,9 @@ export type SelectedRecord = {
|
|
|
94
94
|
$ref: string;
|
|
95
95
|
$version: string;
|
|
96
96
|
[field: string]: DataValue;
|
|
97
|
+
} & {
|
|
98
|
+
/** Present only on an expanded qualified link occurrence. */
|
|
99
|
+
$fragment?: string;
|
|
97
100
|
};
|
|
98
101
|
export type SelectionMetadata = {
|
|
99
102
|
version: string;
|