Skip to content

Commit 079d0ef

Browse files
caoxing9claude
andcommitted
fix(zapier): drop hard-coded field names from static samples (T004)
Field values were spread to the top level and baked into each sample as `Name`/`Status`. Real runs spread the user's *actual* field names instead, so those keys never appear live — failing Zapier's T004 check that a static sample be a subset of the live result's keys. Keep only stable system keys and an empty `fields` object across all record triggers/creates/searches. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent d2924e1 commit 079d0ef

7 files changed

Lines changed: 23 additions & 19 deletions

File tree

packages/zapier/src/creates/create_or_update_record.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,9 @@ export default {
148148
sample: {
149149
id: 'recXXXXXXXXXXXX',
150150
createdTime: '2026-01-01T00:00:00.000Z',
151-
fields: { Name: 'Acme', Status: 'open' },
152-
Name: 'Acme',
153-
Status: 'open',
151+
// Field names are dynamic per table — don't hard-code them, or the static
152+
// sample fails Zapier's T004 subset check against a real run's keys.
153+
fields: {},
154154
},
155155
},
156156
};

packages/zapier/src/creates/create_record.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ export default {
6666
sample: {
6767
id: 'recXXXXXXXXXXXX',
6868
createdTime: '2026-01-01T00:00:00.000Z',
69-
fields: { Name: 'Acme', Status: 'open' },
70-
Name: 'Acme',
71-
Status: 'open',
69+
// Field names are dynamic per table — don't hard-code them, or the static
70+
// sample fails Zapier's T004 subset check against a real run's keys.
71+
fields: {},
7272
},
7373
},
7474
};

packages/zapier/src/creates/update_record.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ export default {
7171
sample: {
7272
id: 'recXXXXXXXXXXXX',
7373
lastModifiedTime: '2026-01-01T00:00:00.000Z',
74-
fields: { Name: 'Acme', Status: 'paid' },
75-
Name: 'Acme',
76-
Status: 'paid',
74+
// Field names are dynamic per table — don't hard-code them, or the static
75+
// sample fails Zapier's T004 subset check against a real run's keys.
76+
fields: {},
7777
},
7878
},
7979
};

packages/zapier/src/searches/find_record.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ export default {
5757
perform,
5858
sample: {
5959
id: 'recXXXXXXXXXXXX',
60-
fields: { Name: 'Acme' },
61-
Name: 'Acme',
60+
// Field names are dynamic per table — don't hard-code them, or the static
61+
// sample fails Zapier's T004 subset check against a real run's keys.
62+
fields: {},
6263
},
6364
},
6465
};

packages/zapier/src/searches/get_record.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ export default {
6161
sample: {
6262
id: 'recXXXXXXXXXXXX',
6363
lastModifiedTime: '2026-01-01T00:00:00.000Z',
64-
fields: { Name: 'Acme' },
65-
Name: 'Acme',
64+
// Field names are dynamic per table — don't hard-code them, or the static
65+
// sample fails Zapier's T004 subset check against a real run's keys.
66+
fields: {},
6667
},
6768
},
6869
};

packages/zapier/src/triggers/new_or_updated_record.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,16 @@ export default {
6060
},
6161
],
6262
perform,
63+
// Only stable system keys here. Field names are dynamic (they differ per
64+
// table/user and get spread to the top level by flatten()), so we must NOT
65+
// hard-code field names like Name/Status — they won't appear in a live run,
66+
// which fails Zapier's T004 "static sample is a subset of live keys" check.
6367
sample: {
6468
id: 'recXXXXXXXXXXXX@2026-01-01T00:00:00.000Z',
6569
recordId: 'recXXXXXXXXXXXX',
6670
createdTime: '2026-01-01T00:00:00.000Z',
6771
lastModifiedTime: '2026-01-01T00:00:00.000Z',
68-
fields: { Name: 'Acme', Status: 'paid' },
69-
Name: 'Acme',
70-
Status: 'paid',
72+
fields: {},
7173
},
7274
},
7375
};

packages/zapier/src/triggers/new_record.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ export default {
5454
id: 'recXXXXXXXXXXXX',
5555
createdTime: '2026-01-01T00:00:00.000Z',
5656
lastModifiedTime: '2026-01-01T00:00:00.000Z',
57-
fields: { Name: 'Acme', Status: 'open' },
58-
Name: 'Acme',
59-
Status: 'open',
57+
// Field names are dynamic per table — don't hard-code them, or the static
58+
// sample fails Zapier's T004 subset check against a real run's keys.
59+
fields: {},
6060
},
6161
},
6262
};

0 commit comments

Comments
 (0)