@mitralab.io/sdk-core 0.2.0-beta.0 → 0.2.0-beta.1
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/CHANGELOG.md +22 -0
- package/README.md +44 -5
- package/contracts/README.md +20 -4
- package/contracts/manifest.json +6 -1
- package/contracts/v0.2.0-beta.1/sdk-parity.json +2902 -0
- package/dist/index.cjs +35 -14
- package/dist/index.d.cts +47 -7
- package/dist/index.d.ts +47 -7
- package/dist/index.js +35 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.2.0-beta.1
|
|
6
|
+
|
|
7
|
+
This working tree prepares the `0.2.0-beta.1` package. Publication provenance remains
|
|
8
|
+
unreleased until the final source commit and registry artifact exist.
|
|
9
|
+
|
|
10
|
+
- Accept an inline template definition on integration config creation and on
|
|
11
|
+
provisional credential tests, so an app can connect a provider that has no
|
|
12
|
+
catalog template. `fieldsSchemaInline`, `requestConfigInline`, and
|
|
13
|
+
`loginConfigInline` replace `templateId` and reuse the catalog shapes. The
|
|
14
|
+
producer owns the exclusivity between the two, and Core does not check it.
|
|
15
|
+
- Add `IntegrationFieldSchemaInput`, the authoring shape for an inline field,
|
|
16
|
+
which leaves `placeholder` and `default` optional because the producer stores
|
|
17
|
+
an omitted one as null. Responses keep the strict `IntegrationFieldSchema`.
|
|
18
|
+
- Read `templateId: null` on configs created from an inline definition and
|
|
19
|
+
validate the three inline fields echoed back on config and list responses.
|
|
20
|
+
- Publish contract corpus `0.2.0-beta.1` with the inline create, credential
|
|
21
|
+
test, and listing cases, leaving the released `0.2.0-beta.0` bytes untouched.
|
|
22
|
+
- Name the array in the integration template field-schema validation message.
|
|
23
|
+
It now reads `fieldsSchema field 0` instead of `field 0`, because the template
|
|
24
|
+
and inline paths share one validator. Consumers that reimplement Core response
|
|
25
|
+
validation, such as the Python SDK, follow the same wording.
|
|
26
|
+
|
|
5
27
|
## 0.2.0-beta.0
|
|
6
28
|
|
|
7
29
|
This working tree prepares the `0.2.0-beta.0` package. Publication provenance remains
|
package/README.md
CHANGED
|
@@ -158,6 +158,42 @@ or by their app-scoped alias with `integration.executeByAlias()`. Both methods
|
|
|
158
158
|
send the proxy request unchanged apart from the required `source: "SDK"` audit
|
|
159
159
|
field and validate the same proxy result.
|
|
160
160
|
|
|
161
|
+
An integration config normally points at a catalog template through `templateId`.
|
|
162
|
+
When the provider has no template, `integrationAdmin.create()`,
|
|
163
|
+
`integrationAdmin.bulkCreate()`, and `integrationAdmin.testCredentials()` accept
|
|
164
|
+
an inline definition instead, in the same shapes the catalog uses:
|
|
165
|
+
|
|
166
|
+
```typescript
|
|
167
|
+
await integrationAdmin.create({
|
|
168
|
+
alias: "erp-inline",
|
|
169
|
+
fieldsSchemaInline: [
|
|
170
|
+
{ key: "base_url", label: "Base URL", type: "url", required: true },
|
|
171
|
+
{ key: "access_key_code", label: "Access Key Code", type: "secret", required: true },
|
|
172
|
+
{ key: "access_key_token", label: "Access Key Token", type: "secret", required: true },
|
|
173
|
+
],
|
|
174
|
+
requestConfigInline: {
|
|
175
|
+
headers: {
|
|
176
|
+
"X-Access-Key-Code": "{{access_key_code}}",
|
|
177
|
+
"X-Access-Key-Token": "{{access_key_token}}",
|
|
178
|
+
},
|
|
179
|
+
credential_rules: null,
|
|
180
|
+
},
|
|
181
|
+
loginConfigInline: null,
|
|
182
|
+
values: { base_url: "https://api.example.com", access_key_code: "...", access_key_token: "..." },
|
|
183
|
+
})
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Send `templateId` or the inline definition, never both and never neither. The
|
|
187
|
+
Integration service owns that rule and answers 400; Core forwards whatever the
|
|
188
|
+
caller sends. Configs created this way report `templateId: null` and echo the
|
|
189
|
+
three inline fields back on every config response, with secrets in `config`
|
|
190
|
+
masked exactly as they are for template-backed configs.
|
|
191
|
+
|
|
192
|
+
Inline fields are authored as `IntegrationFieldSchemaInput`, which makes
|
|
193
|
+
`placeholder` and `default` optional because the producer stores an omitted one
|
|
194
|
+
as null. Responses keep the strict `IntegrationFieldSchema`, where both
|
|
195
|
+
properties are always present.
|
|
196
|
+
|
|
161
197
|
`integrationAdmin.list()` is the native equivalent for listing configured
|
|
162
198
|
integrations. It calls `GET /api/v1/template-configs` and returns the producer's
|
|
163
199
|
paginated `TemplateConfigSummary` values. With an app-scoped token, the
|
|
@@ -267,12 +303,15 @@ The build produces ESM, CommonJS, `.d.ts`, and `.d.cts` artifacts. Package smoke
|
|
|
267
303
|
|
|
268
304
|
## Release order
|
|
269
305
|
|
|
270
|
-
|
|
306
|
+
Core is the producer for the concrete SDK adapters, so it publishes first. For a prerelease
|
|
307
|
+
`X.Y.Z-beta.N`, currently `0.2.0-beta.1`:
|
|
271
308
|
|
|
272
|
-
1. Merge the
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
309
|
+
1. Merge the source, the `package.json` version, and the matching contract corpus version to
|
|
310
|
+
`main` in the same pull request. The Release workflow bumps nothing.
|
|
311
|
+
2. Run the Release workflow with version `X.Y.Z-beta.N`. It checks that the requested version
|
|
312
|
+
already matches `package.json`, runs the full package check, then tags and publishes the
|
|
313
|
+
prerelease under npm's `beta` dist-tag.
|
|
314
|
+
3. Confirm `npm view @mitralab.io/sdk-core@X.Y.Z-beta.N version` returns the same version.
|
|
276
315
|
4. Regenerate each adapter lockfile from the npm registry and pin this repository commit in the
|
|
277
316
|
adapter's contract-source manifest before publishing that adapter.
|
|
278
317
|
|
package/contracts/README.md
CHANGED
|
@@ -10,10 +10,17 @@ change requires a new version directory. Consumers may vendor the exact bytes
|
|
|
10
10
|
and pin their copy with a SHA-256 digest so their tests never depend on network
|
|
11
11
|
access.
|
|
12
12
|
|
|
13
|
-
A released version directory is immutable. Adding
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
A released version directory is immutable. Adding an operation, or widening the
|
|
14
|
+
request or response of one that already exists, means publishing a new version
|
|
15
|
+
and moving `current`, never editing bytes another consumer already pinned. Every
|
|
16
|
+
declared version keeps its digest verified, so a consumer that has not migrated
|
|
17
|
+
stays on the version it vendored.
|
|
18
|
+
|
|
19
|
+
The `current` version names the package release that will publish it, so it moves
|
|
20
|
+
together with `package.json` in the pull request that prepares that release. The
|
|
21
|
+
release workflow does not bump anything: it checks that the requested version
|
|
22
|
+
already matches `package.json`, runs the full package check, then tags and
|
|
23
|
+
publishes.
|
|
17
24
|
|
|
18
25
|
## Versions
|
|
19
26
|
|
|
@@ -23,6 +30,15 @@ not migrated stays on the version it vendored.
|
|
|
23
30
|
batches, Function administration batches, integration template config
|
|
24
31
|
batches with connection tests and listing, and app members. Its `sources`
|
|
25
32
|
entries pin the producer revisions currently on `origin/alpha`.
|
|
33
|
+
- `0.2.0-beta.1` widens integration template configs with the inline definition
|
|
34
|
+
contract. A create item or credential test carries `fieldsSchemaInline`,
|
|
35
|
+
`requestConfigInline`, and `loginConfigInline` instead of a `templateId`, and
|
|
36
|
+
config responses report `templateId: null`. Operations that accept more than
|
|
37
|
+
one request shape now keep one success case per shape. It declares no MCP
|
|
38
|
+
companion artifact because the MCP tool surface is unchanged and each artifact
|
|
39
|
+
carries its own version identity; the matrix stays pinned at `0.2.0-beta.0`.
|
|
40
|
+
The `integrationBuilder` source pin still names the last revision on
|
|
41
|
+
`origin/alpha`, because the producer change is landing in mitra-integration#37.
|
|
26
42
|
|
|
27
43
|
The `0.2.0-beta.0/mcp-tool-parity.json` companion artifact maps every one of the 120
|
|
28
44
|
`@McpTool` methods on `mitra-mcp-server` `origin/alpha` to a typed Core method.
|
package/contracts/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"contract": "SDK-PARITY-001",
|
|
3
|
-
"current": "0.2.0-beta.
|
|
3
|
+
"current": "0.2.0-beta.1",
|
|
4
4
|
"versions": [
|
|
5
5
|
{
|
|
6
6
|
"version": "0.1.0",
|
|
@@ -15,6 +15,11 @@
|
|
|
15
15
|
"mcpToolsSha256": "77a115d39e2ee195b4e33a86766a6fdd75e89a7a35b6102f6f38f0eeb8c9d587",
|
|
16
16
|
"mcpSourcePath": "v0.2.0-beta.0/mcp-alpha-tools.json",
|
|
17
17
|
"mcpSourceSha256": "480d27eed75f2604da07fadd10f236a0ca971cf6a3c003434a1fb62c4255178f"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"version": "0.2.0-beta.1",
|
|
21
|
+
"path": "v0.2.0-beta.1/sdk-parity.json",
|
|
22
|
+
"sha256": "eb9515241cd092727ddb8cde3e3062df041a4c91f8226da04dc987b7c1053f05"
|
|
18
23
|
}
|
|
19
24
|
]
|
|
20
25
|
}
|