verify: serverWidget typings vs Oracle pages (addButton, addSecretKeyField, DATETIME)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- testing
Research direction
The issue names src/rules/requireServerWidgetOptions.ts, src/rules/noUnsupportedServerWidgetFieldType.ts, and docs/rule-priority.md. First, deploy the supplied Suitelet in a NetSuite account and run the additional createList probe; record the account version and outputs in an issue comment. Then use that runtime evidence to update the rule comments and priority guidance; done means the results and resulting guidance are documented, with any upstream typings issue opened only if the evidence confirms a mismatch.
Written by the indexing model from the issue text.
Description
Run it with
verify:run. Write a probe inverification/probes/, thennpm run verify:doctorandnpm run verify:run -- <slug> --draft(docs/verification/README.md,automation.md). The snippets below are the test recipes; paste output by hand only for what a probe cannot run (the runner is a RESTlet, so Suitelets,N/uiand client scripts need the user). These snippets useN/ui/serverWidget, which is not available in a RESTlet, so this one cannot run through the runner yet and stays with the user.
Question
For N/ui/serverWidget, Oracle's method pages and the type definitions disagree, and the repo follows the type definitions without runtime confirmation:
requireServerWidgetOptions: the pages makeaddButton'sidandaddSecretKeyField'srestrictToScriptIdsrequired, the type definitions make them optional. The rule follows the type definitions.noUnsupportedServerWidgetFieldType: Oracle says "The DATETIME field type is not supported with addField methods, you must specify DATETIMETZ", but the type definitions have noDATETIMEmember inserverWidget.FieldType.
What to do
Deploy this Suitelet and paste its output (or the error message if it fails to run) as a comment, with the account version.
/**
* @NApiVersion 2.1
* @NScriptType Suitelet
*/
define(['N/ui/serverWidget'], (ui) => ({
onRequest({ response }) {
const r = {};
const t = (k, f) => { try { r[k] = f(); } catch (e) { r[k] = 'THROWS: ' + e.name + ': ' + e.message; } };
const form = ui.createForm({ title: 'probe' });
t('addButton with id', () => !!form.addButton({ id: 'custpage_b1', label: 'B1', functionName: 'f' }));
t('addButton without id', () => !!form.addButton({ label: 'B2', functionName: 'f' }));
t('addSecretKeyField with restrictToScriptIds', () => !!form.addSecretKeyField({ id: 'custpage_s1', label: 'S1', restrictToScriptIds: ['customscript_probe'] }));
t('addSecretKeyField without restrictToScriptIds', () => !!form.addSecretKeyField({ id: 'custpage_s2', label: 'S2' }));
t('typeof FieldType.DATETIME', () => typeof ui.FieldType.DATETIME);
t("addField 'datetime'", () => !!form.addField({ id: 'custpage_d1', label: 'D1', type: 'datetime' }));
t('addField FieldType.DATETIMETZ', () => !!form.addField({ id: 'custpage_d2', label: 'D2', type: ui.FieldType.DATETIMETZ }));
t('List.addColumn CHECKBOX', () => !!form.addSublist({ id: 'custpage_l1', label: 'L', type: ui.SublistType.LIST }).addField({ id: 'custpage_c1', label: 'C', type: ui.FieldType.CHECKBOX }));
response.write(JSON.stringify(r, null, 1));
},
}));
The last line tests a Sublist.addField with a checkbox, which is allowed. To test the List.addColumn restriction ("CHECKBOX, DATETIME, DATETIMETZ, FILE, HELP, INLINEHTML, LABEL, MULTISELECT, SELECT and RADIO are not supported"), also create a list with ui.createList({ title: 'x' }) and call addColumn({ id, label, type: ui.FieldType.CHECKBOX }); paste what happens.
Then
- Update the rule comments in
src/rules/requireServerWidgetOptions.tsandsrc/rules/noUnsupportedServerWidgetFieldType.tswith the result. - If the pages are right and the type definitions are wrong, runtime evidence outranks both (once the runtime-verification tier lands), so follow the pages. Open an upstream issue with the type definitions project only after the result is confirmed.
Where
src/rules/requireServerWidgetOptions.ts,src/rules/noUnsupportedServerWidgetFieldType.tsdocs/rule-priority.md(conflicts between the type definitions and Oracle's documentation)
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 0
- Avg merge
- 2h 8m
- Merged PRs (30d)
- 64
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from nemchik/biome-plugin-suitescript
-
ready-for-agent
Difficulty 1/5 1-3 hours Newbie friendliness 72/100
nemchik/biome-plugin-suitescript#137 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
nemchik/biome-plugin-suitescript#87 ·
Maintainers usually reply within 1 day
-
enhancement ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
nemchik/biome-plugin-suitescript#48 ·
Maintainers usually reply within 1 day
-
ready-for-agent
Difficulty 3/5 Half a day Newbie friendliness 45/100
nemchik/biome-plugin-suitescript#138 ·
Maintainers usually reply within 1 day
-
ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
nemchik/biome-plugin-suitescript#136 ·
Maintainers usually reply within 1 day
All issues in nemchik/biome-plugin-suitescript
Similar issues
-
parse: child keys like `007`, `1e3`, `0x1f`, `-1` make the parent an empty array and hide the valueOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement follow-up
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
bketelsen/pi-pocket-team#232 ·
Maintainers usually reply within 1 day
-
bug UI
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
wardian-app/Wardian#1746 ·
Maintainers usually reply within 1 day
-
area: interop area: sip-core v3
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
fonoster/routr#705 · 1 comment ·
Maintainers usually reply within 1 day