@syncmatters/connector-sdk 1.0.14 → 1.0.15
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/lib/connector.d.ts +34 -3
- package/module.d.ts +1 -1
- package/package.json +3 -3
package/lib/connector.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EventTypeMeta, Logger, ObjectField, UpsertIssue, ObjectIndex, ObjectMeta, ObjectMetaUpsert, Row, TestResult, ScriptType, UpsertFieldOptionMeta, QueryMatchFilter, QueryCheckpointFilter, JsonValuePathPart, SyncSession, ObjectFieldOption, RowMatchRuleType, SyncOptimalBatchSizeOperation, SyncOptimalBatchSizeBatchType } from "@syncmatters/script-api";
|
|
1
|
+
import { EventTypeMeta, Logger, ObjectField, UpsertIssue, ObjectIndex, ObjectMeta, ObjectMetaUpsert, Row, TestResult, ScriptType, UpsertFieldOptionMeta, QueryMatchFilter, QueryCheckpointFilter, JsonValuePathPart, SyncSession, ObjectFieldOption, RowMatchRuleType, SyncOptimalBatchSizeOperation, SyncOptimalBatchSizeBatchType, DiscoverResult } from "@syncmatters/script-api";
|
|
2
2
|
import SDK from "../index.js";
|
|
3
3
|
/**
|
|
4
4
|
* InitArgs are passed as the only argument to the connector init() function.
|
|
@@ -35,8 +35,15 @@ export interface Connector {
|
|
|
35
35
|
init?(args: InitArgs): Promise<void>;
|
|
36
36
|
/** test attempts to connect to the system, so validating credentials and basic settings. */
|
|
37
37
|
test(): Promise<TestResult>;
|
|
38
|
-
/**
|
|
39
|
-
|
|
38
|
+
/**
|
|
39
|
+
* [optional] discover returns the catalogue of objects present in the system, without field detail. Called after init() once the settings
|
|
40
|
+
* tagged as 'prerequisite' are entered by a user setting up the connection.
|
|
41
|
+
*/
|
|
42
|
+
discover?(options: DiscoverOptions): Promise<DiscoverResult>;
|
|
43
|
+
/**
|
|
44
|
+
* meta connects to the system to retrieve system, object and field definitions (metadata).
|
|
45
|
+
*/
|
|
46
|
+
meta(options?: MetaOptions): Promise<ConnectorMeta>;
|
|
40
47
|
/**
|
|
41
48
|
* query connects to the system to retrieve data from the object with the given id. The connector manages
|
|
42
49
|
* state needed for multi-page quesies using parameter 'queryState'. On the first call to query() 'queryState'
|
|
@@ -84,6 +91,30 @@ export interface Connector {
|
|
|
84
91
|
}
|
|
85
92
|
/** verifyType may be used to check whether the connector class correctly impliments Connector */
|
|
86
93
|
export declare function verifyType(_connector: Connector): void;
|
|
94
|
+
/** DiscoverOptions are passed to the discover function. */
|
|
95
|
+
export interface DiscoverOptions {
|
|
96
|
+
/** log can record to the platform event store */
|
|
97
|
+
log: Logger;
|
|
98
|
+
/** first setup ("newConnection"), or a re-collect of an existing result ("refresh") */
|
|
99
|
+
reason: "newConnection" | "refresh";
|
|
100
|
+
/** the previous discovery result from this connection, if any */
|
|
101
|
+
previous?: DiscoverResult;
|
|
102
|
+
}
|
|
103
|
+
/** MetaOptions are passed to the meta function. */
|
|
104
|
+
export interface MetaOptions {
|
|
105
|
+
/** log can record to the platform event store */
|
|
106
|
+
log: Logger;
|
|
107
|
+
/** objects the connection has selected; undefined = all */
|
|
108
|
+
selectedObjectIds?: string[];
|
|
109
|
+
/** subset of selectedObjectIds to refresh; undefined = all selected objects */
|
|
110
|
+
refreshObjectIds?: string[];
|
|
111
|
+
/** cached ObjectMeta for any object - returns undefined when nothing cached */
|
|
112
|
+
objectMeta(id: string): Promise<ObjectMeta | undefined>;
|
|
113
|
+
/** cached event types - returns undefined when nothing cached */
|
|
114
|
+
events(): Promise<ConnectorMeta["events"] | undefined>;
|
|
115
|
+
/** the cached discovery result - undefined discover() not implimented or when nothing cached */
|
|
116
|
+
discovery?: DiscoverResult;
|
|
117
|
+
}
|
|
87
118
|
/** QueryOptions are passed to the query function. */
|
|
88
119
|
export interface QueryOptions {
|
|
89
120
|
/** log can record to the platform event store */
|
package/module.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* SDK specific elements that would be of no interest to users of the API.
|
|
4
4
|
*/
|
|
5
5
|
export { EventScriptComplete } from "@syncmatters/script-api";
|
|
6
|
-
export type { Cache, FileProvider, HttpRequest, HttpClientOptions, KvCollection, KvIterator, Logger, EventContext, TestResult, Row, ObjectMeta, ObjectField, ObjectFieldOption, RateLimiterOptions, ScriptType, JsonValuePath, JsonValuePathPart, QueryMatchFilter, QueryCheckpointFilter, EventTypeMeta, ObjectIndex, ObjectMetaUpsert, ObjectRowFilter, ObjectRelationship, ObjectFieldConstraints, ObjectSettingMeta, UpsertIssue, UpsertFieldOptionMeta, RowMatchRuleType, RowMatchData, RowMatchRuleOrder, SyncSession, SyncOptimalBatchSizeOperation, SyncOptimalBatchSizeBatchType, } from "@syncmatters/script-api";
|
|
6
|
+
export type { Cache, FileProvider, HttpRequest, HttpClientOptions, KvCollection, KvIterator, Logger, EventContext, TestResult, Row, ObjectMeta, ObjectField, ObjectFieldOption, RateLimiterOptions, ScriptType, JsonValuePath, JsonValuePathPart, QueryMatchFilter, QueryCheckpointFilter, EventTypeMeta, ObjectIndex, ObjectMetaUpsert, ObjectRowFilter, ObjectRelationship, ObjectFieldConstraints, ObjectSettingMeta, ObjectUnavailableReason, DiscoverResult, DiscoveredObject, MetaState, MetaStateObject, UpsertIssue, UpsertFieldOptionMeta, RowMatchRuleType, RowMatchData, RowMatchRuleOrder, SyncSession, SyncOptimalBatchSizeOperation, SyncOptimalBatchSizeBatchType, } from "@syncmatters/script-api";
|
|
7
7
|
export * from "./lib/connector.js";
|
|
8
8
|
export * from "./lib/connector-error.js";
|
|
9
9
|
export { envSet } from "./lib/environment.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@syncmatters/connector-sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.15",
|
|
4
4
|
"description": "TypeScript type definitions for the SyncMatters connector SDK (types only - connectors execute on the SyncMatters platform)",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"author": "SyncMatters",
|
|
14
14
|
"homepage": "https://syncmatters.com",
|
|
15
|
-
"typesContentHash": "
|
|
15
|
+
"typesContentHash": "c428bbb8ebc48254d9a04ea22755a73f6579fcccfc31d639633a935688655fd3",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@types/node": "*",
|
|
18
|
-
"@syncmatters/script-api": "^1.0.
|
|
18
|
+
"@syncmatters/script-api": "^1.0.16"
|
|
19
19
|
}
|
|
20
20
|
}
|