@zapier/connectors-sdk 0.1.0-experimental.6 → 0.1.0-experimental.7
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/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -172,7 +172,7 @@ interface ContextMulti<TSlots extends string = string> {
|
|
|
172
172
|
type AnyInputDependencies$1 = Readonly<Record<string, unknown>>;
|
|
173
173
|
/** When authoring omits `inputDependencies`, the definition value is `undefined`. */
|
|
174
174
|
type InputDependenciesValue<T> = [T] extends [undefined] ? undefined : T;
|
|
175
|
-
interface DefineToolConfigBase<TIn extends z.
|
|
175
|
+
interface DefineToolConfigBase<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined, TName extends string> {
|
|
176
176
|
name: TName;
|
|
177
177
|
title: string;
|
|
178
178
|
description: string;
|
|
@@ -181,22 +181,22 @@ interface DefineToolConfigBase<TIn extends z.ZodType, TOut extends z.ZodType, TI
|
|
|
181
181
|
annotations: _modelcontextprotocol_sdk_types_js.Tool["annotations"];
|
|
182
182
|
inputDependencies?: TInputDependencies;
|
|
183
183
|
}
|
|
184
|
-
interface DefineToolConfigNone<TIn extends z.
|
|
184
|
+
interface DefineToolConfigNone<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined, TName extends string> extends DefineToolConfigBase<TIn, TOut, TInputDependencies, TName> {
|
|
185
185
|
connection?: never;
|
|
186
186
|
connections?: never;
|
|
187
187
|
run: (input: z.infer<TIn>, ctx?: ContextNone) => Promise<unknown>;
|
|
188
188
|
}
|
|
189
|
-
interface DefineToolConfigSingle<TIn extends z.
|
|
189
|
+
interface DefineToolConfigSingle<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined, TName extends string, TKey extends string> extends DefineToolConfigBase<TIn, TOut, TInputDependencies, TName> {
|
|
190
190
|
connection: TKey;
|
|
191
191
|
connections?: never;
|
|
192
192
|
run: (input: z.infer<TIn>, ctx: ContextSingle) => Promise<unknown>;
|
|
193
193
|
}
|
|
194
|
-
interface DefineToolConfigMulti<TIn extends z.
|
|
194
|
+
interface DefineToolConfigMulti<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined, TName extends string, TSlots extends string, TKey extends string> extends DefineToolConfigBase<TIn, TOut, TInputDependencies, TName> {
|
|
195
195
|
connection?: never;
|
|
196
196
|
connections: Record<TSlots, TKey>;
|
|
197
197
|
run: (input: z.infer<TIn>, ctx: ContextMulti<TSlots>) => Promise<unknown>;
|
|
198
198
|
}
|
|
199
|
-
interface ToolDefinitionBase<TIn extends z.
|
|
199
|
+
interface ToolDefinitionBase<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined, TName extends string> {
|
|
200
200
|
readonly kind: "tool";
|
|
201
201
|
readonly name: TName;
|
|
202
202
|
readonly title: string;
|
|
@@ -206,25 +206,25 @@ interface ToolDefinitionBase<TIn extends z.ZodType, TOut extends z.ZodType, TInp
|
|
|
206
206
|
readonly annotations: _modelcontextprotocol_sdk_types_js.Tool["annotations"];
|
|
207
207
|
inputDependencies: InputDependenciesValue<TInputDependencies>;
|
|
208
208
|
}
|
|
209
|
-
interface ToolDefinitionNone<TIn extends z.
|
|
209
|
+
interface ToolDefinitionNone<TIn extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined = undefined, TName extends string = string> extends ToolDefinitionBase<TIn, TOut, TInputDependencies, TName> {
|
|
210
210
|
readonly connection?: undefined;
|
|
211
211
|
readonly connections?: undefined;
|
|
212
212
|
run: (input: z.infer<TIn>, ctx?: ContextNone) => Promise<z.infer<TOut>>;
|
|
213
213
|
}
|
|
214
|
-
interface ToolDefinitionSingle<TIn extends z.
|
|
214
|
+
interface ToolDefinitionSingle<TIn extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined = undefined, TName extends string = string, TKey extends string = string> extends ToolDefinitionBase<TIn, TOut, TInputDependencies, TName> {
|
|
215
215
|
readonly connection: TKey;
|
|
216
216
|
readonly connections?: undefined;
|
|
217
217
|
run: (input: z.infer<TIn>, ctx: ContextSingle) => Promise<z.infer<TOut>>;
|
|
218
218
|
}
|
|
219
|
-
interface ToolDefinitionMulti<TIn extends z.
|
|
219
|
+
interface ToolDefinitionMulti<TIn extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined = undefined, TName extends string = string, TSlots extends string = string, TKey extends string = string> extends ToolDefinitionBase<TIn, TOut, TInputDependencies, TName> {
|
|
220
220
|
readonly connection?: undefined;
|
|
221
221
|
readonly connections: Record<TSlots, TKey>;
|
|
222
222
|
run: (input: z.infer<TIn>, ctx: ContextMulti<TSlots>) => Promise<z.infer<TOut>>;
|
|
223
223
|
}
|
|
224
|
-
type ToolDefinition<TIn extends z.
|
|
224
|
+
type ToolDefinition<TIn extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined = undefined, TName extends string = string, TSlots extends string = string, TKey extends string = string> = ToolDefinitionNone<TIn, TOut, TInputDependencies, TName> | ToolDefinitionSingle<TIn, TOut, TInputDependencies, TName, TKey> | ToolDefinitionMulti<TIn, TOut, TInputDependencies, TName, TSlots, TKey>;
|
|
225
225
|
/** Wide author-side `run` signature for polymorphic walks. */
|
|
226
226
|
type AnyToolDefinitionRun = (input: any, ctx?: any) => Promise<any>;
|
|
227
|
-
type AnyToolDefinition = Omit<ToolDefinitionBase<z.
|
|
227
|
+
type AnyToolDefinition = Omit<ToolDefinitionBase<z.ZodObject<z.ZodRawShape>, z.ZodObject<z.ZodRawShape>, any, string>, "run" | "inputDependencies"> & {
|
|
228
228
|
inputDependencies: AnyInputDependencies$1 | undefined;
|
|
229
229
|
run: AnyToolDefinitionRun;
|
|
230
230
|
readonly connection?: string | undefined;
|
|
@@ -457,9 +457,9 @@ declare function defineConnector<TScripts extends Record<string, AnyDef>, const
|
|
|
457
457
|
*/
|
|
458
458
|
|
|
459
459
|
type AnyInputDependencies = Readonly<Record<string, unknown>>;
|
|
460
|
-
declare function defineTool<TIn extends z.
|
|
461
|
-
declare function defineTool<TIn extends z.
|
|
462
|
-
declare function defineTool<TIn extends z.
|
|
460
|
+
declare function defineTool<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies | undefined = undefined, const TName extends string = string>(config: DefineToolConfigNone<TIn, TOut, TInputDependencies, TName>): ToolDefinitionNone<TIn, TOut, TInputDependencies, TName>;
|
|
461
|
+
declare function defineTool<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies | undefined = undefined, const TName extends string = string, const TKey extends string = string>(config: DefineToolConfigSingle<TIn, TOut, TInputDependencies, TName, TKey>): ToolDefinitionSingle<TIn, TOut, TInputDependencies, TName, TKey>;
|
|
462
|
+
declare function defineTool<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies | undefined = undefined, const TName extends string = string, const TSlots extends string = string, const TKey extends string = string>(config: DefineToolConfigMulti<TIn, TOut, TInputDependencies, TName, TSlots, TKey>): ToolDefinitionMulti<TIn, TOut, TInputDependencies, TName, TSlots, TKey>;
|
|
463
463
|
|
|
464
464
|
/**
|
|
465
465
|
* `handleIfScriptMain(meta, definition, opts?)` — per-script CLI execution
|
package/dist/index.d.ts
CHANGED
|
@@ -172,7 +172,7 @@ interface ContextMulti<TSlots extends string = string> {
|
|
|
172
172
|
type AnyInputDependencies$1 = Readonly<Record<string, unknown>>;
|
|
173
173
|
/** When authoring omits `inputDependencies`, the definition value is `undefined`. */
|
|
174
174
|
type InputDependenciesValue<T> = [T] extends [undefined] ? undefined : T;
|
|
175
|
-
interface DefineToolConfigBase<TIn extends z.
|
|
175
|
+
interface DefineToolConfigBase<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined, TName extends string> {
|
|
176
176
|
name: TName;
|
|
177
177
|
title: string;
|
|
178
178
|
description: string;
|
|
@@ -181,22 +181,22 @@ interface DefineToolConfigBase<TIn extends z.ZodType, TOut extends z.ZodType, TI
|
|
|
181
181
|
annotations: _modelcontextprotocol_sdk_types_js.Tool["annotations"];
|
|
182
182
|
inputDependencies?: TInputDependencies;
|
|
183
183
|
}
|
|
184
|
-
interface DefineToolConfigNone<TIn extends z.
|
|
184
|
+
interface DefineToolConfigNone<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined, TName extends string> extends DefineToolConfigBase<TIn, TOut, TInputDependencies, TName> {
|
|
185
185
|
connection?: never;
|
|
186
186
|
connections?: never;
|
|
187
187
|
run: (input: z.infer<TIn>, ctx?: ContextNone) => Promise<unknown>;
|
|
188
188
|
}
|
|
189
|
-
interface DefineToolConfigSingle<TIn extends z.
|
|
189
|
+
interface DefineToolConfigSingle<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined, TName extends string, TKey extends string> extends DefineToolConfigBase<TIn, TOut, TInputDependencies, TName> {
|
|
190
190
|
connection: TKey;
|
|
191
191
|
connections?: never;
|
|
192
192
|
run: (input: z.infer<TIn>, ctx: ContextSingle) => Promise<unknown>;
|
|
193
193
|
}
|
|
194
|
-
interface DefineToolConfigMulti<TIn extends z.
|
|
194
|
+
interface DefineToolConfigMulti<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined, TName extends string, TSlots extends string, TKey extends string> extends DefineToolConfigBase<TIn, TOut, TInputDependencies, TName> {
|
|
195
195
|
connection?: never;
|
|
196
196
|
connections: Record<TSlots, TKey>;
|
|
197
197
|
run: (input: z.infer<TIn>, ctx: ContextMulti<TSlots>) => Promise<unknown>;
|
|
198
198
|
}
|
|
199
|
-
interface ToolDefinitionBase<TIn extends z.
|
|
199
|
+
interface ToolDefinitionBase<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined, TName extends string> {
|
|
200
200
|
readonly kind: "tool";
|
|
201
201
|
readonly name: TName;
|
|
202
202
|
readonly title: string;
|
|
@@ -206,25 +206,25 @@ interface ToolDefinitionBase<TIn extends z.ZodType, TOut extends z.ZodType, TInp
|
|
|
206
206
|
readonly annotations: _modelcontextprotocol_sdk_types_js.Tool["annotations"];
|
|
207
207
|
inputDependencies: InputDependenciesValue<TInputDependencies>;
|
|
208
208
|
}
|
|
209
|
-
interface ToolDefinitionNone<TIn extends z.
|
|
209
|
+
interface ToolDefinitionNone<TIn extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined = undefined, TName extends string = string> extends ToolDefinitionBase<TIn, TOut, TInputDependencies, TName> {
|
|
210
210
|
readonly connection?: undefined;
|
|
211
211
|
readonly connections?: undefined;
|
|
212
212
|
run: (input: z.infer<TIn>, ctx?: ContextNone) => Promise<z.infer<TOut>>;
|
|
213
213
|
}
|
|
214
|
-
interface ToolDefinitionSingle<TIn extends z.
|
|
214
|
+
interface ToolDefinitionSingle<TIn extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined = undefined, TName extends string = string, TKey extends string = string> extends ToolDefinitionBase<TIn, TOut, TInputDependencies, TName> {
|
|
215
215
|
readonly connection: TKey;
|
|
216
216
|
readonly connections?: undefined;
|
|
217
217
|
run: (input: z.infer<TIn>, ctx: ContextSingle) => Promise<z.infer<TOut>>;
|
|
218
218
|
}
|
|
219
|
-
interface ToolDefinitionMulti<TIn extends z.
|
|
219
|
+
interface ToolDefinitionMulti<TIn extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined = undefined, TName extends string = string, TSlots extends string = string, TKey extends string = string> extends ToolDefinitionBase<TIn, TOut, TInputDependencies, TName> {
|
|
220
220
|
readonly connection?: undefined;
|
|
221
221
|
readonly connections: Record<TSlots, TKey>;
|
|
222
222
|
run: (input: z.infer<TIn>, ctx: ContextMulti<TSlots>) => Promise<z.infer<TOut>>;
|
|
223
223
|
}
|
|
224
|
-
type ToolDefinition<TIn extends z.
|
|
224
|
+
type ToolDefinition<TIn extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies$1 | undefined = undefined, TName extends string = string, TSlots extends string = string, TKey extends string = string> = ToolDefinitionNone<TIn, TOut, TInputDependencies, TName> | ToolDefinitionSingle<TIn, TOut, TInputDependencies, TName, TKey> | ToolDefinitionMulti<TIn, TOut, TInputDependencies, TName, TSlots, TKey>;
|
|
225
225
|
/** Wide author-side `run` signature for polymorphic walks. */
|
|
226
226
|
type AnyToolDefinitionRun = (input: any, ctx?: any) => Promise<any>;
|
|
227
|
-
type AnyToolDefinition = Omit<ToolDefinitionBase<z.
|
|
227
|
+
type AnyToolDefinition = Omit<ToolDefinitionBase<z.ZodObject<z.ZodRawShape>, z.ZodObject<z.ZodRawShape>, any, string>, "run" | "inputDependencies"> & {
|
|
228
228
|
inputDependencies: AnyInputDependencies$1 | undefined;
|
|
229
229
|
run: AnyToolDefinitionRun;
|
|
230
230
|
readonly connection?: string | undefined;
|
|
@@ -457,9 +457,9 @@ declare function defineConnector<TScripts extends Record<string, AnyDef>, const
|
|
|
457
457
|
*/
|
|
458
458
|
|
|
459
459
|
type AnyInputDependencies = Readonly<Record<string, unknown>>;
|
|
460
|
-
declare function defineTool<TIn extends z.
|
|
461
|
-
declare function defineTool<TIn extends z.
|
|
462
|
-
declare function defineTool<TIn extends z.
|
|
460
|
+
declare function defineTool<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies | undefined = undefined, const TName extends string = string>(config: DefineToolConfigNone<TIn, TOut, TInputDependencies, TName>): ToolDefinitionNone<TIn, TOut, TInputDependencies, TName>;
|
|
461
|
+
declare function defineTool<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies | undefined = undefined, const TName extends string = string, const TKey extends string = string>(config: DefineToolConfigSingle<TIn, TOut, TInputDependencies, TName, TKey>): ToolDefinitionSingle<TIn, TOut, TInputDependencies, TName, TKey>;
|
|
462
|
+
declare function defineTool<TIn extends z.ZodObject<z.ZodRawShape>, TOut extends z.ZodObject<z.ZodRawShape>, TInputDependencies extends AnyInputDependencies | undefined = undefined, const TName extends string = string, const TSlots extends string = string, const TKey extends string = string>(config: DefineToolConfigMulti<TIn, TOut, TInputDependencies, TName, TSlots, TKey>): ToolDefinitionMulti<TIn, TOut, TInputDependencies, TName, TSlots, TKey>;
|
|
463
463
|
|
|
464
464
|
/**
|
|
465
465
|
* `handleIfScriptMain(meta, definition, opts?)` — per-script CLI execution
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zapier/connectors-sdk",
|
|
3
|
-
"version": "0.1.0-experimental.
|
|
3
|
+
"version": "0.1.0-experimental.7",
|
|
4
4
|
"description": "SDK for building Zapier connectors. Provides the authoring primitives and execution surfaces for connector scripts.",
|
|
5
5
|
"license": "Elastic-2.0",
|
|
6
6
|
"type": "module",
|