@syncmatters/script-api 1.0.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/LICENSE +21 -0
- package/README.md +37 -0
- package/api.d.ts +24 -0
- package/index.d.ts +3 -0
- package/index.js +1 -0
- package/lib/coded-error.d.ts +7 -0
- package/lib/connection.d.ts +597 -0
- package/lib/context.d.ts +58 -0
- package/lib/environment.d.ts +4 -0
- package/lib/logger.d.ts +20 -0
- package/lib/script-error.d.ts +38 -0
- package/lib/sync-group.d.ts +85 -0
- package/lib/sync.d.ts +392 -0
- package/lib/utilities/csv-reader/csv-reader-csv-parse.d.ts +16 -0
- package/lib/utilities/csv-reader/csv-reader-fast-csv.d.ts +15 -0
- package/lib/utilities/csv-reader/csv-reader.d.ts +2 -0
- package/lib/utilities/csv-reader/index.d.ts +2 -0
- package/lib/utilities/csv-reader/types.d.ts +48 -0
- package/lib/utilities/csv-writer/csv-writer.d.ts +21 -0
- package/lib/utilities/date-utils/date-utils.d.ts +37 -0
- package/lib/utilities/file-provider/file-provider-buffer.d.ts +11 -0
- package/lib/utilities/file-provider/file-provider-disk.d.ts +12 -0
- package/lib/utilities/file-provider/file-provider-string.d.ts +11 -0
- package/lib/utilities/file-provider/file-provider.d.ts +21 -0
- package/lib/utilities/file-utils/file-utils.d.ts +8 -0
- package/lib/utilities/html-utils/html-utils.d.ts +1 -0
- package/lib/utilities/http-client/fetch-http-client.d.ts +7 -0
- package/lib/utilities/http-client/fetch-http-error.d.ts +14 -0
- package/lib/utilities/http-client/types.d.ts +62 -0
- package/lib/utilities/json-utils/index.d.ts +6 -0
- package/lib/utilities/json-utils/json-changed-checker.d.ts +15 -0
- package/lib/utilities/json-utils/json-hash.d.ts +4 -0
- package/lib/utilities/json-utils/json-values-reader.d.ts +13 -0
- package/lib/utilities/json-utils/json-values-types.d.ts +41 -0
- package/lib/utilities/json-utils/json-values-writer.d.ts +28 -0
- package/lib/utilities/json-utils/lossless-numbers.d.ts +6 -0
- package/lib/utilities/json-utils/paths.d.ts +8 -0
- package/lib/utilities/kv-store/better-sqlite3/kv-collection-better-sqlite3.d.ts +18 -0
- package/lib/utilities/kv-store/better-sqlite3/kv-iterator-better-sqlite3.d.ts +26 -0
- package/lib/utilities/kv-store/better-sqlite3/kv-store-better-sqlite3.d.ts +11 -0
- package/lib/utilities/kv-store/index.d.ts +4 -0
- package/lib/utilities/kv-store/kv-store-benchmark-helpers.d.ts +14 -0
- package/lib/utilities/kv-store/shadow/kv-store-shadow.d.ts +29 -0
- package/lib/utilities/kv-store/sqlite3/database-sqlite3.d.ts +16 -0
- package/lib/utilities/kv-store/sqlite3/kv-collection-sqlite3.d.ts +18 -0
- package/lib/utilities/kv-store/sqlite3/kv-iterator-sqlite3.d.ts +21 -0
- package/lib/utilities/kv-store/sqlite3/kv-store-sqlite3.d.ts +11 -0
- package/lib/utilities/kv-store/sqlite3/statement-sqlite3.d.ts +13 -0
- package/lib/utilities/kv-store/types.d.ts +20 -0
- package/lib/utilities/name-parser/name-parser.d.ts +6 -0
- package/lib/utilities/rate-limiter/rate-limiter-concurrent.d.ts +24 -0
- package/lib/utilities/rate-limiter/rate-limiter-rolling.d.ts +18 -0
- package/lib/utilities/rate-limiter/rate-limiter.d.ts +15 -0
- package/lib/utilities/type-utils/type-utils.d.ts +11 -0
- package/lib/utilities/upsert-flags/upsert-flags.d.ts +10 -0
- package/lib/utilities/utilities.d.ts +105 -0
- package/lib/utilities/www-utils/www-utils.d.ts +14 -0
- package/lib/utilities/xlsx-reader/xlsx-reader.d.ts +32 -0
- package/lib/utilities/xlsx-writer/xlsx-writer.d.ts +23 -0
- package/lib/utilities/xml-utils/xml-utils.d.ts +1 -0
- package/lib/utilities/zip-utils/zip-utils.d.ts +29 -0
- package/package.json +23 -0
- package/sdk-test/sdk-test.d.ts +451 -0
- package/sdk-test.d.ts +3 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 SyncMatters
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# @syncmatters/script-api
|
|
2
|
+
|
|
3
|
+
TypeScript type definitions for the **SyncMatters script API**.
|
|
4
|
+
|
|
5
|
+
This is a **types-only** package: it provides IntelliSense and type checking when developing
|
|
6
|
+
SyncMatters integration scripts locally (for example in VS Code or Cursor). Script code executes on
|
|
7
|
+
the SyncMatters platform, which provides the runtime implementation of this API.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import API from "@syncmatters/script-api";
|
|
13
|
+
|
|
14
|
+
/** @param {API.Context} ctx */
|
|
15
|
+
export async function main(ctx) {
|
|
16
|
+
ctx.log.info("Lets connect some systems!");
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Connector test harnesses additionally use the `sdk-test` entry point:
|
|
21
|
+
|
|
22
|
+
```js
|
|
23
|
+
import SDKTest from "@syncmatters/script-api/sdk-test";
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Add `"checkJs": true` to your `jsconfig.json` to activate the JSDoc type annotations used in
|
|
27
|
+
script `.mjs` files.
|
|
28
|
+
|
|
29
|
+
## Legacy package name
|
|
30
|
+
|
|
31
|
+
`@ihq/script-api` is the legacy name of this package (IntegrateHQ is now SyncMatters).
|
|
32
|
+
Existing scripts importing the legacy name continue to work on-platform.
|
|
33
|
+
|
|
34
|
+
## Support
|
|
35
|
+
|
|
36
|
+
- <https://syncmatters.com>
|
|
37
|
+
- <support@syncmatters.com>
|
package/api.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { JsonValuesReader as JVR } from "./lib/utilities/json-utils/json-values-reader.js";
|
|
2
|
+
import * as JVW from "./lib/utilities/json-utils/json-values-writer.js";
|
|
3
|
+
export type ScriptType = "integration" | "scriptFile" | "parseEvents" | "verifyEventIdentity" | "agentConnection" | "syncGroup" | "connectorTest" | "connectorFeatureGenerate" | "connectionSemanticTypes" | "codeEmbedding";
|
|
4
|
+
export declare const EventScriptComplete = "ScriptComplete";
|
|
5
|
+
export * from "./lib/coded-error.js";
|
|
6
|
+
export * from "./lib/connection.js";
|
|
7
|
+
export * from "./lib/context.js";
|
|
8
|
+
export * from "./lib/script-error.js";
|
|
9
|
+
export * from "./lib/sync.js";
|
|
10
|
+
export * from "./lib/sync-group.js";
|
|
11
|
+
export * from "./lib/utilities/kv-store/types.js";
|
|
12
|
+
export * from "./lib/utilities/rate-limiter/rate-limiter.js";
|
|
13
|
+
export type { HttpClient, HttpClientOptions, HttpRequest, } from "./lib/utilities/http-client/types.js";
|
|
14
|
+
export type JsonValuesReader = InstanceType<typeof JVR>;
|
|
15
|
+
export type JsonValuesWriter = InstanceType<typeof JVW.JsonValuesWriter>;
|
|
16
|
+
export type WriteBehaviour = JVW.WriteBehaviour;
|
|
17
|
+
export type { CsvReaderOptions } from "./lib/utilities/csv-reader/index.js";
|
|
18
|
+
export type { CsvWriterOptions } from "./lib/utilities/csv-writer/csv-writer.js";
|
|
19
|
+
export type { XlsxReaderOptions } from "./lib/utilities/xlsx-reader/xlsx-reader.js";
|
|
20
|
+
export type { JsonValuePathPart, JsonValuePath, } from "./lib/utilities/json-utils/json-values-types.js";
|
|
21
|
+
export type { FileProvider, FileProviderOptions, } from "./lib/utilities/file-provider/file-provider.js";
|
|
22
|
+
export * from "./lib/logger.js";
|
|
23
|
+
export { utilities } from "./lib/utilities/utilities.js";
|
|
24
|
+
export { reset } from "./lib/environment.js";
|
package/index.d.ts
ADDED
package/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
throw new Error("This package contains type definitions only - connector and script code executes on the SyncMatters platform. See https://syncmatters.com");
|