@zapier/kitcore 0.5.1 → 0.6.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @zapier/kitcore
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 197a125: Breaking for plugin authors: an `output: "item"` method's `run` now returns the `{ data: item }` envelope itself (strictly `data`, no extra keys), symmetric with list's `SdkPage`, instead of returning the bare item for the framework to wrap. The public call surface is unchanged: callers still get `Promise<{ data: item }>`.
8
+
3
9
  ## 0.5.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -183,8 +183,13 @@ const transport = defineMethod({
183
183
  run: ({ input }) => fetch(input.url),
184
184
  });
185
185
 
186
- // item: run returns the value; the framework wraps it in { data }
187
- const getApp = defineMethod({ name: "getApp", output: "item", run: () => app });
186
+ // item: run returns the { data } envelope itself (data and nothing else),
187
+ // symmetric with list's page shape
188
+ const getApp = defineMethod({
189
+ name: "getApp",
190
+ output: "item",
191
+ run: () => ({ data: app }),
192
+ });
188
193
  const { data } = await sdk.getApp({ app: "slack" });
189
194
 
190
195
  // list: run returns one page; the surface is a paginated iterable
package/dist/index.cjs CHANGED
@@ -2274,9 +2274,7 @@ function buildMethodEntries(descriptors, context, states) {
2274
2274
  }
2275
2275
  );
2276
2276
  } else if (out.type === "item") {
2277
- const itemCore = async (input) => ({
2278
- data: await callRun(input)
2279
- });
2277
+ const itemCore = async (input) => callRun(input);
2280
2278
  entry.value = createFunction(
2281
2279
  fold(itemCore),
2282
2280
  {