@zapier/zapier-sdk 0.84.0 → 0.84.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 +6 -0
- package/dist/experimental.cjs +96 -81
- package/dist/experimental.d.mts +2 -2
- package/dist/experimental.d.ts +2 -2
- package/dist/experimental.mjs +96 -81
- package/dist/{index--H-bce1q.d.mts → index-BTKFTcSZ.d.mts} +20 -5
- package/dist/{index--H-bce1q.d.ts → index-BTKFTcSZ.d.ts} +20 -5
- package/dist/index.cjs +83 -68
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +83 -68
- package/package.json +2 -2
package/dist/experimental.mjs
CHANGED
|
@@ -2095,9 +2095,7 @@ function buildMethodEntries(descriptors, context, states) {
|
|
|
2095
2095
|
}
|
|
2096
2096
|
);
|
|
2097
2097
|
} else if (out.type === "item") {
|
|
2098
|
-
const itemCore = async (input) => (
|
|
2099
|
-
data: await callRun(input)
|
|
2100
|
-
});
|
|
2098
|
+
const itemCore = async (input) => callRun(input);
|
|
2101
2099
|
entry.value = createFunction(
|
|
2102
2100
|
fold(itemCore),
|
|
2103
2101
|
{
|
|
@@ -5196,7 +5194,7 @@ function parseDeprecationDate(value) {
|
|
|
5196
5194
|
}
|
|
5197
5195
|
|
|
5198
5196
|
// src/sdk-version.ts
|
|
5199
|
-
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.84.
|
|
5197
|
+
var SDK_VERSION = (typeof process !== "undefined" && process.env ? "0.84.1" : void 0) || "unknown";
|
|
5200
5198
|
|
|
5201
5199
|
// src/utils/open-url.ts
|
|
5202
5200
|
var nodePrefix = "node:";
|
|
@@ -6620,13 +6618,15 @@ var getProfilePlugin = defineMethod({
|
|
|
6620
6618
|
authRequired: true
|
|
6621
6619
|
});
|
|
6622
6620
|
return {
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6621
|
+
data: {
|
|
6622
|
+
id: String(profile.public_id ?? profile.id),
|
|
6623
|
+
first_name: profile.first_name,
|
|
6624
|
+
last_name: profile.last_name,
|
|
6625
|
+
full_name: `${profile.first_name} ${profile.last_name}`,
|
|
6626
|
+
email: profile.email,
|
|
6627
|
+
email_confirmed: profile.email_confirmed,
|
|
6628
|
+
timezone: profile.timezone
|
|
6629
|
+
}
|
|
6630
6630
|
};
|
|
6631
6631
|
}
|
|
6632
6632
|
});
|
|
@@ -9343,7 +9343,7 @@ var getActionPlugin = defineMethod({
|
|
|
9343
9343
|
});
|
|
9344
9344
|
for await (const action of imports.listActions({ app: appKey }).items()) {
|
|
9345
9345
|
if ((action.key === actionKey || action.id === actionKey) && action.action_type === actionType) {
|
|
9346
|
-
return action;
|
|
9346
|
+
return { data: action };
|
|
9347
9347
|
}
|
|
9348
9348
|
}
|
|
9349
9349
|
throw new ZapierResourceNotFoundError(
|
|
@@ -9859,7 +9859,7 @@ var getAppPlugin = defineMethod({
|
|
|
9859
9859
|
run: async ({ imports, input }) => {
|
|
9860
9860
|
const appKey = "app" in input ? input.app : input.appKey;
|
|
9861
9861
|
for await (const app of imports.listApps({ apps: [appKey] }).items()) {
|
|
9862
|
-
return app;
|
|
9862
|
+
return { data: app };
|
|
9863
9863
|
}
|
|
9864
9864
|
throw new ZapierAppNotFoundError("App not found", { appKey });
|
|
9865
9865
|
}
|
|
@@ -10081,7 +10081,7 @@ var getConnectionPlugin = defineMethod({
|
|
|
10081
10081
|
}
|
|
10082
10082
|
}
|
|
10083
10083
|
);
|
|
10084
|
-
return transformConnectionItem(response.data);
|
|
10084
|
+
return { data: transformConnectionItem(response.data) };
|
|
10085
10085
|
}
|
|
10086
10086
|
});
|
|
10087
10087
|
|
|
@@ -10116,7 +10116,7 @@ var findFirstConnectionPlugin = defineMethod({
|
|
|
10116
10116
|
{ resourceType: "Connection" }
|
|
10117
10117
|
);
|
|
10118
10118
|
}
|
|
10119
|
-
return connectionsResponse.data[0];
|
|
10119
|
+
return { data: connectionsResponse.data[0] };
|
|
10120
10120
|
}
|
|
10121
10121
|
});
|
|
10122
10122
|
|
|
@@ -10157,7 +10157,7 @@ var findUniqueConnectionPlugin = defineMethod({
|
|
|
10157
10157
|
"Multiple connections found matching the specified criteria. Expected exactly one."
|
|
10158
10158
|
);
|
|
10159
10159
|
}
|
|
10160
|
-
return connectionsResponse.data[0];
|
|
10160
|
+
return { data: connectionsResponse.data[0] };
|
|
10161
10161
|
}
|
|
10162
10162
|
});
|
|
10163
10163
|
var GetConnectionStartUrlSchema = z.object({
|
|
@@ -10205,12 +10205,14 @@ var getConnectionStartUrlPlugin = defineMethod({
|
|
|
10205
10205
|
{ selected_api: selectedApi },
|
|
10206
10206
|
{ authRequired: true }
|
|
10207
10207
|
);
|
|
10208
|
-
return
|
|
10209
|
-
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
10213
|
-
|
|
10208
|
+
return {
|
|
10209
|
+
data: GetConnectionStartUrlItemSchema.parse({
|
|
10210
|
+
url: response.url,
|
|
10211
|
+
expiresAt: response.expires_at,
|
|
10212
|
+
startedAt: response.started_at,
|
|
10213
|
+
app: selectedApi
|
|
10214
|
+
})
|
|
10215
|
+
};
|
|
10214
10216
|
}
|
|
10215
10217
|
});
|
|
10216
10218
|
var WaitForNewConnectionSchema = z.object({
|
|
@@ -10284,11 +10286,13 @@ var waitForNewConnectionPlugin = defineMethod({
|
|
|
10284
10286
|
body.data[0]
|
|
10285
10287
|
)
|
|
10286
10288
|
});
|
|
10287
|
-
return
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10289
|
+
return {
|
|
10290
|
+
data: WaitForNewConnectionItemSchema.parse({
|
|
10291
|
+
id: String(top.public_id ?? top.id),
|
|
10292
|
+
app: appKey,
|
|
10293
|
+
title: top.title ?? null
|
|
10294
|
+
})
|
|
10295
|
+
};
|
|
10292
10296
|
} catch (err) {
|
|
10293
10297
|
if (err instanceof ZapierTimeoutError) {
|
|
10294
10298
|
throw new ZapierTimeoutError(
|
|
@@ -10389,11 +10393,13 @@ Open this URL to complete the connection:
|
|
|
10389
10393
|
timeoutMs: input.timeoutMs,
|
|
10390
10394
|
pollIntervalMs: input.pollIntervalMs
|
|
10391
10395
|
});
|
|
10392
|
-
return
|
|
10393
|
-
|
|
10394
|
-
|
|
10395
|
-
|
|
10396
|
-
|
|
10396
|
+
return {
|
|
10397
|
+
data: CreateConnectionItemSchema.parse({
|
|
10398
|
+
id: fresh.id,
|
|
10399
|
+
app: start2.app,
|
|
10400
|
+
title: fresh.title ?? null
|
|
10401
|
+
})
|
|
10402
|
+
};
|
|
10397
10403
|
}
|
|
10398
10404
|
});
|
|
10399
10405
|
|
|
@@ -10581,7 +10587,7 @@ var createClientCredentialsPlugin = defineMethod({
|
|
|
10581
10587
|
requiredScopes: ["credentials"]
|
|
10582
10588
|
}
|
|
10583
10589
|
);
|
|
10584
|
-
return response.data;
|
|
10590
|
+
return { data: response.data };
|
|
10585
10591
|
}
|
|
10586
10592
|
});
|
|
10587
10593
|
var DeleteClientCredentialsSchema = z.object({
|
|
@@ -11044,7 +11050,10 @@ var getActionInputFieldsSchemaPlugin = defineMethod({
|
|
|
11044
11050
|
connection: connectionIdResolver,
|
|
11045
11051
|
inputs: inputsAllOptionalResolver
|
|
11046
11052
|
},
|
|
11047
|
-
run: async ({
|
|
11053
|
+
run: async ({
|
|
11054
|
+
imports,
|
|
11055
|
+
input
|
|
11056
|
+
}) => {
|
|
11048
11057
|
const api = imports.api;
|
|
11049
11058
|
const getVersionedImplementationId = imports.manifest.getVersionedImplementationId;
|
|
11050
11059
|
const resolveConnection = imports.connections.resolveConnection;
|
|
@@ -11082,7 +11091,7 @@ var getActionInputFieldsSchemaPlugin = defineMethod({
|
|
|
11082
11091
|
connectionId: resolvedConnectionId ?? null,
|
|
11083
11092
|
inputs
|
|
11084
11093
|
});
|
|
11085
|
-
return needsData.schema || {};
|
|
11094
|
+
return { data: needsData.schema || {} };
|
|
11086
11095
|
}
|
|
11087
11096
|
});
|
|
11088
11097
|
var InputFieldChoiceItemSchema = NeedChoicesSchema;
|
|
@@ -11530,7 +11539,7 @@ var createTriggerInboxPlugin = defineMethod({
|
|
|
11530
11539
|
}
|
|
11531
11540
|
}
|
|
11532
11541
|
);
|
|
11533
|
-
return TriggerInboxItemSchema.parse(rawResponse);
|
|
11542
|
+
return { data: TriggerInboxItemSchema.parse(rawResponse) };
|
|
11534
11543
|
}
|
|
11535
11544
|
});
|
|
11536
11545
|
var EnsureTriggerInboxDescription = "Get-or-create a trigger inbox by key. Idempotent on (user, account, key): returns the existing inbox if a matching subscription is registered, creates a new one otherwise. Throws ZapierConflictError if the key exists with a different subscription.";
|
|
@@ -11631,7 +11640,7 @@ var ensureTriggerInboxPlugin = defineMethod({
|
|
|
11631
11640
|
}
|
|
11632
11641
|
}
|
|
11633
11642
|
);
|
|
11634
|
-
return TriggerInboxItemSchema.parse(rawResponse);
|
|
11643
|
+
return { data: TriggerInboxItemSchema.parse(rawResponse) };
|
|
11635
11644
|
}
|
|
11636
11645
|
});
|
|
11637
11646
|
var ListTriggerInboxesSchema = z.object({
|
|
@@ -11726,7 +11735,7 @@ var getTriggerInboxPlugin = defineMethod({
|
|
|
11726
11735
|
resource: { type: "trigger_inbox", id: inboxId }
|
|
11727
11736
|
}
|
|
11728
11737
|
);
|
|
11729
|
-
return TriggerInboxItemSchema.parse(rawResponse);
|
|
11738
|
+
return { data: TriggerInboxItemSchema.parse(rawResponse) };
|
|
11730
11739
|
}
|
|
11731
11740
|
});
|
|
11732
11741
|
var UpdateTriggerInboxSchema = z.object({
|
|
@@ -11764,7 +11773,7 @@ var updateTriggerInboxPlugin = defineMethod({
|
|
|
11764
11773
|
resource: { type: "trigger_inbox", id: inboxId }
|
|
11765
11774
|
}
|
|
11766
11775
|
);
|
|
11767
|
-
return TriggerInboxItemSchema.parse(rawResponse);
|
|
11776
|
+
return { data: TriggerInboxItemSchema.parse(rawResponse) };
|
|
11768
11777
|
}
|
|
11769
11778
|
});
|
|
11770
11779
|
var DeleteTriggerInboxSchema = z.object({
|
|
@@ -11829,7 +11838,7 @@ var pauseTriggerInboxPlugin = defineMethod({
|
|
|
11829
11838
|
resource: { type: "trigger_inbox", id: inboxId }
|
|
11830
11839
|
}
|
|
11831
11840
|
);
|
|
11832
|
-
return TriggerInboxItemSchema.parse(rawResponse);
|
|
11841
|
+
return { data: TriggerInboxItemSchema.parse(rawResponse) };
|
|
11833
11842
|
}
|
|
11834
11843
|
});
|
|
11835
11844
|
var ResumeTriggerInboxSchema = z.object({
|
|
@@ -11860,7 +11869,7 @@ var resumeTriggerInboxPlugin = defineMethod({
|
|
|
11860
11869
|
resource: { type: "trigger_inbox", id: inboxId }
|
|
11861
11870
|
}
|
|
11862
11871
|
);
|
|
11863
|
-
return TriggerInboxItemSchema.parse(rawResponse);
|
|
11872
|
+
return { data: TriggerInboxItemSchema.parse(rawResponse) };
|
|
11864
11873
|
}
|
|
11865
11874
|
});
|
|
11866
11875
|
var TriggerMessageStatusSchema = z.union([z.enum(["available", "leased", "acked", "quarantined"]), z.string()]).describe("Message lifecycle status");
|
|
@@ -12049,7 +12058,7 @@ var leaseTriggerInboxMessagesPlugin = defineMethod({
|
|
|
12049
12058
|
}
|
|
12050
12059
|
}
|
|
12051
12060
|
);
|
|
12052
|
-
return LeaseTriggerInboxMessagesItemSchema.parse(rawResponse);
|
|
12061
|
+
return { data: LeaseTriggerInboxMessagesItemSchema.parse(rawResponse) };
|
|
12053
12062
|
}
|
|
12054
12063
|
});
|
|
12055
12064
|
var AckTriggerInboxMessagesSchema = z.object({
|
|
@@ -12099,7 +12108,7 @@ var ackTriggerInboxMessagesPlugin = defineMethod({
|
|
|
12099
12108
|
requestBody,
|
|
12100
12109
|
{ authRequired: true }
|
|
12101
12110
|
);
|
|
12102
|
-
return AckTriggerInboxMessagesItemSchema.parse(rawResponse);
|
|
12111
|
+
return { data: AckTriggerInboxMessagesItemSchema.parse(rawResponse) };
|
|
12103
12112
|
}
|
|
12104
12113
|
});
|
|
12105
12114
|
var ReleaseTriggerInboxMessagesSchema = z.object({
|
|
@@ -12149,7 +12158,7 @@ var releaseTriggerInboxMessagesPlugin = defineMethod({
|
|
|
12149
12158
|
requestBody,
|
|
12150
12159
|
{ authRequired: true }
|
|
12151
12160
|
);
|
|
12152
|
-
return ReleaseTriggerInboxMessagesItemSchema.parse(rawResponse);
|
|
12161
|
+
return { data: ReleaseTriggerInboxMessagesItemSchema.parse(rawResponse) };
|
|
12153
12162
|
}
|
|
12154
12163
|
});
|
|
12155
12164
|
|
|
@@ -13177,7 +13186,7 @@ var getTablePlugin = defineMethod({
|
|
|
13177
13186
|
resource: { type: "table", id: tableId }
|
|
13178
13187
|
});
|
|
13179
13188
|
const response = GetTableApiResponseSchema.parse(rawResponse);
|
|
13180
|
-
return transformTableItem(response.data);
|
|
13189
|
+
return { data: transformTableItem(response.data) };
|
|
13181
13190
|
}
|
|
13182
13191
|
});
|
|
13183
13192
|
var DeleteTableDescription = "Delete a table by its ID";
|
|
@@ -13237,7 +13246,7 @@ var createTablePlugin = defineMethod({
|
|
|
13237
13246
|
{ authRequired: true }
|
|
13238
13247
|
);
|
|
13239
13248
|
const response = CreateTableApiResponseSchema.parse(rawResponse);
|
|
13240
|
-
return transformTableItem(response.data);
|
|
13249
|
+
return { data: transformTableItem(response.data) };
|
|
13241
13250
|
}
|
|
13242
13251
|
});
|
|
13243
13252
|
|
|
@@ -13257,10 +13266,8 @@ var listTableFieldsPlugin = defineMethod({
|
|
|
13257
13266
|
imports: [apiPluginRef],
|
|
13258
13267
|
categories: tableCategories,
|
|
13259
13268
|
itemType: "Field",
|
|
13260
|
-
// A field list, but the API returns no cursor
|
|
13261
|
-
//
|
|
13262
|
-
// not an iterator). `output: "item"` reproduces that exactly (same boundary +
|
|
13263
|
-
// hooks; run returns the bare array, framework wraps to `{ data }`); the
|
|
13269
|
+
// A field list, but the API returns no cursor, so `output: "item"` returns
|
|
13270
|
+
// `{ data: FieldItem[] }` directly instead of a paginated iterator; the
|
|
13264
13271
|
// `type: "list"` first-class field keeps the list presentation.
|
|
13265
13272
|
type: "list",
|
|
13266
13273
|
inputSchema: ListTableFieldsOptionsInputSchema,
|
|
@@ -13289,7 +13296,7 @@ var listTableFieldsPlugin = defineMethod({
|
|
|
13289
13296
|
}
|
|
13290
13297
|
);
|
|
13291
13298
|
const response = ListTableFieldsApiResponseSchema.parse(rawResponse);
|
|
13292
|
-
return response.data.map(transformFieldItem);
|
|
13299
|
+
return { data: response.data.map(transformFieldItem) };
|
|
13293
13300
|
}
|
|
13294
13301
|
});
|
|
13295
13302
|
var FieldChangesetItemSchema = z.object({
|
|
@@ -13334,8 +13341,8 @@ var createTableFieldsPlugin = defineMethod({
|
|
|
13334
13341
|
returnType: "FieldItem[]",
|
|
13335
13342
|
inputSchema: CreateTableFieldsOptionsInputSchema,
|
|
13336
13343
|
outputSchema: FieldItemSchema,
|
|
13337
|
-
//
|
|
13338
|
-
//
|
|
13344
|
+
// Item output with an array payload: callers get `{ data: FieldItem[] }`
|
|
13345
|
+
// directly rather than a paginated list.
|
|
13339
13346
|
output: "item",
|
|
13340
13347
|
formatter: tableFieldItemFormatter,
|
|
13341
13348
|
resolvers: { table: tableIdResolver, fields: tableFieldsResolver },
|
|
@@ -13348,7 +13355,9 @@ var createTableFieldsPlugin = defineMethod({
|
|
|
13348
13355
|
{ authRequired: true, resource: { type: "table", id: tableId } }
|
|
13349
13356
|
);
|
|
13350
13357
|
const response = CreateTableFieldsApiResponseSchema.parse(rawResponse);
|
|
13351
|
-
return
|
|
13358
|
+
return {
|
|
13359
|
+
data: response.data.map((changeset) => transformFieldItem(changeset.new))
|
|
13360
|
+
};
|
|
13352
13361
|
}
|
|
13353
13362
|
});
|
|
13354
13363
|
var DeleteTableFieldsDescription = "Delete one or more fields from a table";
|
|
@@ -13489,8 +13498,10 @@ var getTableRecordPlugin = defineMethod({
|
|
|
13489
13498
|
keyMode: input.keyMode
|
|
13490
13499
|
});
|
|
13491
13500
|
return {
|
|
13492
|
-
|
|
13493
|
-
|
|
13501
|
+
data: {
|
|
13502
|
+
...transformRecordItem(response.data),
|
|
13503
|
+
data: translator.translateOutput(response.data.data)
|
|
13504
|
+
}
|
|
13494
13505
|
};
|
|
13495
13506
|
}
|
|
13496
13507
|
});
|
|
@@ -13669,8 +13680,8 @@ var createTableRecordsPlugin = defineMethod({
|
|
|
13669
13680
|
returnType: "RecordItem[]",
|
|
13670
13681
|
inputSchema: CreateTableRecordsOptionsInputSchema,
|
|
13671
13682
|
outputSchema: RecordItemSchema,
|
|
13672
|
-
//
|
|
13673
|
-
//
|
|
13683
|
+
// Item output with an array payload: callers get `{ data: RecordItem[] }`
|
|
13684
|
+
// directly rather than a paginated list.
|
|
13674
13685
|
output: "item",
|
|
13675
13686
|
resolvers: { table: tableIdResolver, records: tableRecordsResolver },
|
|
13676
13687
|
formatter: tableRecordFormatter,
|
|
@@ -13696,10 +13707,12 @@ var createTableRecordsPlugin = defineMethod({
|
|
|
13696
13707
|
for (const changeset of response.data) {
|
|
13697
13708
|
throwOnRecordErrors(changeset.new);
|
|
13698
13709
|
}
|
|
13699
|
-
return
|
|
13700
|
-
|
|
13701
|
-
|
|
13702
|
-
|
|
13710
|
+
return {
|
|
13711
|
+
data: response.data.map((changeset) => ({
|
|
13712
|
+
...transformRecordItem(changeset.new),
|
|
13713
|
+
data: translator.translateOutput(changeset.new.data)
|
|
13714
|
+
}))
|
|
13715
|
+
};
|
|
13703
13716
|
}
|
|
13704
13717
|
});
|
|
13705
13718
|
var DeleteTableRecordsDescription = "Delete one or more records from a table";
|
|
@@ -13779,8 +13792,8 @@ var updateTableRecordsPlugin = defineMethod({
|
|
|
13779
13792
|
returnType: "RecordItem[]",
|
|
13780
13793
|
inputSchema: UpdateTableRecordsOptionsInputSchema,
|
|
13781
13794
|
outputSchema: RecordItemSchema,
|
|
13782
|
-
//
|
|
13783
|
-
//
|
|
13795
|
+
// Item output with an array payload: callers get `{ data: RecordItem[] }`
|
|
13796
|
+
// directly rather than a paginated list.
|
|
13784
13797
|
output: "item",
|
|
13785
13798
|
resolvers: { table: tableIdResolver, records: tableUpdateRecordsResolver },
|
|
13786
13799
|
formatter: tableRecordFormatter,
|
|
@@ -13807,10 +13820,12 @@ var updateTableRecordsPlugin = defineMethod({
|
|
|
13807
13820
|
for (const changeset of response.data) {
|
|
13808
13821
|
throwOnRecordErrors(changeset.new);
|
|
13809
13822
|
}
|
|
13810
|
-
return
|
|
13811
|
-
|
|
13812
|
-
|
|
13813
|
-
|
|
13823
|
+
return {
|
|
13824
|
+
data: response.data.map((changeset) => ({
|
|
13825
|
+
...transformRecordItem(changeset.new),
|
|
13826
|
+
data: translator.translateOutput(changeset.new.data)
|
|
13827
|
+
}))
|
|
13828
|
+
};
|
|
13814
13829
|
}
|
|
13815
13830
|
});
|
|
13816
13831
|
var RelayRequestSchema = z.object({
|
|
@@ -14958,7 +14973,7 @@ var getWorkflowPlugin = defineMethod({
|
|
|
14958
14973
|
resource: { type: "workflow", id: input.workflow }
|
|
14959
14974
|
}
|
|
14960
14975
|
);
|
|
14961
|
-
return GetWorkflowResponseSchema.parse(raw);
|
|
14976
|
+
return { data: GetWorkflowResponseSchema.parse(raw) };
|
|
14962
14977
|
}
|
|
14963
14978
|
});
|
|
14964
14979
|
var CreateWorkflowOptionsSchema = z.object({
|
|
@@ -15016,7 +15031,7 @@ var createWorkflowPlugin = defineMethod({
|
|
|
15016
15031
|
authRequired: true
|
|
15017
15032
|
}
|
|
15018
15033
|
);
|
|
15019
|
-
return CreateWorkflowResponseSchema.parse(raw);
|
|
15034
|
+
return { data: CreateWorkflowResponseSchema.parse(raw) };
|
|
15020
15035
|
}
|
|
15021
15036
|
});
|
|
15022
15037
|
var UpdateWorkflowOptionsSchema = z.object({
|
|
@@ -15068,7 +15083,7 @@ var updateWorkflowPlugin = defineMethod({
|
|
|
15068
15083
|
resource: { type: "workflow", id: input.workflow }
|
|
15069
15084
|
}
|
|
15070
15085
|
);
|
|
15071
|
-
return UpdateWorkflowResponseSchema.parse(raw);
|
|
15086
|
+
return { data: UpdateWorkflowResponseSchema.parse(raw) };
|
|
15072
15087
|
}
|
|
15073
15088
|
});
|
|
15074
15089
|
var EnableWorkflowOptionsSchema = z.object({
|
|
@@ -15100,7 +15115,7 @@ var enableWorkflowPlugin = defineMethod({
|
|
|
15100
15115
|
resource: { type: "workflow", id: input.workflow }
|
|
15101
15116
|
}
|
|
15102
15117
|
);
|
|
15103
|
-
return EnableWorkflowResponseSchema.parse(raw);
|
|
15118
|
+
return { data: EnableWorkflowResponseSchema.parse(raw) };
|
|
15104
15119
|
}
|
|
15105
15120
|
});
|
|
15106
15121
|
var DisableWorkflowOptionsSchema = z.object({
|
|
@@ -15134,7 +15149,7 @@ var disableWorkflowPlugin = defineMethod({
|
|
|
15134
15149
|
resource: { type: "workflow", id: input.workflow }
|
|
15135
15150
|
}
|
|
15136
15151
|
);
|
|
15137
|
-
return DisableWorkflowResponseSchema.parse(raw);
|
|
15152
|
+
return { data: DisableWorkflowResponseSchema.parse(raw) };
|
|
15138
15153
|
}
|
|
15139
15154
|
});
|
|
15140
15155
|
var DeleteWorkflowOptionsSchema = z.object({
|
|
@@ -15357,7 +15372,7 @@ var getDurableRunPlugin = defineMethod({
|
|
|
15357
15372
|
resource: { type: "run", id: input.run }
|
|
15358
15373
|
}
|
|
15359
15374
|
);
|
|
15360
|
-
return GetDurableRunResponseSchema.parse(raw);
|
|
15375
|
+
return { data: GetDurableRunResponseSchema.parse(raw) };
|
|
15361
15376
|
}
|
|
15362
15377
|
});
|
|
15363
15378
|
var RunNotificationEventSchema = z.enum(["started", "progress", "completed", "error", "cancelled"]).describe("Run lifecycle event this notification subscribes to");
|
|
@@ -15457,7 +15472,7 @@ var runDurablePlugin = defineMethod({
|
|
|
15457
15472
|
const raw = await api.post(`${CODE_SUBSTRATE_RUNNER_API}/runs`, body, {
|
|
15458
15473
|
authRequired: true
|
|
15459
15474
|
});
|
|
15460
|
-
return RunDurableResponseSchema.parse(raw);
|
|
15475
|
+
return { data: RunDurableResponseSchema.parse(raw) };
|
|
15461
15476
|
}
|
|
15462
15477
|
});
|
|
15463
15478
|
var CancelDurableRunOptionsSchema = z.object({
|
|
@@ -15493,7 +15508,7 @@ var cancelDurableRunPlugin = defineMethod({
|
|
|
15493
15508
|
resource: { type: "run", id: input.run }
|
|
15494
15509
|
}
|
|
15495
15510
|
);
|
|
15496
|
-
return { id: input.run, status: "cancelled" };
|
|
15511
|
+
return { data: { id: input.run, status: "cancelled" } };
|
|
15497
15512
|
}
|
|
15498
15513
|
});
|
|
15499
15514
|
var TriggerConfigSchema = z.object({
|
|
@@ -15634,7 +15649,7 @@ var publishWorkflowVersionPlugin = defineMethod({
|
|
|
15634
15649
|
resource: { type: "workflow", id: input.workflow }
|
|
15635
15650
|
}
|
|
15636
15651
|
);
|
|
15637
|
-
return PublishWorkflowVersionResponseSchema.parse(raw);
|
|
15652
|
+
return { data: PublishWorkflowVersionResponseSchema.parse(raw) };
|
|
15638
15653
|
}
|
|
15639
15654
|
});
|
|
15640
15655
|
var WorkflowVersionListItemSchema = z.object({
|
|
@@ -15750,7 +15765,7 @@ var getWorkflowVersionPlugin = defineMethod({
|
|
|
15750
15765
|
resource: { type: "workflow-version", id: input.version }
|
|
15751
15766
|
}
|
|
15752
15767
|
);
|
|
15753
|
-
return GetWorkflowVersionResponseSchema.parse(raw);
|
|
15768
|
+
return { data: GetWorkflowVersionResponseSchema.parse(raw) };
|
|
15754
15769
|
}
|
|
15755
15770
|
});
|
|
15756
15771
|
var WorkflowRunStatusSchema = z.union([
|
|
@@ -15884,7 +15899,7 @@ var getWorkflowRunPlugin = defineMethod({
|
|
|
15884
15899
|
resource: { type: "workflow-run", id: input.run }
|
|
15885
15900
|
}
|
|
15886
15901
|
);
|
|
15887
|
-
return GetWorkflowRunResponseSchema.parse(raw);
|
|
15902
|
+
return { data: GetWorkflowRunResponseSchema.parse(raw) };
|
|
15888
15903
|
}
|
|
15889
15904
|
});
|
|
15890
15905
|
var GetTriggerRunOptionsSchema = z.object({
|
|
@@ -15928,7 +15943,7 @@ var getTriggerRunPlugin = defineMethod({
|
|
|
15928
15943
|
resource: { type: "workflow-trigger", id: input.trigger }
|
|
15929
15944
|
}
|
|
15930
15945
|
);
|
|
15931
|
-
return GetTriggerRunResponseSchema.parse(raw);
|
|
15946
|
+
return { data: GetTriggerRunResponseSchema.parse(raw) };
|
|
15932
15947
|
}
|
|
15933
15948
|
});
|
|
15934
15949
|
var TriggerWorkflowLookupResponseSchema = z.object({
|
|
@@ -15985,7 +16000,7 @@ var triggerWorkflowPlugin = defineMethod({
|
|
|
15985
16000
|
resource: { type: "workflow", id: input.workflow }
|
|
15986
16001
|
}
|
|
15987
16002
|
);
|
|
15988
|
-
return TriggerWorkflowResponseSchema.parse(raw);
|
|
16003
|
+
return { data: TriggerWorkflowResponseSchema.parse(raw) };
|
|
15989
16004
|
}
|
|
15990
16005
|
});
|
|
15991
16006
|
|
|
@@ -1081,6 +1081,21 @@ type StrictPage$1<TResponse> = SdkPage<unknown> & {
|
|
|
1081
1081
|
type ItemOf$1<TResponse> = TResponse extends SdkPage<infer TItem> ? TItem : TResponse extends {
|
|
1082
1082
|
data: readonly (infer TItem)[];
|
|
1083
1083
|
} ? TItem : never;
|
|
1084
|
+
/**
|
|
1085
|
+
* A response whose only own key is `data`. Gates the item overload of
|
|
1086
|
+
* `defineMethod` the way `StrictPage` gates list-standard: `run` returns the
|
|
1087
|
+
* `{ data }` envelope itself, and an envelope with extra keys is rejected (a
|
|
1088
|
+
* future variant may accept metadata alongside `data`).
|
|
1089
|
+
*/
|
|
1090
|
+
type StrictItem<TResponse> = {
|
|
1091
|
+
data: unknown;
|
|
1092
|
+
} & {
|
|
1093
|
+
[K in Exclude<keyof TResponse, "data">]?: never;
|
|
1094
|
+
};
|
|
1095
|
+
/** Data type sourced from an item envelope. */
|
|
1096
|
+
type DataOf<TResponse> = TResponse extends {
|
|
1097
|
+
data: infer TData;
|
|
1098
|
+
} ? TData : never;
|
|
1084
1099
|
/**
|
|
1085
1100
|
* A leaf plugin that is a single value (not a function). `value` is a static
|
|
1086
1101
|
* constant; `get({ imports })` computes the value from imports. Like a
|
|
@@ -2095,8 +2110,8 @@ declare function createPluginStack<TRequires = object>(): PluginStack<TRequires,
|
|
|
2095
2110
|
*
|
|
2096
2111
|
* The `output` mode shapes `run`'s result into the public surface and drives
|
|
2097
2112
|
* the overload that types the call: raw (default, passthrough), `item`
|
|
2098
|
-
* (`run` returns `T`, surfaced as `Promise<{ data: T }>`), or `list`
|
|
2099
|
-
* returns one `SdkPage`, surfaced as `PaginatedSdkResult`). See Output.
|
|
2113
|
+
* (`run` returns `{ data: T }`, surfaced as `Promise<{ data: T }>`), or `list`
|
|
2114
|
+
* (`run` returns one `SdkPage`, surfaced as `PaginatedSdkResult`). See Output.
|
|
2100
2115
|
*/
|
|
2101
2116
|
declare function defineMethod<const TName extends string, TInput, TOutput, const TPositional extends readonly (keyof TInput & string)[] = readonly [], const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
|
|
2102
2117
|
name: TName;
|
|
@@ -2125,7 +2140,7 @@ declare function defineMethod<const TName extends string, TInput, TOutput, const
|
|
|
2125
2140
|
}) => void | Promise<void>;
|
|
2126
2141
|
run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) => TOutput;
|
|
2127
2142
|
} & LeafMetaFields): MethodPlugin<TName, TInput, TOutput, TPositional> & LeafSummary<TNamespace, TName, TImports>;
|
|
2128
|
-
declare function defineMethod<const TName extends string, TInput, TData
|
|
2143
|
+
declare function defineMethod<const TName extends string, TInput, TResponse extends StrictItem<TResponse>, TData = DataOf<TResponse>, const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
|
|
2129
2144
|
name: TName;
|
|
2130
2145
|
namespace?: TNamespace;
|
|
2131
2146
|
imports?: TImports & StaticList<TImports>;
|
|
@@ -2143,9 +2158,9 @@ declare function defineMethod<const TName extends string, TInput, TData, const T
|
|
|
2143
2158
|
state: TState;
|
|
2144
2159
|
input?: unknown;
|
|
2145
2160
|
}) => void | Promise<void>;
|
|
2146
|
-
run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) =>
|
|
2161
|
+
run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) => TResponse | Promise<TResponse>;
|
|
2147
2162
|
} & LeafMetaFields): MethodPlugin<TName, TInput, Promise<{
|
|
2148
|
-
data:
|
|
2163
|
+
data: TData;
|
|
2149
2164
|
}>> & LeafSummary<TNamespace, TName, TImports>;
|
|
2150
2165
|
declare function defineMethod<const TName extends string, TInput, TResponse extends StrictPage$1<TResponse>, TItem = ItemOf$1<TResponse>, const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
|
|
2151
2166
|
name: TName;
|
|
@@ -1081,6 +1081,21 @@ type StrictPage$1<TResponse> = SdkPage<unknown> & {
|
|
|
1081
1081
|
type ItemOf$1<TResponse> = TResponse extends SdkPage<infer TItem> ? TItem : TResponse extends {
|
|
1082
1082
|
data: readonly (infer TItem)[];
|
|
1083
1083
|
} ? TItem : never;
|
|
1084
|
+
/**
|
|
1085
|
+
* A response whose only own key is `data`. Gates the item overload of
|
|
1086
|
+
* `defineMethod` the way `StrictPage` gates list-standard: `run` returns the
|
|
1087
|
+
* `{ data }` envelope itself, and an envelope with extra keys is rejected (a
|
|
1088
|
+
* future variant may accept metadata alongside `data`).
|
|
1089
|
+
*/
|
|
1090
|
+
type StrictItem<TResponse> = {
|
|
1091
|
+
data: unknown;
|
|
1092
|
+
} & {
|
|
1093
|
+
[K in Exclude<keyof TResponse, "data">]?: never;
|
|
1094
|
+
};
|
|
1095
|
+
/** Data type sourced from an item envelope. */
|
|
1096
|
+
type DataOf<TResponse> = TResponse extends {
|
|
1097
|
+
data: infer TData;
|
|
1098
|
+
} ? TData : never;
|
|
1084
1099
|
/**
|
|
1085
1100
|
* A leaf plugin that is a single value (not a function). `value` is a static
|
|
1086
1101
|
* constant; `get({ imports })` computes the value from imports. Like a
|
|
@@ -2095,8 +2110,8 @@ declare function createPluginStack<TRequires = object>(): PluginStack<TRequires,
|
|
|
2095
2110
|
*
|
|
2096
2111
|
* The `output` mode shapes `run`'s result into the public surface and drives
|
|
2097
2112
|
* the overload that types the call: raw (default, passthrough), `item`
|
|
2098
|
-
* (`run` returns `T`, surfaced as `Promise<{ data: T }>`), or `list`
|
|
2099
|
-
* returns one `SdkPage`, surfaced as `PaginatedSdkResult`). See Output.
|
|
2113
|
+
* (`run` returns `{ data: T }`, surfaced as `Promise<{ data: T }>`), or `list`
|
|
2114
|
+
* (`run` returns one `SdkPage`, surfaced as `PaginatedSdkResult`). See Output.
|
|
2100
2115
|
*/
|
|
2101
2116
|
declare function defineMethod<const TName extends string, TInput, TOutput, const TPositional extends readonly (keyof TInput & string)[] = readonly [], const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
|
|
2102
2117
|
name: TName;
|
|
@@ -2125,7 +2140,7 @@ declare function defineMethod<const TName extends string, TInput, TOutput, const
|
|
|
2125
2140
|
}) => void | Promise<void>;
|
|
2126
2141
|
run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) => TOutput;
|
|
2127
2142
|
} & LeafMetaFields): MethodPlugin<TName, TInput, TOutput, TPositional> & LeafSummary<TNamespace, TName, TImports>;
|
|
2128
|
-
declare function defineMethod<const TName extends string, TInput, TData
|
|
2143
|
+
declare function defineMethod<const TName extends string, TInput, TResponse extends StrictItem<TResponse>, TData = DataOf<TResponse>, const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
|
|
2129
2144
|
name: TName;
|
|
2130
2145
|
namespace?: TNamespace;
|
|
2131
2146
|
imports?: TImports & StaticList<TImports>;
|
|
@@ -2143,9 +2158,9 @@ declare function defineMethod<const TName extends string, TInput, TData, const T
|
|
|
2143
2158
|
state: TState;
|
|
2144
2159
|
input?: unknown;
|
|
2145
2160
|
}) => void | Promise<void>;
|
|
2146
|
-
run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) =>
|
|
2161
|
+
run: (bag: MethodRunBag<ImportsOf<TImports>, TInput, TState>) => TResponse | Promise<TResponse>;
|
|
2147
2162
|
} & LeafMetaFields): MethodPlugin<TName, TInput, Promise<{
|
|
2148
|
-
data:
|
|
2163
|
+
data: TData;
|
|
2149
2164
|
}>> & LeafSummary<TNamespace, TName, TImports>;
|
|
2150
2165
|
declare function defineMethod<const TName extends string, TInput, TResponse extends StrictPage$1<TResponse>, TItem = ItemOf$1<TResponse>, const TImports extends ImportsInput = readonly [], const TNamespace extends string = "", TState = undefined>(config: {
|
|
2151
2166
|
name: TName;
|