@siglume/api-sdk 0.10.1 → 0.10.2
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 +5 -4
- package/dist/bin/siglume.cjs +134 -72
- package/dist/bin/siglume.cjs.map +1 -1
- package/dist/bin/siglume.js +134 -72
- package/dist/bin/siglume.js.map +1 -1
- package/dist/cli/index.cjs +134 -72
- package/dist/cli/index.cjs.map +1 -1
- package/dist/cli/index.d.cts +10 -13
- package/dist/cli/index.d.ts +10 -13
- package/dist/cli/index.js +134 -72
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +39 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -15
- package/dist/index.d.ts +20 -15
- package/dist/index.js +39 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1672,19 +1672,6 @@ function parseBundleMember(data) {
|
|
|
1672
1672
|
link_id: stringOrNull2(data.link_id)
|
|
1673
1673
|
};
|
|
1674
1674
|
}
|
|
1675
|
-
function parseConnectedAccountProvider(data) {
|
|
1676
|
-
return {
|
|
1677
|
-
provider_key: String(data.provider_key ?? ""),
|
|
1678
|
-
display_name: String(data.display_name ?? ""),
|
|
1679
|
-
auth_type: String(data.auth_type ?? "oauth2"),
|
|
1680
|
-
refresh_supported: Boolean(data.refresh_supported ?? false),
|
|
1681
|
-
pkce_required: Boolean(data.pkce_required ?? false),
|
|
1682
|
-
default_scopes: Array.isArray(data.default_scopes) ? data.default_scopes.filter((s) => typeof s === "string") : [],
|
|
1683
|
-
available_scopes: Array.isArray(data.available_scopes) ? data.available_scopes.filter((s) => typeof s === "string") : [],
|
|
1684
|
-
scope_separator: String(data.scope_separator ?? " "),
|
|
1685
|
-
notes: stringOrNull2(data.notes)
|
|
1686
|
-
};
|
|
1687
|
-
}
|
|
1688
1675
|
function parseConnectedAccountLifecycle(data) {
|
|
1689
1676
|
return {
|
|
1690
1677
|
connected_account_id: String(data.connected_account_id ?? ""),
|
|
@@ -2810,9 +2797,13 @@ var init_client = __esm({
|
|
|
2810
2797
|
async auto_register(manifest, tool_manual, options = {}) {
|
|
2811
2798
|
const manifestPayload = coerceMapping(manifest, "manifest");
|
|
2812
2799
|
const toolManualPayload = coerceMapping(tool_manual, "tool_manual");
|
|
2800
|
+
const toolManualForRequest = { ...toolManualPayload };
|
|
2801
|
+
const embeddedInputFormSpec = toolManualForRequest.input_form_spec;
|
|
2802
|
+
delete toolManualForRequest.input_form_spec;
|
|
2803
|
+
const inputFormSpec = options.input_form_spec ?? embeddedInputFormSpec;
|
|
2813
2804
|
const payload = {
|
|
2814
2805
|
manifest: { ...manifestPayload },
|
|
2815
|
-
tool_manual:
|
|
2806
|
+
tool_manual: toolManualForRequest
|
|
2816
2807
|
};
|
|
2817
2808
|
if (options.source_url) {
|
|
2818
2809
|
payload.source_url = options.source_url;
|
|
@@ -2834,8 +2825,8 @@ var init_client = __esm({
|
|
|
2834
2825
|
if (options.source_context) {
|
|
2835
2826
|
payload.source_context = coerceMapping(options.source_context, "source_context");
|
|
2836
2827
|
}
|
|
2837
|
-
if (
|
|
2838
|
-
payload.input_form_spec = coerceMapping(
|
|
2828
|
+
if (inputFormSpec !== void 0 && inputFormSpec !== null) {
|
|
2829
|
+
payload.input_form_spec = coerceMapping(inputFormSpec, "input_form_spec");
|
|
2839
2830
|
}
|
|
2840
2831
|
for (const fieldName of [
|
|
2841
2832
|
"capability_key",
|
|
@@ -2886,7 +2877,11 @@ var init_client = __esm({
|
|
|
2886
2877
|
if (!listing_id) {
|
|
2887
2878
|
throw new SiglumeClientError("Siglume auto-register response did not include listing_id.");
|
|
2888
2879
|
}
|
|
2889
|
-
this.pendingConfirmations.set(listing_id, {
|
|
2880
|
+
this.pendingConfirmations.set(listing_id, {
|
|
2881
|
+
manifest: manifestPayload,
|
|
2882
|
+
tool_manual: toRecord2(payload.tool_manual),
|
|
2883
|
+
input_form_spec: toRecord2(payload.input_form_spec)
|
|
2884
|
+
});
|
|
2890
2885
|
return {
|
|
2891
2886
|
listing_id,
|
|
2892
2887
|
status: String(data.status ?? "draft"),
|
|
@@ -3034,11 +3029,6 @@ var init_client = __esm({
|
|
|
3034
3029
|
// ----- end bundles -------------------------------------------------------
|
|
3035
3030
|
// ----- Connected accounts (v0.7 track 3) ---------------------------------
|
|
3036
3031
|
// `resolve()` is intentionally NOT wrapped: runtime-only, never over the wire.
|
|
3037
|
-
async list_connected_account_providers() {
|
|
3038
|
-
const [data] = await this.request("GET", "/me/connected-accounts/providers");
|
|
3039
|
-
const items = Array.isArray(data.items) ? data.items : [];
|
|
3040
|
-
return items.filter((item) => isRecord2(item)).map(parseConnectedAccountProvider);
|
|
3041
|
-
}
|
|
3042
3032
|
async start_connected_account_oauth(input) {
|
|
3043
3033
|
const body = {
|
|
3044
3034
|
listing_id: input.listing_id,
|
|
@@ -3075,8 +3065,17 @@ var init_client = __esm({
|
|
|
3075
3065
|
const body = {
|
|
3076
3066
|
provider_key: input.provider_key,
|
|
3077
3067
|
client_id: input.client_id,
|
|
3078
|
-
client_secret: input.client_secret
|
|
3068
|
+
client_secret: input.client_secret,
|
|
3069
|
+
authorize_url: input.authorize_url,
|
|
3070
|
+
token_url: input.token_url
|
|
3079
3071
|
};
|
|
3072
|
+
if (input.revoke_url !== void 0) body.revoke_url = input.revoke_url;
|
|
3073
|
+
if (input.display_name !== void 0) body.display_name = input.display_name;
|
|
3074
|
+
if (input.scope_separator !== void 0) body.scope_separator = input.scope_separator;
|
|
3075
|
+
if (input.token_endpoint_auth !== void 0) body.token_endpoint_auth = input.token_endpoint_auth;
|
|
3076
|
+
if (input.pkce_required !== void 0) body.pkce_required = input.pkce_required;
|
|
3077
|
+
if (input.refresh_supported !== void 0) body.refresh_supported = input.refresh_supported;
|
|
3078
|
+
if (input.available_scopes !== void 0) body.available_scopes = input.available_scopes;
|
|
3080
3079
|
if (input.required_scopes !== void 0) body.required_scopes = input.required_scopes;
|
|
3081
3080
|
const [data] = await this.request("PUT", `/market/capabilities/${listing_id}/oauth-credentials`, {
|
|
3082
3081
|
json_body: body
|
|
@@ -6901,16 +6900,24 @@ function coerceToolManual2(manual) {
|
|
|
6901
6900
|
}
|
|
6902
6901
|
function checkSchemaForbiddenRecursive(schema, rootField2, pushIssue, path = "") {
|
|
6903
6902
|
for (const keyword of COMPOSITION_KEYWORDS) {
|
|
6904
|
-
if (keyword in schema) {
|
|
6905
|
-
|
|
6906
|
-
pushIssue(
|
|
6907
|
-
issue(
|
|
6908
|
-
"INPUT_SCHEMA",
|
|
6909
|
-
`Composition keyword '${keyword}' is not allowed in beta${path ? ` at ${path}` : ""}`,
|
|
6910
|
-
location
|
|
6911
|
-
)
|
|
6912
|
-
);
|
|
6903
|
+
if (!(keyword in schema)) {
|
|
6904
|
+
continue;
|
|
6913
6905
|
}
|
|
6906
|
+
const branches = schema[keyword];
|
|
6907
|
+
const location = path ? `${rootField2}.${path}.${keyword}` : `${rootField2}.${keyword}`;
|
|
6908
|
+
if (!Array.isArray(branches) || branches.length === 0) {
|
|
6909
|
+
pushIssue(issue("INPUT_SCHEMA", `${keyword} must be a non-empty array`, location));
|
|
6910
|
+
continue;
|
|
6911
|
+
}
|
|
6912
|
+
branches.forEach((branch, index) => {
|
|
6913
|
+
const branchPath = path ? `${path}.${keyword}[${index}]` : `${keyword}[${index}]`;
|
|
6914
|
+
const branchLocation = `${rootField2}.${branchPath}`;
|
|
6915
|
+
if (!isRecord2(branch)) {
|
|
6916
|
+
pushIssue(issue("INPUT_SCHEMA", `${keyword}[${index}] must be an object`, branchLocation));
|
|
6917
|
+
return;
|
|
6918
|
+
}
|
|
6919
|
+
checkSchemaForbiddenRecursive(branch, rootField2, pushIssue, branchPath);
|
|
6920
|
+
});
|
|
6914
6921
|
}
|
|
6915
6922
|
for (const forbidden of INPUT_SCHEMA_FORBIDDEN_KEYS) {
|
|
6916
6923
|
if (forbidden in schema) {
|