@enfocussw/switch-scripting-context 25.11.0-beta.14 → 25.11.0-beta.16
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 +39 -0
- package/README.md +28 -22
- package/dist/init.d.ts +1 -1
- package/dist/init.js +18 -7
- package/docs/switch-api/{api-connection.md → connection.md} +18 -3
- package/docs/switch-api/{api-document-classes.md → document-classes.md} +10 -1
- package/docs/switch-api/{api-entry-points.md → entry-points.md} +14 -5
- package/docs/switch-api/{api-enums.md → enums.md} +12 -1
- package/docs/switch-api/{api-execution-environment.md → execution-environment.md} +16 -7
- package/docs/switch-api/{api-flow-element.md → flow-element.md} +13 -4
- package/docs/switch-api/{api-http.md → http.md} +9 -0
- package/docs/switch-api/{api-job-patterns.md → job-patterns.md} +23 -8
- package/docs/switch-api/{api-job.md → job.md} +13 -4
- package/docs/switch-api/{api-logging.md → logging.md} +15 -6
- package/docs/switch-api/{api-switch.md → switch.md} +10 -1
- package/docs/{switch-api/api-app-guidelines.md → switch-appstore/app-guidelines.md} +50 -33
- package/docs/switch-appstore/app-manual.md +84 -0
- package/docs/switch-appstore/app-store-listing.md +69 -0
- package/docs/switch-appstore/app-store-submission.md +83 -0
- package/docs/{switch-api/api-debugging.md → switch-project/debugging.md} +9 -0
- package/docs/{switch-api/api-logs-and-dataroot.md → switch-project/logs-and-dataroot.md} +10 -1
- package/docs/{switch-api/api-project-planning.md → switch-project/project-planning.md} +22 -13
- package/docs/switch-project/property-documentation.md +75 -0
- package/docs/{switch-api/api-property-editors.md → switch-project/property-editors.md} +19 -10
- package/docs/{switch-api/api-script-declaration.md → switch-project/script-declaration.md} +18 -9
- package/docs/{switch-api/api-script-structure.md → switch-project/script-structure.md} +14 -5
- package/docs/{switch-api/api-tooling.md → switch-project/tooling.md} +10 -1
- package/docs/{switch-api/api-vscode.md → switch-project/vscode.md} +9 -0
- package/docs/switch-scripting.md +35 -27
- package/package.json +4 -3
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: logging
|
|
3
|
+
category: switch-api
|
|
4
|
+
order: 18
|
|
5
|
+
summary: "Log level semantics, logging practice, `console.log` limitation, common gotchas"
|
|
6
|
+
triggers:
|
|
7
|
+
- "Adding or reviewing `job.log()`/`flowElement.log()`/`job.fail()`/`failProcess()` calls"
|
|
8
|
+
---
|
|
9
|
+
|
|
1
10
|
# Logging Practices
|
|
2
11
|
|
|
3
12
|
Guidance for using `job.log()`, `flowElement.log()`, `job.fail()`, and `flowElement.failProcess()`
|
|
4
|
-
— see [
|
|
5
|
-
[
|
|
6
|
-
listed in [
|
|
13
|
+
— see [job.md](job.md#failure--logging) and
|
|
14
|
+
[flow-element.md](flow-element.md#logging) for their signatures. `LogLevel` values are
|
|
15
|
+
listed in [enums.md](enums.md). Each log call has a small performance overhead, so where
|
|
7
16
|
and how often to log is a deliberate choice, not a default.
|
|
8
17
|
|
|
9
18
|
## Log levels
|
|
@@ -13,7 +22,7 @@ and how often to log is a deliberate choice, not a default.
|
|
|
13
22
|
| `Error` | The job/step failed or produced a wrong/unusable result. Often accompanies or precedes a hard stop, but can stand alone if the job continues in a degraded way. |
|
|
14
23
|
| `Warning` | Something unexpected happened but processing continued successfully (a fallback was used, an optional resource was missing). |
|
|
15
24
|
| `Info` | Normal, expected checkpoints worth surfacing to a flow operator without them needing debug mode (e.g. "processed 40 records", "output written to X"). |
|
|
16
|
-
| `Debug` | Verbose detail for diagnosing execution. Many users leave debug logging enabled in production to self-diagnose issues and to help app developers and Enfocus Support — leave meaningful checkpoints in, but trim noisy or no-longer-useful debug logs before shipping. **`Debug` messages only reach the log database if the Switch preference "Log debug messages" is turned on** (off by default) — see [
|
|
25
|
+
| `Debug` | Verbose detail for diagnosing execution. Many users leave debug logging enabled in production to self-diagnose issues and to help app developers and Enfocus Support — leave meaningful checkpoints in, but trim noisy or no-longer-useful debug logs before shipping. **`Debug` messages only reach the log database if the Switch preference "Log debug messages" is turned on** (off by default) — see [logs-and-dataroot.md](../switch-project/logs-and-dataroot.md#retention-and-the-debug-level-gate). |
|
|
17
26
|
|
|
18
27
|
## Logging in loops
|
|
19
28
|
|
|
@@ -24,7 +33,7 @@ one call per iteration, e.g. `"Found 12 matching jobs"` instead of one log line
|
|
|
24
33
|
## `console.log` does not work
|
|
25
34
|
|
|
26
35
|
`console.log` only produces output when a debug session is attached (see
|
|
27
|
-
[
|
|
36
|
+
[debugging.md](../switch-project/debugging.md)); in a normal run it is not visible anywhere. Never rely on it
|
|
28
37
|
in production scripts — use `job.log()`/`flowElement.log()` for anything that should be visible in
|
|
29
38
|
the log/message pane.
|
|
30
39
|
|
|
@@ -75,7 +84,7 @@ job.log(LogLevel.Info, 'Processed file %1 in %2s', [fileName, seconds]);
|
|
|
75
84
|
looks unfinished and undermines trust.
|
|
76
85
|
- Log an `Error` when a custom `validateProperties`/`validateConnectionProperties` check returns
|
|
77
86
|
`valid: false` for a tag, and when `getLibraryForProperty`/`getLibraryForConnectionProperty` would
|
|
78
|
-
otherwise return an empty list — see [
|
|
87
|
+
otherwise return an empty list — see [entry-points.md § Property UI callbacks](entry-points.md#property-ui-callbacks).
|
|
79
88
|
Silently returning `false`/`[]` with no log line leaves the user without any explanation.
|
|
80
89
|
|
|
81
90
|
## Log volume
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: switch
|
|
3
|
+
category: switch-api
|
|
4
|
+
order: 3
|
|
5
|
+
summary: "`Switch` (`s`): global data, webhooks, abort, server utilities"
|
|
6
|
+
triggers:
|
|
7
|
+
- "Using global data, webhooks, abort, or server settings"
|
|
8
|
+
---
|
|
9
|
+
|
|
1
10
|
# Switch Class
|
|
2
11
|
|
|
3
12
|
The `Switch` instance `s` is passed to every entry point. It provides global data storage, webhook subscription, abort handling, and server utilities.
|
|
@@ -120,5 +129,5 @@ const mode = readOnly ? Switch.tr('Read-only') : Switch.tr('Regular');
|
|
|
120
129
|
await job.log(LogLevel.Info, Switch.tr('Job ID = %1, Mode = %2'), [job.getId(), mode]);
|
|
121
130
|
```
|
|
122
131
|
|
|
123
|
-
See [
|
|
132
|
+
See [logging.md § Placeholders instead of concatenation](logging.md#placeholders-instead-of-concatenation)
|
|
124
133
|
for the same rule stated from the logging side.
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: app-guidelines
|
|
3
|
+
category: switch-appstore
|
|
4
|
+
order: 20
|
|
5
|
+
summary: "Pre-publish checklist for Appstore apps: property naming/tooltips/editors, entry point and sendTo consistency, logging quality, packaging, and the app-only submission rules (localization, signed universal macOS binaries)"
|
|
6
|
+
triggers:
|
|
7
|
+
- "Preparing a script for publication as an app, or reviewing one against Appstore submission criteria"
|
|
8
|
+
---
|
|
9
|
+
|
|
1
10
|
# App Publishing Guidelines
|
|
2
11
|
|
|
3
12
|
A pre-publish checklist for a script intended for the Enfocus Appstore (`ScriptPackageType="App"`
|
|
4
|
-
— see [
|
|
13
|
+
— see [script-structure.md § Script vs App](../switch-project/script-structure.md#script-vs-app)). Each item
|
|
5
14
|
here is enforced in more detail at the linked section — this page exists to be read top-to-bottom
|
|
6
15
|
right before submission, not as the primary source for any individual rule. The one exception is
|
|
7
16
|
[App-only](#app-only) at the bottom, which is documented in full here.
|
|
@@ -20,48 +29,49 @@ Items fall into three tiers, marked on each one:
|
|
|
20
29
|
|
|
21
30
|
- [ ] **Apps required / scripts recommended.** Every property name (`LocalizedTagName`) is 30
|
|
22
31
|
characters or fewer and uses sentence-style capitalization ("Customer name", not "Customer
|
|
23
|
-
Name") — see [
|
|
32
|
+
Name") — see [script-declaration.md](../switch-project/script-declaration.md#custom-property-elements-elementfields).
|
|
24
33
|
- [ ] **Apps required / scripts recommended.** Every property has a `Tooltip`, unless it's fully
|
|
25
34
|
self-explanatory with no extra constraints (e.g. "Number of copies" with no min/max) — see
|
|
26
|
-
[
|
|
35
|
+
[script-declaration.md](../switch-project/script-declaration.md#custom-property-elements-elementfields) for
|
|
36
|
+
the attribute and [property-documentation.md](../switch-project/property-documentation.md) for what to write in it.
|
|
27
37
|
- [ ] **Universal.** Dynamic editors (`sltextwithvar`/`mltextwithvar`, `conditionwithvar`,
|
|
28
38
|
`scriptexp`) are enabled wherever the value could plausibly vary per job, and omitted where the
|
|
29
39
|
value is inherently static (e.g. a dataset name) — see
|
|
30
|
-
[
|
|
40
|
+
[property-editors.md § Common practices](../switch-project/property-editors.md#common-practices).
|
|
31
41
|
- [ ] **Universal.** Keyword-style default values ("Default", "None", "Automatic", …) use the
|
|
32
42
|
matching literal editor (`default`, `none`, `automatic`, …), not a typed string default — see
|
|
33
|
-
[
|
|
43
|
+
[property-editors.md § Literal editors](../switch-project/property-editors.md#literal-editors).
|
|
34
44
|
- [ ] **Universal.** Every property using `askplugin`/`askplugin2` ("Select from library"/"Select
|
|
35
45
|
many from library") has a matching `getLibraryForProperty`/`getLibraryForConnectionProperty`
|
|
36
|
-
entry point — see [
|
|
46
|
+
entry point — see [entry-points.md § Property UI callbacks](../switch-api/entry-points.md#property-ui-callbacks).
|
|
37
47
|
- [ ] **Apps required / scripts recommended.** Every property's editor chain includes at least one
|
|
38
48
|
editor that doesn't require an add-on Switch module — e.g. never offer `scriptexp` (Scripting
|
|
39
49
|
Module) as the only editor — see
|
|
40
|
-
[
|
|
50
|
+
[property-editors.md § Common practices](../switch-project/property-editors.md#common-practices).
|
|
41
51
|
- [ ] **Universal.** Every property using the `external`/`external2`/… editor has either a
|
|
42
52
|
non-empty dependent `Application` property or a `findExternalEditorPath` entry point — see
|
|
43
|
-
[
|
|
53
|
+
[property-editors.md § Notes](../switch-project/property-editors.md#notes).
|
|
44
54
|
- [ ] **Apps required / scripts recommended.** Every property has a default value unless one
|
|
45
55
|
genuinely isn't possible, in which case the `Tooltip` gives an example value instead — see
|
|
46
|
-
[
|
|
56
|
+
[script-declaration.md](../switch-project/script-declaration.md#custom-property-elements-elementfields).
|
|
47
57
|
- [ ] **Universal.** Every property/connection field declaring `Validation="Custom"` or `"Standard
|
|
48
58
|
and custom"` has a matching `validateProperties`/`validateConnectionProperties` entry point —
|
|
49
|
-
see [
|
|
59
|
+
see [entry-points.md § Property UI callbacks](../switch-api/entry-points.md#property-ui-callbacks).
|
|
50
60
|
|
|
51
61
|
## Entry points
|
|
52
62
|
|
|
53
63
|
- [ ] **Universal.** `jobArrived` is present when `IncomingConnections="Yes"`; `timerFired` is
|
|
54
64
|
present when `IncomingConnections="No"` (and may additionally be present alongside `jobArrived`)
|
|
55
|
-
— see [
|
|
65
|
+
— see [entry-points.md § Job processing](../switch-api/entry-points.md#job-processing).
|
|
56
66
|
- [ ] **Universal.** No empty `jobArrived` or `timerFired` — an entry point that does nothing is
|
|
57
67
|
removed entirely, not left in place — see
|
|
58
|
-
[
|
|
68
|
+
[entry-points.md § Job processing](../switch-api/entry-points.md#job-processing).
|
|
59
69
|
|
|
60
70
|
## Sending jobs
|
|
61
71
|
|
|
62
72
|
All **universal** — see
|
|
63
|
-
[
|
|
64
|
-
[
|
|
73
|
+
[job-patterns.md § Sending jobs](../switch-api/job-patterns.md#sending-jobs) and
|
|
74
|
+
[script-declaration.md § ConnectionFields](../switch-project/script-declaration.md#connectionfields) for full
|
|
65
75
|
detail.
|
|
66
76
|
|
|
67
77
|
- [ ] If `OutgoingConnections` is not `No`, some `sendTo*()` method is called at least once for
|
|
@@ -83,27 +93,27 @@ detail.
|
|
|
83
93
|
- [ ] **Universal.** An `Error` is logged when a custom
|
|
84
94
|
`validateProperties`/`validateConnectionProperties` check returns `valid: false` for a tag, and
|
|
85
95
|
when `getLibraryForProperty`/`getLibraryForConnectionProperty` would otherwise return an empty
|
|
86
|
-
list — see [
|
|
96
|
+
list — see [logging.md § Message quality](../switch-api/logging.md#message-quality).
|
|
87
97
|
- [ ] **Universal.** Log messages are free of grammatical errors and typos — see
|
|
88
|
-
[
|
|
98
|
+
[logging.md § Message quality](../switch-api/logging.md#message-quality).
|
|
89
99
|
- [ ] **Universal.** Log messages use `%1`/`%2`/… placeholders with `messageParams`, not string
|
|
90
100
|
concatenation or interpolation of dynamic values — required for correct translation. See
|
|
91
|
-
[
|
|
101
|
+
[logging.md § Placeholders instead of concatenation](../switch-api/logging.md#placeholders-instead-of-concatenation),
|
|
92
102
|
which also covers the separate, narrower literal-`%` escaping gotcha.
|
|
93
103
|
- [ ] **Apps required / scripts recommended.** Logging isn't excessive — no `Info`/`Debug` calls
|
|
94
104
|
that don't help a flow operator or support engineer understand what happened — see
|
|
95
|
-
[
|
|
105
|
+
[logging.md § Log volume](../switch-api/logging.md#log-volume).
|
|
96
106
|
|
|
97
107
|
## Temp files and paths
|
|
98
108
|
|
|
99
109
|
- [ ] **Universal.** All temporary files and folders are removed by the script before it finishes,
|
|
100
110
|
rather than relying on Switch's executor-refresh cleanup — see
|
|
101
|
-
[
|
|
111
|
+
[job-patterns.md § Temp file cleanup](../switch-api/job-patterns.md#temp-file-cleanup).
|
|
102
112
|
- [ ] **Universal.** No Oracle JRE is embedded as an extra file, in a script or an app — see
|
|
103
|
-
[
|
|
113
|
+
[script-structure.md § Script folder files](../switch-project/script-structure.md#script-folder-files).
|
|
104
114
|
- [ ] **Apps required / scripts recommended.** File system path strings are built with Node's
|
|
105
115
|
`path` module, not hardcoded separators or string concatenation — see
|
|
106
|
-
[
|
|
116
|
+
[job-patterns.md § Platform-independent paths](../switch-api/job-patterns.md#platform-independent-paths).
|
|
107
117
|
|
|
108
118
|
---
|
|
109
119
|
|
|
@@ -141,7 +151,7 @@ Unlike the sections above, these are documented in full here rather than deferri
|
|
|
141
151
|
- [ ] **`ExecutionMode="Concurrent"` wherever the script allows it.** `Serialized` is the default
|
|
142
152
|
and the slower choice; concurrent is preferred for throughput. If you go concurrent, the script
|
|
143
153
|
must synchronise its own access to any shared resource — see
|
|
144
|
-
[
|
|
154
|
+
[execution-environment.md § Execution modes](../switch-api/execution-environment.md#execution-modes).
|
|
145
155
|
- [ ] **`ExecutionGroup` is shared across every app that drives the same non-concurrent third-party
|
|
146
156
|
application**, so Switch can stop them using it simultaneously. If your app is in that situation,
|
|
147
157
|
ask Enfocus which group name to use rather than inventing one.
|
|
@@ -153,11 +163,16 @@ Unlike the sections above, these are documented in full here rather than deferri
|
|
|
153
163
|
what it declares — the declared subcategory only takes effect once Enfocus has signed the app, and
|
|
154
164
|
review may change it.
|
|
155
165
|
- [ ] **`DetailedInfo` is present on every property and every connection**, not just `Tooltip`.
|
|
156
|
-
Switch Designer
|
|
157
|
-
produces a blank entry
|
|
166
|
+
Switch Designer can export a *flow's* HTML documentation from every element in it, so an empty
|
|
167
|
+
`DetailedInfo` produces a blank entry there if a flow builder ever generates one — see
|
|
168
|
+
[property-documentation.md](../switch-project/property-documentation.md) for what to write in it, and when
|
|
169
|
+
it's fine to leave blank.
|
|
158
170
|
- [ ] **`Description`, `Compatibility`, `SupportInfo` and `AppDiscovery` are filled in.** These are
|
|
159
171
|
required to create the `.enfpack` at all, and `SupportInfo` must point at *your* support channel,
|
|
160
|
-
never Enfocus Support.
|
|
172
|
+
never Enfocus Support — see [app-store-listing.md](app-store-listing.md) for what to write
|
|
173
|
+
in each.
|
|
174
|
+
- [ ] **The app manual document is prepared**, following Enfocus's `documentation-app_name.docx`
|
|
175
|
+
template, and uploaded during Appstore review — see [app-manual.md](app-manual.md).
|
|
161
176
|
- [ ] **The declared incoming/outgoing connection topology matches what the code actually does** —
|
|
162
177
|
see [Entry points](#entry-points) and [Sending jobs](#sending-jobs) above.
|
|
163
178
|
- [ ] **Dependent properties have real dependency conditions and values, never left empty**, and the
|
|
@@ -179,8 +194,8 @@ Unlike the sections above, these are documented in full here rather than deferri
|
|
|
179
194
|
### Localization
|
|
180
195
|
|
|
181
196
|
- [ ] **Prefer more than one language.** An app is preferably localized beyond English — see
|
|
182
|
-
[Translation files](
|
|
183
|
-
`SwitchScriptTool --generate-translations` in [
|
|
197
|
+
[Translation files](../switch-project/script-structure.md#script-folder-files) (`<LanguageCode>.ts`) and
|
|
198
|
+
`SwitchScriptTool --generate-translations` in [tooling.md](../switch-project/tooling.md).
|
|
184
199
|
- [ ] **The app's own translations are limited to the six Switch UI languages** (English, French,
|
|
185
200
|
German, Italian, Chinese, Japanese); other languages are not accepted for the app itself. The
|
|
186
201
|
separate Appstore *documentation* may be supplied in additional languages, since it isn't
|
|
@@ -190,15 +205,17 @@ Unlike the sections above, these are documented in full here rather than deferri
|
|
|
190
205
|
user-facing message needs an entry in each shipped language file, and log calls must go through
|
|
191
206
|
that mechanism rather than hardcoding English text that bypasses it. Note that
|
|
192
207
|
`Switch.tr()` extraction is static and silently skips anything that isn't a plain string literal
|
|
193
|
-
— see [
|
|
208
|
+
— see [switch.md § Translation extraction rules](../switch-api/switch.md#translation-extraction-rules).
|
|
194
209
|
Check the generated `.ts` files rather than assuming.
|
|
195
210
|
|
|
196
211
|
### Icon
|
|
197
212
|
|
|
198
213
|
- [ ] **32×32 PNG, RGB, transparent background**, attached as the app icon. This is what appears in
|
|
199
214
|
the Elements pane and in flows.
|
|
200
|
-
- [ ] **A separate 200×200
|
|
201
|
-
part of the pack.
|
|
215
|
+
- [ ] **A separate icon (at least 200×200, square) is uploaded to the Appstore submission form**
|
|
216
|
+
for the Appstore listing — it is not part of the pack. See
|
|
217
|
+
[app-store-submission.md § Icons](app-store-submission.md#icons) for both assets' exact
|
|
218
|
+
specs and how to derive/verify them from source art.
|
|
202
219
|
|
|
203
220
|
### Extra files
|
|
204
221
|
|
|
@@ -214,9 +231,9 @@ Unlike the sections above, these are documented in full here rather than deferri
|
|
|
214
231
|
validates the app package's signature, and content that changes after signing fails that
|
|
215
232
|
validation, causing Switch to remove the app. Write runtime-mutable data (temp files, caches,
|
|
216
233
|
generated output) outside the app folder — see
|
|
217
|
-
[
|
|
234
|
+
[job-patterns.md § Temp file cleanup](../switch-api/job-patterns.md#temp-file-cleanup).
|
|
218
235
|
- [ ] Find bundled files at runtime with `flowElement.getPluginResourcesPath()` — see
|
|
219
|
-
[
|
|
236
|
+
[flow-element.md](../switch-api/flow-element.md).
|
|
220
237
|
|
|
221
238
|
### Source and review hygiene
|
|
222
239
|
|
|
@@ -224,7 +241,7 @@ Unlike the sections above, these are documented in full here rather than deferri
|
|
|
224
241
|
- [ ] **No malicious or unrelated payload** — nothing that harms the user's machine or installs
|
|
225
242
|
additional software.
|
|
226
243
|
- [ ] **No Oracle JRE embedded**, in a script or an app, for licensing reasons — see
|
|
227
|
-
[
|
|
244
|
+
[script-structure.md § Script folder files](../switch-project/script-structure.md#script-folder-files).
|
|
228
245
|
- [ ] **Automating a third-party application doesn't breach that application's licence.** Some
|
|
229
246
|
vendors' terms explicitly exclude automation; check before building.
|
|
230
247
|
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: app-manual
|
|
3
|
+
category: switch-appstore
|
|
4
|
+
order: 23
|
|
5
|
+
summary: "Writing guidance for the separate app manual document uploaded during Appstore review (`documentation-app_name.docx` template)"
|
|
6
|
+
triggers:
|
|
7
|
+
- "Preparing the app manual document for Appstore submission"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Writing the App Manual
|
|
11
|
+
|
|
12
|
+
Guidance for the separate Word/PDF document an app creator uploads during Appstore review,
|
|
13
|
+
following Enfocus's `documentation-app_name.docx` template. Enfocus shows it as a downloadable
|
|
14
|
+
document on the app's Appstore detail page — distinct from the
|
|
15
|
+
[listing fields](app-store-listing.md) shown inline on the listing itself, and from
|
|
16
|
+
[Tooltip/DetailedInfo](../switch-project/property-documentation.md), seen only after installing. Follow the
|
|
17
|
+
template's section order below; don't invent your own structure.
|
|
18
|
+
|
|
19
|
+
**Delivery:** there's no declaration attribute for this content, since it isn't part of the app
|
|
20
|
+
itself. Write it to `./DOCUMENTATION.md` at the project root, using the section headers below. The
|
|
21
|
+
user copies each section into Enfocus's `documentation-app_name.docx` template and uploads the
|
|
22
|
+
result during Appstore review; tell them that's the next step once the file is written.
|
|
23
|
+
|
|
24
|
+
Same writing-quality bar as [property-documentation.md § Writing quality](../switch-project/property-documentation.md#writing-quality):
|
|
25
|
+
no restated field names, no generic marketing vocabulary, no meta-commentary about the
|
|
26
|
+
implementation, no vague filler, no copy-pasted boilerplate, nothing that won't translate cleanly.
|
|
27
|
+
|
|
28
|
+
## App name
|
|
29
|
+
|
|
30
|
+
The declaration's `DisplayName`.
|
|
31
|
+
|
|
32
|
+
## Description
|
|
33
|
+
|
|
34
|
+
Reuse [the listing's `Description`](app-store-listing.md#description) — adapt lightly if the
|
|
35
|
+
extra room here helps (e.g. a screenshot the listing field can't carry), but don't rewrite the
|
|
36
|
+
same facts from scratch.
|
|
37
|
+
|
|
38
|
+
## Compatibility
|
|
39
|
+
|
|
40
|
+
**Not the same field as the declaration's `Compatibility` attribute** — see the naming trap in
|
|
41
|
+
[app-store-listing.md § Compatibility](app-store-listing.md#compatibility). This section
|
|
42
|
+
is the minimum **Switch** version the app requires, e.g. "Switch 24.10 and higher." There's no
|
|
43
|
+
declaration attribute for it; it's implicit in which SwitchScripter version built the app (see
|
|
44
|
+
[script-structure.md § SwitchScripter and Switch version compatibility](../switch-project/script-structure.md#switchscripter-and-switch-version-compatibility)).
|
|
45
|
+
The same value also goes in the "Switch Version" field on the
|
|
46
|
+
[Appstore App Version submission form](app-store-submission.md#fields-that-reuse-content-youve-already-written)
|
|
47
|
+
— state it explicitly here rather than leaving it for the reader to infer.
|
|
48
|
+
|
|
49
|
+
## Compatibility third-party applications
|
|
50
|
+
|
|
51
|
+
Reuse [the listing's `Compatibility`](app-store-listing.md#compatibility) content — the
|
|
52
|
+
third-party application versions this app supports, with links to the vendor's download/version
|
|
53
|
+
page where one exists.
|
|
54
|
+
|
|
55
|
+
## Application discovery details
|
|
56
|
+
|
|
57
|
+
Reuse [the listing's `AppDiscovery`](app-store-listing.md#appdiscovery) content. Add a
|
|
58
|
+
screenshot here if the discovery mechanism (or the manual-path property, when auto-detection
|
|
59
|
+
fails) is easier to show than describe.
|
|
60
|
+
|
|
61
|
+
## Connections
|
|
62
|
+
|
|
63
|
+
Reuse [the listing's `Connections`](app-store-listing.md#connections) content, expanded with
|
|
64
|
+
whatever detail or screenshots the shorter listing field couldn't carry.
|
|
65
|
+
|
|
66
|
+
## Properties detailed info
|
|
67
|
+
|
|
68
|
+
Reuse each property's and connection's [`DetailedInfo`](../switch-project/property-documentation.md#detailedinfo)
|
|
69
|
+
content — but don't limit this section to whatever `DetailedInfo` happens to contain. `DetailedInfo`
|
|
70
|
+
is optional and often left blank; this manual is the far more likely surface to actually be read,
|
|
71
|
+
so write real per-property content here even for properties where `DetailedInfo` was skipped.
|
|
72
|
+
|
|
73
|
+
For an app bundle (multiple flow elements in one pack), document each flow element separately —
|
|
74
|
+
the template repeats this section per element ("Flow element 1", "Flow element 2", …).
|
|
75
|
+
|
|
76
|
+
### Flow elements properties
|
|
77
|
+
|
|
78
|
+
Per flow element, per property: what it controls, and any tip or constraint a user needs to get
|
|
79
|
+
the element working — the same content `DetailedInfo` would hold, written in full regardless of
|
|
80
|
+
whether `DetailedInfo` itself was filled in.
|
|
81
|
+
|
|
82
|
+
### Outgoing connections properties
|
|
83
|
+
|
|
84
|
+
Same treatment, for injected connection properties.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: app-store-listing
|
|
3
|
+
category: switch-appstore
|
|
4
|
+
order: 22
|
|
5
|
+
summary: "Writing guidance for the declaration's Appstore listing fields: `Description`, `Compatibility`, `SupportInfo`, `AppDiscovery`, `Connections`"
|
|
6
|
+
triggers:
|
|
7
|
+
- "Writing or reviewing the app's Appstore listing text"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Writing the Appstore Listing Fields
|
|
11
|
+
|
|
12
|
+
Guidance for the *content* of the declaration's prose fields that appear on the app's Enfocus
|
|
13
|
+
Appstore listing: `Description`, `Compatibility`, `SupportInfo`, `AppDiscovery`, and `Connections`
|
|
14
|
+
— see [script-declaration.md](../switch-project/script-declaration.md#built-in-elementfields) for the
|
|
15
|
+
attribute mechanics.
|
|
16
|
+
|
|
17
|
+
Audience here is a prospective buyer browsing the Appstore, deciding whether to install the app at
|
|
18
|
+
all — they haven't seen the flow element yet. That's different from
|
|
19
|
+
[property-documentation.md](../switch-project/property-documentation.md) (`Tooltip`/`DetailedInfo`, read only
|
|
20
|
+
after installing) and from [app-manual.md](app-manual.md) (a separate uploaded document).
|
|
21
|
+
This content is also reused directly in the app manual's Description, Compatibility third-party
|
|
22
|
+
applications, Application discovery details, and Connections sections — write it once, here, well.
|
|
23
|
+
|
|
24
|
+
**Delivery:** write this content directly into the matching top-level attributes in
|
|
25
|
+
`<ScriptID>.xml` (`Description`, `Compatibility`, `SupportInfo`, `AppDiscovery`, `Connections`) —
|
|
26
|
+
there is no separate file. See
|
|
27
|
+
[script-declaration.md § Agent editing policy](../switch-project/script-declaration.md#agent-editing-policy)
|
|
28
|
+
for how to edit the declaration safely.
|
|
29
|
+
|
|
30
|
+
Same writing-quality bar as [property-documentation.md § Writing quality](../switch-project/property-documentation.md#writing-quality):
|
|
31
|
+
no restated field names, no generic marketing vocabulary, no meta-commentary about the
|
|
32
|
+
implementation, no vague filler, no copy-pasted boilerplate, nothing that won't translate cleanly.
|
|
33
|
+
|
|
34
|
+
## `Description`
|
|
35
|
+
|
|
36
|
+
What the app does, who it's for, and the third-party application or service it automates. Lead
|
|
37
|
+
with the concrete task the app performs, not a category label — "Converts incoming PDFs to the
|
|
38
|
+
customer's house color profile using ColorLogic" tells a buyer more than "A color management
|
|
39
|
+
app." A screenshot is worth adding here if it clarifies the app's purpose faster than prose would.
|
|
40
|
+
|
|
41
|
+
## `Compatibility`
|
|
42
|
+
|
|
43
|
+
**Naming trap:** despite the name, this is **third-party application** compatibility, not Switch
|
|
44
|
+
version compatibility — Switch has no declaration field for the minimum Switch version an app
|
|
45
|
+
requires (see [app-manual.md § Compatibility](app-manual.md#compatibility) for where that
|
|
46
|
+
goes instead). State which versions of the automated third-party application are supported, e.g.
|
|
47
|
+
"Requires Acrobat Pro DC 2023 or later." Link to the third-party vendor's own download or version
|
|
48
|
+
page if one exists.
|
|
49
|
+
|
|
50
|
+
## `SupportInfo`
|
|
51
|
+
|
|
52
|
+
The app creator's own support channel (email or URL) — **never Enfocus Support**, this is
|
|
53
|
+
mandatory per [app-guidelines.md § App-only](app-guidelines.md#top-level-declaration-properties).
|
|
54
|
+
State the channel plainly; this field has no dedicated section in the app manual, so it's the only
|
|
55
|
+
place this information reliably reaches a buyer before they install.
|
|
56
|
+
|
|
57
|
+
## `AppDiscovery`
|
|
58
|
+
|
|
59
|
+
How the app locates the third-party application on disk. State the actual mechanism, concretely
|
|
60
|
+
enough that a user who hits a failure knows what to check: which known install paths are searched
|
|
61
|
+
first, and — if auto-detection can fail — which property lets the user point at the install
|
|
62
|
+
location manually.
|
|
63
|
+
|
|
64
|
+
## `Connections`
|
|
65
|
+
|
|
66
|
+
A prose overview of the flow element's incoming and outgoing connections: what triggers the
|
|
67
|
+
element, what each outgoing connection carries, and when a job is routed to which one. This is the
|
|
68
|
+
topology summary a flow builder reads before wiring the element into a flow, so describe behavior
|
|
69
|
+
("routes to Error when validation fails"), not just connection names.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: app-store-submission
|
|
3
|
+
category: switch-appstore
|
|
4
|
+
order: 24
|
|
5
|
+
summary: "Writing guidance for the Create Appstore App / Create Appstore App Version web forms: Short Description, What's new, Eula, icon specs, and which fields reuse content already written elsewhere"
|
|
6
|
+
triggers:
|
|
7
|
+
- "Preparing content for the Appstore website submission forms"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Writing the Appstore Submission Forms
|
|
11
|
+
|
|
12
|
+
Guidance for the two web forms on the Enfocus Appstore site: **Create Appstore App** (once per
|
|
13
|
+
app) and **Create Appstore App Version** (once per release). These are separate from the
|
|
14
|
+
[listing fields](app-store-listing.md) in the declaration and from the
|
|
15
|
+
[app manual](app-manual.md) — a human fills these forms in directly on the Enfocus website, so
|
|
16
|
+
the agent's job is to prepare the content, not submit it. `Package Password`, `Binary`, and
|
|
17
|
+
`Signed Binary` are manual/security-sensitive steps on the App Version form; leave those to the
|
|
18
|
+
user entirely.
|
|
19
|
+
|
|
20
|
+
**Delivery:** write the content below to `./README.md` at the project root, labeled by field name,
|
|
21
|
+
for the user to copy into the two forms. If the project already has a `README.md` for other
|
|
22
|
+
purposes, add a clearly separated section rather than overwriting it.
|
|
23
|
+
|
|
24
|
+
Same writing-quality bar as [property-documentation.md § Writing quality](../switch-project/property-documentation.md#writing-quality).
|
|
25
|
+
|
|
26
|
+
## Fields that reuse content you've already written
|
|
27
|
+
|
|
28
|
+
Point the user at the source instead of rewriting these:
|
|
29
|
+
|
|
30
|
+
| Form field | Source |
|
|
31
|
+
|---|---|
|
|
32
|
+
| Display Name | Declaration `DisplayName` |
|
|
33
|
+
| Internal Identifier | Declaration `Name` |
|
|
34
|
+
| Long Description | [Listing `Description`](app-store-listing.md#description) |
|
|
35
|
+
| Keywords | Declaration `Keywords` — the form must match it exactly, it's checked against the script source |
|
|
36
|
+
| Categories | Declaration `PositionInElementPane`/`SubcategoryInElementPane` — see [app-guidelines.md](app-guidelines.md#top-level-declaration-properties) |
|
|
37
|
+
| Support Website / Support Phone / Support Email | [Listing `SupportInfo`](app-store-listing.md#supportinfo), split across the three fields the form actually has |
|
|
38
|
+
| Third-party Compatibility | [Listing `Compatibility`](app-store-listing.md#compatibility) |
|
|
39
|
+
| Switch Version | The minimum Switch version, same content as [the app manual's Compatibility section](app-manual.md#compatibility) |
|
|
40
|
+
|
|
41
|
+
## New content
|
|
42
|
+
|
|
43
|
+
Nothing above covers these — the form is the only place they're written.
|
|
44
|
+
|
|
45
|
+
### Short Description
|
|
46
|
+
|
|
47
|
+
Max 500 characters. Distinct from Long Description: this is the search-result and marketing-email
|
|
48
|
+
summary, not a shorter copy of the full description. One or two sentences stating what the app
|
|
49
|
+
does and the third-party dependency, without repeating Display Name.
|
|
50
|
+
|
|
51
|
+
### What's new
|
|
52
|
+
|
|
53
|
+
Per-version release notes: what changed in *this* version, for someone deciding whether to update.
|
|
54
|
+
Lead with the effect on the user (new capability, fixed behavior), not the implementation. Skip
|
|
55
|
+
internal refactors with no user-visible effect.
|
|
56
|
+
|
|
57
|
+
### Eula
|
|
58
|
+
|
|
59
|
+
**Don't draft this from scratch.** A EULA is a binding legal document — write it only from the app
|
|
60
|
+
creator's existing legal-reviewed template, or leave it for them to supply. If neither exists, tell
|
|
61
|
+
the user this needs their own legal review rather than generating terms.
|
|
62
|
+
|
|
63
|
+
## Icons
|
|
64
|
+
|
|
65
|
+
Two separate image assets, both uploaded on the Create Appstore App form:
|
|
66
|
+
|
|
67
|
+
| Field | Spec | Notes |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| Switch Icon | 32×32 px recommended (larger is resized down); PNG/GIF/JPG | Must match the `Icon` property already in the script source — use the same file you packaged with the app, don't create a second one |
|
|
70
|
+
| Appstore Icon | At least 200×200 px, square (a non-square image gets transparent padding added); PNG/GIF/JPG, under 100 MB | Used across the whole Appstore site: overview, detail page, search results |
|
|
71
|
+
|
|
72
|
+
Creating the actual artwork is a design task, not something to improvise without source material —
|
|
73
|
+
if the app creator hasn't supplied a logo or icon source image, say so rather than generating
|
|
74
|
+
placeholder art. Given a source image, verify and derive the two required files with a CLI image
|
|
75
|
+
tool (`sips` on macOS, or ImageMagick):
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
# Verify dimensions and that the file is actually PNG
|
|
79
|
+
sips -g pixelWidth -g pixelHeight -g format icon-source.png
|
|
80
|
+
|
|
81
|
+
# Resize down to the 32x32 Switch icon (never upscale a smaller source)
|
|
82
|
+
sips -z 32 32 icon-source.png --out switch-icon.png
|
|
83
|
+
```
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: debugging
|
|
3
|
+
category: switch-project
|
|
4
|
+
order: 12
|
|
5
|
+
summary: "Enabling debug mode in Switch Designer, debuggable entry points, VS Code attach"
|
|
6
|
+
triggers:
|
|
7
|
+
- "Debugging a script"
|
|
8
|
+
---
|
|
9
|
+
|
|
1
10
|
# Debugging Scripts
|
|
2
11
|
|
|
3
12
|
Debugging requires configuring the Script element in Switch Designer — the agent cannot do this directly but can guide the user through the steps.
|
|
@@ -1,8 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: logs-and-dataroot
|
|
3
|
+
category: switch-project
|
|
4
|
+
order: 19
|
|
5
|
+
summary: "Locating the Application Data Root, querying `ServerLogs.db3` directly"
|
|
6
|
+
triggers:
|
|
7
|
+
- "Diagnosing or validating a script from its actual log output rather than by reading the code"
|
|
8
|
+
---
|
|
9
|
+
|
|
1
10
|
# Locating and Querying Switch's Log Database
|
|
2
11
|
|
|
3
12
|
For diagnosing or validating a script from the outside — reading what the user themselves would see
|
|
4
13
|
in Switch's Message pane — rather than instrumenting the script itself. See
|
|
5
|
-
[
|
|
14
|
+
[logging.md](../switch-api/logging.md) for how a script produces these messages in the first place.
|
|
6
15
|
|
|
7
16
|
## Finding the Application Data Root
|
|
8
17
|
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
id: project-planning
|
|
3
|
+
category: switch-project
|
|
4
|
+
order: 1
|
|
5
|
+
summary: "Pre-scaffolding checklist: Script vs App, job-processing approach, target OS, Switch version baseline, concurrency, native/binary npm dependencies, Appstore competition risk"
|
|
6
|
+
triggers:
|
|
7
|
+
- "Starting a new script or app, before scaffolding any files"
|
|
8
|
+
---
|
|
9
|
+
|
|
1
10
|
# Project Planning
|
|
2
11
|
|
|
3
12
|
A pre-scaffolding checklist for a new script or app. Work through this with the user before
|
|
@@ -16,19 +25,19 @@ relevant.
|
|
|
16
25
|
|
|
17
26
|
Ask whether this is for private or internal use (a plain `Script`, distributed freely) or intended
|
|
18
27
|
for the Enfocus Appstore (an `App`). See
|
|
19
|
-
[
|
|
28
|
+
[script-structure.md § Script vs App](script-structure.md#script-vs-app) for what differs.
|
|
20
29
|
|
|
21
30
|
This answer gates several items below:
|
|
22
31
|
|
|
23
32
|
- **App**: localization, password protection, `Name`-never-changes discipline, `Concurrent`-by-default
|
|
24
33
|
expectation, icon/keywords, and the version-baseline and Appstore-competition checks further down
|
|
25
|
-
all apply. See [
|
|
34
|
+
all apply. See [app-guidelines.md](../switch-appstore/app-guidelines.md) for the full pre-publish checklist,
|
|
26
35
|
most of which is worth designing toward from the start rather than retrofitting later.
|
|
27
36
|
- **Script**: none of the app-only items apply. Keep it simple and don't raise app concerns for a
|
|
28
37
|
plain script.
|
|
29
38
|
|
|
30
39
|
If App, also ask which languages it must support. English is required; more than one language is
|
|
31
|
-
preferable, see [
|
|
40
|
+
preferable, see [app-guidelines.md § Localization](../switch-appstore/app-guidelines.md#localization).
|
|
32
41
|
|
|
33
42
|
### 2. What should job processing look like in their flow?
|
|
34
43
|
|
|
@@ -37,15 +46,15 @@ need to wait on an external process or resource, could more than one job at a ti
|
|
|
37
46
|
shared resource. Don't ask the user to pick entry points or connection types directly. Translate the
|
|
38
47
|
answer into a concrete proposal (which entry points, which `sendTo*()` methods, whether `jobArrived`
|
|
39
48
|
alone is enough or work must be deferred to `timerFired`) using
|
|
40
|
-
[
|
|
41
|
-
[
|
|
49
|
+
[entry-points.md](../switch-api/entry-points.md) and
|
|
50
|
+
[job-patterns.md § Sending jobs](../switch-api/job-patterns.md#sending-jobs), and be upfront about
|
|
42
51
|
limitations and tradeoffs so the user can make an informed choice, rather than silently picking an
|
|
43
52
|
approach.
|
|
44
53
|
|
|
45
54
|
If the design defers job processing to `timerFired` via global data, say explicitly that a flow
|
|
46
55
|
restart replays every queued job through `jobArrived` again, and the script must recognize and skip
|
|
47
56
|
an already-registered job quickly, or a large backlog is slow to clear, see
|
|
48
|
-
[
|
|
57
|
+
[entry-points.md § Job processing](../switch-api/entry-points.md#job-processing).
|
|
49
58
|
|
|
50
59
|
## Evaluate and flag, don't ask upfront
|
|
51
60
|
|
|
@@ -53,7 +62,7 @@ an already-registered job quickly, or a large backlog is slow to clear, see
|
|
|
53
62
|
|
|
54
63
|
Switch Server runs on Windows and macOS. Default to writing platform-independent code (the `path`
|
|
55
64
|
module, no hardcoded separators, see
|
|
56
|
-
[
|
|
65
|
+
[job-patterns.md § Platform-independent paths](../switch-api/job-patterns.md#platform-independent-paths))
|
|
57
66
|
without asking. Only raise target OS as an explicit question once the script needs OS-specific code,
|
|
58
67
|
bundles a native binary, or ships a platform-specific package build, since only then does the answer
|
|
59
68
|
change anything.
|
|
@@ -62,28 +71,28 @@ change anything.
|
|
|
62
71
|
|
|
63
72
|
Once Script vs App is answered as App, ask or infer the oldest Switch version the app must support.
|
|
64
73
|
This sets the Node.js baseline (see
|
|
65
|
-
[
|
|
74
|
+
[script-structure.md § Node.js version per Switch version](script-structure.md#nodejs-version-per-switch-version))
|
|
66
75
|
and which SwitchScripter build is needed to produce a compatible `.enfpack`. Don't ask this for a
|
|
67
76
|
plain script.
|
|
68
77
|
|
|
69
78
|
### Concurrency
|
|
70
79
|
|
|
71
80
|
Default to `Concurrent` execution; it's the preferred choice for apps per
|
|
72
|
-
[
|
|
81
|
+
[app-guidelines.md § Top-level declaration properties](../switch-appstore/app-guidelines.md#top-level-declaration-properties).
|
|
73
82
|
Don't ask the user to choose upfront. Only raise `Serialized`, and explain why, when the design has
|
|
74
83
|
an actual reason to need it: a third-party application or shared resource that can't tolerate
|
|
75
84
|
concurrent access, or an API the script drives that isn't safe to call in parallel. See
|
|
76
|
-
[
|
|
85
|
+
[execution-environment.md § Execution modes](../switch-api/execution-environment.md#execution-modes).
|
|
77
86
|
|
|
78
87
|
### Native or binary npm dependencies
|
|
79
88
|
|
|
80
89
|
A file-based script or app that ends up on the ESM bundling path cannot use native (binary) Node
|
|
81
90
|
addons at all, see
|
|
82
|
-
[
|
|
91
|
+
[execution-environment.md § Native (binary) addons are not supported](../switch-api/execution-environment.md#native-binary-addons-are-not-supported).
|
|
83
92
|
If a planned dependency needs one, for example `sharp` or native `sqlite3` bindings, say so before
|
|
84
93
|
the user commits to that library, and suggest a pure JavaScript alternative or a workaround, such as
|
|
85
94
|
shelling out to an external binary, see
|
|
86
|
-
[
|
|
95
|
+
[job-patterns.md § Driving a third-party CLI application](../switch-api/job-patterns.md#driving-a-third-party-cli-application),
|
|
87
96
|
where one exists.
|
|
88
97
|
|
|
89
98
|
### Appstore competition risk (apps only)
|
|
@@ -97,4 +106,4 @@ the relevant module license or contacting Enfocus to check before proceeding.
|
|
|
97
106
|
---
|
|
98
107
|
|
|
99
108
|
This checklist stops at planning. Once these are answered, move to
|
|
100
|
-
[
|
|
109
|
+
[script-structure.md](script-structure.md) to scaffold the project.
|