@zapier/kitcore 0.12.0 → 0.13.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,13 @@
1
1
  # @zapier/kitcore
2
2
 
3
+ ## 0.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bc7405e: `@zapier/kitcore`: added `NegatableMetadata` and a `getNegatable` reader for marking optional boolean schema fields where omission is distinct from false (omitting means "use the server default" or "keep the current value"). Tooling built on kitcore can read the marker to offer an explicit disable affordance — for example, the CLI generates a `--disabled` flag from it.
8
+
9
+ `@zapier/zapier-sdk`: the `publishWorkflowVersion` and `publishWorkflowDraft` `enabled` parameter descriptions now state what omitting the parameter does (uses the server default / preserves the current state) without naming CLI-specific flags. `NegatableMetadata` and `getNegatable` are re-exported from `@zapier/kitcore` for schema-metadata consumers.
10
+
3
11
  ## 0.12.0
4
12
 
5
13
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -73,6 +73,7 @@ __export(index_exports, {
73
73
  getCurrentDepth: () => getCurrentDepth,
74
74
  getCurrentScope: () => getCurrentScope,
75
75
  getFieldDescriptions: () => getFieldDescriptions,
76
+ getNegatable: () => getNegatable,
76
77
  getOutputSchema: () => getOutputSchema,
77
78
  getRegistryPlugin: () => getRegistryPlugin,
78
79
  getSchemaDescription: () => getSchemaDescription,
@@ -180,6 +181,15 @@ function isPositional(schema) {
180
181
  }
181
182
  return false;
182
183
  }
184
+ function getNegatable(schema) {
185
+ const negatable = schema.meta?.()?.negatable;
186
+ if (negatable === true) return true;
187
+ if (typeof negatable === "string" && negatable.length > 0) return negatable;
188
+ if (schema instanceof import_zod.z.ZodOptional || schema instanceof import_zod.z.ZodDefault) {
189
+ return getNegatable(schema._zod.def.innerType);
190
+ }
191
+ return void 0;
192
+ }
183
193
  function openEnum(values, description) {
184
194
  return import_zod.z.union([import_zod.z.enum(values), import_zod.z.string()]).describe(description);
185
195
  }
@@ -4530,6 +4540,7 @@ function createCorePlugin(options) {
4530
4540
  getCurrentDepth,
4531
4541
  getCurrentScope,
4532
4542
  getFieldDescriptions,
4543
+ getNegatable,
4533
4544
  getOutputSchema,
4534
4545
  getRegistryPlugin,
4535
4546
  getSchemaDescription,