@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.
Files changed (64) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +37 -0
  3. package/api.d.ts +24 -0
  4. package/index.d.ts +3 -0
  5. package/index.js +1 -0
  6. package/lib/coded-error.d.ts +7 -0
  7. package/lib/connection.d.ts +597 -0
  8. package/lib/context.d.ts +58 -0
  9. package/lib/environment.d.ts +4 -0
  10. package/lib/logger.d.ts +20 -0
  11. package/lib/script-error.d.ts +38 -0
  12. package/lib/sync-group.d.ts +85 -0
  13. package/lib/sync.d.ts +392 -0
  14. package/lib/utilities/csv-reader/csv-reader-csv-parse.d.ts +16 -0
  15. package/lib/utilities/csv-reader/csv-reader-fast-csv.d.ts +15 -0
  16. package/lib/utilities/csv-reader/csv-reader.d.ts +2 -0
  17. package/lib/utilities/csv-reader/index.d.ts +2 -0
  18. package/lib/utilities/csv-reader/types.d.ts +48 -0
  19. package/lib/utilities/csv-writer/csv-writer.d.ts +21 -0
  20. package/lib/utilities/date-utils/date-utils.d.ts +37 -0
  21. package/lib/utilities/file-provider/file-provider-buffer.d.ts +11 -0
  22. package/lib/utilities/file-provider/file-provider-disk.d.ts +12 -0
  23. package/lib/utilities/file-provider/file-provider-string.d.ts +11 -0
  24. package/lib/utilities/file-provider/file-provider.d.ts +21 -0
  25. package/lib/utilities/file-utils/file-utils.d.ts +8 -0
  26. package/lib/utilities/html-utils/html-utils.d.ts +1 -0
  27. package/lib/utilities/http-client/fetch-http-client.d.ts +7 -0
  28. package/lib/utilities/http-client/fetch-http-error.d.ts +14 -0
  29. package/lib/utilities/http-client/types.d.ts +62 -0
  30. package/lib/utilities/json-utils/index.d.ts +6 -0
  31. package/lib/utilities/json-utils/json-changed-checker.d.ts +15 -0
  32. package/lib/utilities/json-utils/json-hash.d.ts +4 -0
  33. package/lib/utilities/json-utils/json-values-reader.d.ts +13 -0
  34. package/lib/utilities/json-utils/json-values-types.d.ts +41 -0
  35. package/lib/utilities/json-utils/json-values-writer.d.ts +28 -0
  36. package/lib/utilities/json-utils/lossless-numbers.d.ts +6 -0
  37. package/lib/utilities/json-utils/paths.d.ts +8 -0
  38. package/lib/utilities/kv-store/better-sqlite3/kv-collection-better-sqlite3.d.ts +18 -0
  39. package/lib/utilities/kv-store/better-sqlite3/kv-iterator-better-sqlite3.d.ts +26 -0
  40. package/lib/utilities/kv-store/better-sqlite3/kv-store-better-sqlite3.d.ts +11 -0
  41. package/lib/utilities/kv-store/index.d.ts +4 -0
  42. package/lib/utilities/kv-store/kv-store-benchmark-helpers.d.ts +14 -0
  43. package/lib/utilities/kv-store/shadow/kv-store-shadow.d.ts +29 -0
  44. package/lib/utilities/kv-store/sqlite3/database-sqlite3.d.ts +16 -0
  45. package/lib/utilities/kv-store/sqlite3/kv-collection-sqlite3.d.ts +18 -0
  46. package/lib/utilities/kv-store/sqlite3/kv-iterator-sqlite3.d.ts +21 -0
  47. package/lib/utilities/kv-store/sqlite3/kv-store-sqlite3.d.ts +11 -0
  48. package/lib/utilities/kv-store/sqlite3/statement-sqlite3.d.ts +13 -0
  49. package/lib/utilities/kv-store/types.d.ts +20 -0
  50. package/lib/utilities/name-parser/name-parser.d.ts +6 -0
  51. package/lib/utilities/rate-limiter/rate-limiter-concurrent.d.ts +24 -0
  52. package/lib/utilities/rate-limiter/rate-limiter-rolling.d.ts +18 -0
  53. package/lib/utilities/rate-limiter/rate-limiter.d.ts +15 -0
  54. package/lib/utilities/type-utils/type-utils.d.ts +11 -0
  55. package/lib/utilities/upsert-flags/upsert-flags.d.ts +10 -0
  56. package/lib/utilities/utilities.d.ts +105 -0
  57. package/lib/utilities/www-utils/www-utils.d.ts +14 -0
  58. package/lib/utilities/xlsx-reader/xlsx-reader.d.ts +32 -0
  59. package/lib/utilities/xlsx-writer/xlsx-writer.d.ts +23 -0
  60. package/lib/utilities/xml-utils/xml-utils.d.ts +1 -0
  61. package/lib/utilities/zip-utils/zip-utils.d.ts +29 -0
  62. package/package.json +23 -0
  63. package/sdk-test/sdk-test.d.ts +451 -0
  64. 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
@@ -0,0 +1,3 @@
1
+ import * as API from "./api.js";
2
+ export default API;
3
+ export * from "./api.js";
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");
@@ -0,0 +1,7 @@
1
+ /**
2
+ * CodedError extends error to expose consistent meaningful error codes.
3
+ */
4
+ export interface CodedError extends Error {
5
+ readonly code: string;
6
+ readonly data?: any;
7
+ }