@firedrill-tools/netsuite 0.1.2

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.
Files changed (92) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +214 -0
  3. package/firedrill/agent.target.json +16 -0
  4. package/firedrill/baseline.scenario.json +6905 -0
  5. package/firedrill/concurrency-limited.scenario.json +11 -0
  6. package/firedrill/conformance.suite.json +21 -0
  7. package/firedrill/ns-analytics.drill.json +73 -0
  8. package/firedrill/ns-concurrency.drill.json +53 -0
  9. package/firedrill/ns-default-identity.drill.json +43 -0
  10. package/firedrill/ns-denied.drill.json +38 -0
  11. package/firedrill/ns-insufficient-permission.drill.json +53 -0
  12. package/firedrill/ns-invalid-login.drill.json +53 -0
  13. package/firedrill/ns-order-to-cash.drill.json +93 -0
  14. package/firedrill/ns-record-locked.drill.json +53 -0
  15. package/firedrill/ns-records.drill.json +68 -0
  16. package/firedrill/ns-role-ar-clerk.drill.json +58 -0
  17. package/firedrill/ns-role-sales-rep.drill.json +58 -0
  18. package/firedrill/ns-subsidiary-scope.drill.json +58 -0
  19. package/firedrill/ns-tight-limits.drill.json +58 -0
  20. package/firedrill/ns-transform-lost.drill.json +63 -0
  21. package/firedrill/ns-write-outage.drill.json +63 -0
  22. package/firedrill/record-locked.scenario.json +11 -0
  23. package/firedrill/tight-limits.scenario.json +17 -0
  24. package/firedrill/tools/netsuite/app/assets/ATTRIBUTION.md +37 -0
  25. package/firedrill/tools/netsuite/app/assets/fonts/LICENSE.txt +92 -0
  26. package/firedrill/tools/netsuite/app/assets/oracle-netsuite.svg +1 -0
  27. package/firedrill/tools/netsuite/app/assets/oracle.svg +1 -0
  28. package/firedrill/tools/netsuite/app/site/app.js +182 -0
  29. package/firedrill/tools/netsuite/app/site/assets/fonts/open-sans-latin-ext.woff2 +0 -0
  30. package/firedrill/tools/netsuite/app/site/assets/fonts/open-sans-latin.woff2 +0 -0
  31. package/firedrill/tools/netsuite/app/site/assets/oracle-netsuite.svg +1 -0
  32. package/firedrill/tools/netsuite/app/site/assets/oracle.svg +1 -0
  33. package/firedrill/tools/netsuite/app/site/icons.js +59 -0
  34. package/firedrill/tools/netsuite/app/site/index.html +68 -0
  35. package/firedrill/tools/netsuite/app/site/menus.js +111 -0
  36. package/firedrill/tools/netsuite/app/site/overlay.js +121 -0
  37. package/firedrill/tools/netsuite/app/site/store.js +95 -0
  38. package/firedrill/tools/netsuite/app/site/styles/base.css +131 -0
  39. package/firedrill/tools/netsuite/app/site/styles/chrome.css +183 -0
  40. package/firedrill/tools/netsuite/app/site/styles/pages.css +134 -0
  41. package/firedrill/tools/netsuite/app/site/styles/tables.css +92 -0
  42. package/firedrill/tools/netsuite/app/site/ui.js +119 -0
  43. package/firedrill/tools/netsuite/app/site/views/common.js +134 -0
  44. package/firedrill/tools/netsuite/app/site/views/customer-form.js +152 -0
  45. package/firedrill/tools/netsuite/app/site/views/customer.js +147 -0
  46. package/firedrill/tools/netsuite/app/site/views/customers.js +111 -0
  47. package/firedrill/tools/netsuite/app/site/views/home-chrome.js +75 -0
  48. package/firedrill/tools/netsuite/app/site/views/home-data.js +153 -0
  49. package/firedrill/tools/netsuite/app/site/views/home.js +162 -0
  50. package/firedrill/tools/netsuite/app/site/views/invoice-new.js +131 -0
  51. package/firedrill/tools/netsuite/app/site/views/invoice.js +232 -0
  52. package/firedrill/tools/netsuite/app/site/views/invoices.js +99 -0
  53. package/firedrill/tools/netsuite/app/site/views/items.js +95 -0
  54. package/firedrill/tools/netsuite/app/site/views/order-new.js +154 -0
  55. package/firedrill/tools/netsuite/app/site/views/order.js +214 -0
  56. package/firedrill/tools/netsuite/app/site/views/orders.js +93 -0
  57. package/firedrill/tools/netsuite/app/site/views/payments.js +65 -0
  58. package/firedrill/tools/netsuite/app/site/views/pickers.js +117 -0
  59. package/firedrill/tools/netsuite/app/site/views/subsidiaries.js +40 -0
  60. package/firedrill/tools/netsuite/app/site/views/suiteql.js +81 -0
  61. package/firedrill/tools/netsuite/behavior.mjs +13 -0
  62. package/firedrill/tools/netsuite/lib/body.mjs +185 -0
  63. package/firedrill/tools/netsuite/lib/collections.mjs +202 -0
  64. package/firedrill/tools/netsuite/lib/errors.mjs +91 -0
  65. package/firedrill/tools/netsuite/lib/handlers-meta.mjs +100 -0
  66. package/firedrill/tools/netsuite/lib/handlers-read.mjs +141 -0
  67. package/firedrill/tools/netsuite/lib/handlers-session.mjs +52 -0
  68. package/firedrill/tools/netsuite/lib/handlers-write.mjs +6 -0
  69. package/firedrill/tools/netsuite/lib/metadata.mjs +148 -0
  70. package/firedrill/tools/netsuite/lib/primitives.mjs +105 -0
  71. package/firedrill/tools/netsuite/lib/project-tran.mjs +153 -0
  72. package/firedrill/tools/netsuite/lib/project.mjs +178 -0
  73. package/firedrill/tools/netsuite/lib/q.mjs +280 -0
  74. package/firedrill/tools/netsuite/lib/session.mjs +188 -0
  75. package/firedrill/tools/netsuite/lib/suiteql-parse.mjs +382 -0
  76. package/firedrill/tools/netsuite/lib/suiteql-run.mjs +270 -0
  77. package/firedrill/tools/netsuite/lib/suiteql-select.mjs +118 -0
  78. package/firedrill/tools/netsuite/lib/suiteql-tables.mjs +162 -0
  79. package/firedrill/tools/netsuite/lib/tran.mjs +133 -0
  80. package/firedrill/tools/netsuite/lib/wire-decode.mjs +107 -0
  81. package/firedrill/tools/netsuite/lib/wire.mjs +228 -0
  82. package/firedrill/tools/netsuite/lib/write-customer.mjs +181 -0
  83. package/firedrill/tools/netsuite/lib/write-invoice.mjs +319 -0
  84. package/firedrill/tools/netsuite/lib/write-order.mjs +269 -0
  85. package/firedrill/tools/netsuite/netsuite.tool.json +4888 -0
  86. package/firedrill/transform-response-lost.scenario.json +11 -0
  87. package/firedrill/world.json +7711 -0
  88. package/firedrill/write-outage.scenario.json +11 -0
  89. package/firedrill.json +5 -0
  90. package/package.json +52 -0
  91. package/starter.json +6904 -0
  92. package/test/conformance.mjs +701 -0
@@ -0,0 +1,58 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "ns-subsidiary-scope",
4
+ "title": "A subsidiary-restricted role sees only its own records",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "baseline",
7
+ "actorId": "canada-controller",
8
+ "task": {
9
+ "instruction": "Run the subsidiary-scope conformance flow against the synthetic NetSuite Tool and fail loudly on any unexpected status or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "out-of-scope-hidden",
14
+ "kind": "operation.count",
15
+ "operation": {
16
+ "packageId": "netsuite",
17
+ "operationId": "customer.get"
18
+ },
19
+ "outcomes": [
20
+ "tool_error"
21
+ ],
22
+ "comparison": {
23
+ "operator": "greater_than_or_equal",
24
+ "value": 1
25
+ }
26
+ },
27
+ {
28
+ "id": "in-scope-visible",
29
+ "kind": "operation.count",
30
+ "operation": {
31
+ "packageId": "netsuite",
32
+ "operationId": "customer.get"
33
+ },
34
+ "outcomes": [
35
+ "ok"
36
+ ],
37
+ "comparison": {
38
+ "operator": "greater_than_or_equal",
39
+ "value": 1
40
+ }
41
+ },
42
+ {
43
+ "id": "list-filtered",
44
+ "kind": "operation.count",
45
+ "operation": {
46
+ "packageId": "netsuite",
47
+ "operationId": "customer.list"
48
+ },
49
+ "outcomes": [
50
+ "ok"
51
+ ],
52
+ "comparison": {
53
+ "operator": "greater_than_or_equal",
54
+ "value": 1
55
+ }
56
+ }
57
+ ]
58
+ }
@@ -0,0 +1,58 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "ns-tight-limits",
4
+ "title": "Tight scan and page limits fail every scanning operation",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "tight-limits",
7
+ "actorId": "administrator",
8
+ "task": {
9
+ "instruction": "Run the tight-limits conformance flow against the synthetic NetSuite Tool and fail loudly on any unexpected status or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "list-too-large",
14
+ "kind": "operation.count",
15
+ "operation": {
16
+ "packageId": "netsuite",
17
+ "operationId": "customer.list"
18
+ },
19
+ "outcomes": [
20
+ "tool_error"
21
+ ],
22
+ "comparison": {
23
+ "operator": "greater_than_or_equal",
24
+ "value": 1
25
+ }
26
+ },
27
+ {
28
+ "id": "item-get-ok",
29
+ "kind": "operation.count",
30
+ "operation": {
31
+ "packageId": "netsuite",
32
+ "operationId": "inventory-item.get"
33
+ },
34
+ "outcomes": [
35
+ "ok"
36
+ ],
37
+ "comparison": {
38
+ "operator": "greater_than_or_equal",
39
+ "value": 1
40
+ }
41
+ },
42
+ {
43
+ "id": "metadata-ok",
44
+ "kind": "operation.count",
45
+ "operation": {
46
+ "packageId": "netsuite",
47
+ "operationId": "record.metadata"
48
+ },
49
+ "outcomes": [
50
+ "ok"
51
+ ],
52
+ "comparison": {
53
+ "operator": "greater_than_or_equal",
54
+ "value": 1
55
+ }
56
+ }
57
+ ]
58
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "ns-transform-lost",
4
+ "title": "A transform commits but its response is lost",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "transform-response-lost",
7
+ "actorId": "administrator",
8
+ "task": {
9
+ "instruction": "Run the transform-lost conformance flow against the synthetic NetSuite Tool and fail loudly on any unexpected status or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "order-transform-500",
14
+ "kind": "operation.count",
15
+ "operation": {
16
+ "packageId": "netsuite",
17
+ "operationId": "sales-order.transform"
18
+ },
19
+ "outcomes": [
20
+ "tool_error"
21
+ ],
22
+ "comparison": {
23
+ "operator": "greater_than_or_equal",
24
+ "value": 1
25
+ }
26
+ },
27
+ {
28
+ "id": "invoice-transform-500",
29
+ "kind": "operation.count",
30
+ "operation": {
31
+ "packageId": "netsuite",
32
+ "operationId": "invoice.transform"
33
+ },
34
+ "outcomes": [
35
+ "tool_error"
36
+ ],
37
+ "comparison": {
38
+ "operator": "greater_than_or_equal",
39
+ "value": 1
40
+ }
41
+ },
42
+ {
43
+ "id": "invoice-was-created",
44
+ "kind": "state.count",
45
+ "packageId": "netsuite",
46
+ "namespace": "invoices",
47
+ "comparison": {
48
+ "operator": "equals",
49
+ "value": 12
50
+ }
51
+ },
52
+ {
53
+ "id": "payment-was-created",
54
+ "kind": "state.count",
55
+ "packageId": "netsuite",
56
+ "namespace": "customer-payments",
57
+ "comparison": {
58
+ "operator": "equals",
59
+ "value": 6
60
+ }
61
+ }
62
+ ]
63
+ }
@@ -0,0 +1,63 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "ns-write-outage",
4
+ "title": "A write outage fails every write and moves no state",
5
+ "targetId": "conformance-agent",
6
+ "scenarioId": "write-outage",
7
+ "actorId": "administrator",
8
+ "task": {
9
+ "instruction": "Run the write-outage conformance flow against the synthetic NetSuite Tool and fail loudly on any unexpected status or body."
10
+ },
11
+ "assertions": [
12
+ {
13
+ "id": "create-500",
14
+ "kind": "operation.count",
15
+ "operation": {
16
+ "packageId": "netsuite",
17
+ "operationId": "customer.create"
18
+ },
19
+ "outcomes": [
20
+ "tool_error"
21
+ ],
22
+ "comparison": {
23
+ "operator": "greater_than_or_equal",
24
+ "value": 1
25
+ }
26
+ },
27
+ {
28
+ "id": "reads-still-work",
29
+ "kind": "operation.count",
30
+ "operation": {
31
+ "packageId": "netsuite",
32
+ "operationId": "customer.list"
33
+ },
34
+ "outcomes": [
35
+ "ok"
36
+ ],
37
+ "comparison": {
38
+ "operator": "greater_than_or_equal",
39
+ "value": 1
40
+ }
41
+ },
42
+ {
43
+ "id": "customers-unchanged",
44
+ "kind": "state.count",
45
+ "packageId": "netsuite",
46
+ "namespace": "customers",
47
+ "comparison": {
48
+ "operator": "equals",
49
+ "value": 12
50
+ }
51
+ },
52
+ {
53
+ "id": "invoices-unchanged",
54
+ "kind": "state.count",
55
+ "packageId": "netsuite",
56
+ "namespace": "invoices",
57
+ "comparison": {
58
+ "operator": "equals",
59
+ "value": 11
60
+ }
61
+ }
62
+ ]
63
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "record-locked",
4
+ "title": "Seeded account where edits and transforms report a concurrent change",
5
+ "faults": [
6
+ {
7
+ "packageId": "netsuite",
8
+ "faultId": "record-locked"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "id": "tight-limits",
4
+ "title": "Seeded account with maxScanRows 2 and maxPageBytes 4000",
5
+ "state": [
6
+ {
7
+ "action": "upsert",
8
+ "packageId": "netsuite",
9
+ "namespace": "meta",
10
+ "rowId": "limits",
11
+ "value": {
12
+ "maxScanRows": 2,
13
+ "maxPageBytes": 4000
14
+ }
15
+ }
16
+ ]
17
+ }
@@ -0,0 +1,37 @@
1
+ # Third-party assets used by the NetSuite Tool app
2
+
3
+ The browser app is served from `../site/`. This directory keeps the attribution record, the font licence and the
4
+ original downloads; the copies under `../site/assets/` are byte-identical (the framework serves only
5
+ html/css/js/json/image/font files, so this Markdown file and the licence text cannot live inside the served root).
6
+
7
+ ## Logos (trademarks of Oracle Corporation)
8
+
9
+ | file | served copy | source | brand version |
10
+ |---|---|---|---|
11
+ | `oracle-netsuite.svg` | `../site/assets/oracle-netsuite.svg` | https://logos.lndev.me/logos/oracle-netsuite.svg (library: https://github.com/ln-dev7/logos-apps) | The current stacked **ORACLE NETSUITE** lockup (Oracle wordmark with the registered mark over "NETSUITE"), the mark Oracle has used for the product since the 2016 acquisition and the one a NetSuite user sees in the application bar today. Drawn with `fill="currentColor"`, so the app renders it white on the dark application bar with a CSS filter; the file itself is used unmodified. SHA-256 `1af8e382d5cc413cb324c831c24432940759eb6a7c963128ef9437bb3a16598f`, 2,613 bytes. |
12
+ | `oracle.svg` | `../site/assets/oracle.svg` | https://logos.lndev.me/logos/oracle.svg | The red Oracle wordmark (`#ea1b22`), the current corporate mark. Used as the app's favicon. SHA-256 `8c31cc34cb7b0cc9200e07218c79cb22cf76508cf486b5dbd2386cd5b94353b6`, 1,326 bytes. |
13
+
14
+ Downloaded on 2026-09-16 and used unmodified. The logo library has no standalone `netsuite` entry; `oracle-netsuite`
15
+ is the product lockup and is what the real application bar shows, so nothing was redrawn or substituted.
16
+
17
+ Oracle, NetSuite and the Oracle NetSuite logo are trademarks of Oracle Corporation. They identify the simulated
18
+ service inside a test environment only; this package is not affiliated with, endorsed by, or connected to Oracle.
19
+
20
+ ## Font
21
+
22
+ | served copy | source | licence |
23
+ |---|---|---|
24
+ | `../site/assets/fonts/open-sans-latin.woff2` | https://fonts.gstatic.com/s/opensans/v44/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTS-mu0SC55I.woff2 (Open Sans v44, latin subset, variable weight 300–800, as served by https://fonts.googleapis.com/css2?family=Open+Sans:wght@400..700) | SIL Open Font License 1.1 — `fonts/LICENSE.txt` |
25
+ | `../site/assets/fonts/open-sans-latin-ext.woff2` | https://fonts.gstatic.com/s/opensans/v44/memvYaGs126MiZpBA-UvWbX2vVnXBbObj2OVTSGmu0SC55K5gw.woff2 (latin-ext subset, needed for names such as "Émile Thibault") | SIL Open Font License 1.1 — `fonts/LICENSE.txt` |
26
+
27
+ `fonts/LICENSE.txt` was copied from https://raw.githubusercontent.com/google/fonts/main/ofl/opensans/OFL.txt.
28
+ Copyright 2020 The Open Sans Project Authors (https://github.com/googlefonts/opensans). The NetSuite web
29
+ application uses Oracle Sans and Helvetica Neue, both proprietary and not redistributable; Open Sans is a
30
+ permissively licensed humanist sans with the same open, slightly condensed UI proportions and is the face this
31
+ app bundles as `NS Sans`.
32
+
33
+ ## Interface glyphs
34
+
35
+ The monochrome line glyphs in `../site/icons.js` (search, recent records, create, shortcuts, help, chevrons,
36
+ record actions) are original SVG paths drawn for this package in the plain, square-ended style of the NetSuite
37
+ application bar and list toolbars. No third-party icon font is embedded.
@@ -0,0 +1,92 @@
1
+ Copyright 2020 The Open Sans Project Authors (https://github.com/googlefonts/opensans)
2
+
3
+ This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
+ This license is copied below, and is also available with a FAQ at:
5
+ https://scripts.sil.org/OFL
6
+
7
+ -----------------------------------------------------------
8
+ SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
9
+ -----------------------------------------------------------
10
+
11
+ PREAMBLE
12
+ The goals of the Open Font License (OFL) are to stimulate worldwide
13
+ development of collaborative font projects, to support the font
14
+ creation efforts of academic and linguistic communities, and to
15
+ provide a free and open framework in which fonts may be shared and
16
+ improved in partnership with others.
17
+
18
+ The OFL allows the licensed fonts to be used, studied, modified and
19
+ redistributed freely as long as they are not sold by themselves. The
20
+ fonts, including any derivative works, can be bundled, embedded,
21
+ redistributed and/or sold with any software provided that any reserved
22
+ names are not used by derivative works. The fonts and derivatives,
23
+ however, cannot be released under any other type of license. The
24
+ requirement for fonts to remain under this license does not apply to
25
+ any document created using the fonts or their derivatives.
26
+
27
+ DEFINITIONS
28
+ "Font Software" refers to the set of files released by the Copyright
29
+ Holder(s) under this license and clearly marked as such. This may
30
+ include source files, build scripts and documentation.
31
+
32
+ "Reserved Font Name" refers to any names specified as such after the
33
+ copyright statement(s).
34
+
35
+ "Original Version" refers to the collection of Font Software
36
+ components as distributed by the Copyright Holder(s).
37
+
38
+ "Modified Version" refers to any derivative made by adding to,
39
+ deleting, or substituting -- in part or in whole -- any of the
40
+ components of the Original Version, by changing formats or by porting
41
+ the Font Software to a new environment.
42
+
43
+ "Author" refers to any designer, engineer, programmer, technical
44
+ writer or other person who contributed to the Font Software.
45
+
46
+ PERMISSION & CONDITIONS
47
+ Permission is hereby granted, free of charge, to any person obtaining
48
+ a copy of the Font Software, to use, study, copy, merge, embed,
49
+ modify, redistribute, and sell modified and unmodified copies of the
50
+ Font Software, subject to the following conditions:
51
+
52
+ 1) Neither the Font Software nor any of its individual components, in
53
+ Original or Modified Versions, may be sold by itself.
54
+
55
+ 2) Original or Modified Versions of the Font Software may be bundled,
56
+ redistributed and/or sold with any software, provided that each copy
57
+ contains the above copyright notice and this license. These can be
58
+ included either as stand-alone text files, human-readable headers or
59
+ in the appropriate machine-readable metadata fields within text or
60
+ binary files as long as those fields can be easily viewed by the user.
61
+
62
+ 3) No Modified Version of the Font Software may use the Reserved Font
63
+ Name(s) unless explicit written permission is granted by the
64
+ corresponding Copyright Holder. This restriction only applies to the
65
+ primary font name as presented to the users.
66
+
67
+ 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
68
+ Software shall not be used to promote, endorse or advertise any
69
+ Modified Version, except to acknowledge the contribution(s) of the
70
+ Copyright Holder(s) and the Author(s) or with their explicit written
71
+ permission.
72
+
73
+ 5) The Font Software, modified or unmodified, in part or in whole,
74
+ must be distributed entirely under this license, and must not be
75
+ distributed under any other license. The requirement for fonts to
76
+ remain under this license does not apply to any document created using
77
+ the Font Software.
78
+
79
+ TERMINATION
80
+ This license becomes null and void if any of the above conditions are
81
+ not met.
82
+
83
+ DISCLAIMER
84
+ THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
85
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
86
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
87
+ OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
88
+ COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
89
+ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
90
+ DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
91
+ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
92
+ OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="currentColor" d="M31.518 11.688c.026 0 .064 0 .077-.039c.013-.013.013-.025.013-.038a.07.07 0 0 0-.038-.064c-.026-.013-.052-.013-.09-.013h-.026v.14h.064m-.038-.204c.064 0 .102 0 .128.013c.09.025.09.115.09.14v.039c0 .026-.013.064-.065.09c0 0-.012.012-.025.012l.115.205h-.115l-.09-.192h-.064v.192h-.102v-.499zm.038.703a.445.445 0 0 0 .448-.447a.437.437 0 0 0-.448-.448a.453.453 0 0 0-.447.448c0 .243.204.447.447.447m-.345-.447c0-.192.153-.345.358-.345c.192 0 .345.153.345.345a.344.344 0 0 1-.345.345a.34.34 0 0 1-.358-.345m-3.107 2.851a1.29 1.29 0 0 1-1.24-.933h3.26l.448-.703h-3.708a1.29 1.29 0 0 1 1.24-.934h2.238l.447-.703h-2.736c-1.1 0-1.982.895-1.982 1.982c0 1.1.895 1.982 1.982 1.982h2.353l.447-.704h-2.749m-9.334.704h2.365l.448-.704h-2.749a1.285 1.285 0 0 1-1.292-1.278c0-.716.576-1.279 1.292-1.279h2.238l.447-.703h-2.736c-1.1 0-1.995.895-1.995 1.982c0 1.1.895 1.982 1.982 1.982m-14.487-.69H2.033a1.28 1.28 0 0 1-1.279-1.28c0-.715.576-1.278 1.279-1.278h2.2c.715 0 1.29.575 1.29 1.279c0 .703-.575 1.278-1.278 1.278m-2.263.69h2.301c1.1 0 1.982-.882 1.982-1.981s-.882-1.982-1.982-1.982H1.982A1.99 1.99 0 0 0 0 13.286c0 1.1.895 1.982 1.982 1.982m8.042-1.279a1.342 1.342 0 1 0 0-2.685H6.687v3.964h.767v-3.26h2.52c.357 0 .639.28.639.638c0 .359-.282.64-.64.64H7.825l2.276 1.982h1.113l-1.535-1.292h.345m12.62.601v-3.273h-.767v3.593q0 .154.115.268a.4.4 0 0 0 .282.115h3.478l.447-.703zm-9.334-.703h2.033l-1.074-1.739l-1.982 3.133h-.908l2.404-3.76a.56.56 0 0 1 .473-.242c.192 0 .358.089.46.242l2.417 3.772h-.895l-.422-.703h-2.059zM.371 17.659h1.01l1.227 2.57v-2.57h.653v3.273h-.96l-1.265-2.724v2.711H.371zm3.631 0h2.187v.537H4.705v.78h1.394v.537H4.705v.882H6.24v.537H4.002zm3.593.537h-.972v-.537h2.66v.537h-.972v2.736h-.703v-2.736zm2.532 1.777c.013.23.038.652.792.652c.678 0 .768-.422.768-.588c0-.37-.294-.435-.755-.55c-.498-.128-.716-.179-.882-.294a.73.73 0 0 1-.345-.64c0-.664.626-.958 1.24-.958c.217 0 .652.038.92.32c.18.204.192.421.205.562h-.473c-.025-.41-.37-.499-.69-.499c-.448 0-.73.205-.73.525c0 .294.193.383.59.486c.779.204.869.217 1.06.345c.307.204.32.511.32.652c0 .575-.448 1.023-1.291 1.023c-.243 0-.755-.039-1.01-.371c-.192-.243-.192-.499-.192-.665zm3.196-2.314v2.02c0 .345.077.499.14.588c.206.269.525.32.743.32c.882 0 .882-.69.882-.934V17.66h.435v2.02c0 .179 0 .537-.269.87c-.32.409-.818.447-1.061.447c-.307 0-.857-.09-1.15-.524c-.103-.141-.193-.333-.193-.819V17.66zm3.146 3.273h.447v-3.273h-.447zm2.212 0v-2.89h-1.1v-.383h2.634v.383h-1.099v2.89zm2.084-3.273h2.046v.383h-1.598v1.023h1.521v.384h-1.521v1.087h1.636v.396h-2.084z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 67"><path fill="#ea1b22" d="M221.034 43.303h33.832l-17.889-28.781l-32.833 52.037h-14.942l39.935-62.508c1.736-2.525 4.63-4.051 7.84-4.051c3.104 0 5.998 1.473 7.682 3.946l40.093 62.613H269.81l-7.05-11.628h-34.253zM376.251 54.93V.631h-12.68v59.614c0 1.631.631 3.21 1.841 4.42s2.841 1.894 4.63 1.894h57.825l7.472-11.628zm-209.78-9.734c12.313 0 22.31-9.944 22.31-22.256c0-12.313-9.997-22.31-22.31-22.31h-55.473v65.93h12.676v-54.3h41.956c5.893 0 10.628 4.789 10.628 10.682c0 5.892-4.735 10.68-10.628 10.68l-35.747-.052l37.851 32.99h18.416l-25.466-21.362zM32.97 66.559C14.77 66.56 0 51.827 0 33.622C0 15.416 14.77.632 32.97.632h38.32c18.204 0 32.963 14.784 32.963 32.99c0 18.205-14.759 32.937-32.964 32.937zm37.468-11.628c11.791 0 21.341-9.524 21.341-21.31S82.228 12.26 70.437 12.26h-36.62c-11.787 0-21.342 9.576-21.342 21.362S22.03 54.93 33.816 54.93zm240.78 11.628c-18.204 0-32.99-14.732-32.99-32.937c0-18.206 14.786-32.99 32.99-32.99h45.514l-7.42 11.628H312.06c-11.786 0-21.362 9.576-21.362 21.362s9.576 21.309 21.362 21.309h45.723l-7.472 11.628zm155.06-11.628c-9.734 0-17.995-6.524-20.52-15.522h54.194l7.471-11.628h-61.665c2.525-8.945 10.786-15.521 20.52-15.521h37.2L511 .63h-45.565c-18.205 0-32.99 14.785-32.99 32.99s14.785 32.938 32.99 32.938h39.094L512 54.931z"/></svg>
@@ -0,0 +1,182 @@
1
+ // NetSuite Tool app: the application shell (bar, global menu bar, account strip), the hash router and boot.
2
+ // Every screen calls this Tool's own operations through /_firedrill/client.js.
3
+ import { hydrateIcons, icon } from "./icons.js";
4
+ import { app, go, loadSession, parseRoute } from "./store.js";
5
+ import { $, el, errorBanner } from "./ui.js";
6
+ import { closeMenu, notSimulated, openMenu, watchWorld } from "./overlay.js";
7
+ import { MENUS, CREATE_NEW } from "./menus.js";
8
+ import "./views/home.js";
9
+ import "./views/customers.js";
10
+ import "./views/customer.js";
11
+ import "./views/orders.js";
12
+ import "./views/order.js";
13
+ import "./views/order-new.js";
14
+ import "./views/invoices.js";
15
+ import "./views/invoice.js";
16
+ import "./views/invoice-new.js";
17
+ import "./views/payments.js";
18
+ import "./views/items.js";
19
+ import "./views/subsidiaries.js";
20
+ import "./views/suiteql.js";
21
+
22
+ const TABS = ["Activities", "Payments", "Transactions", "Lists", "Reports", "Analytics", "Documents", "Setup", "Customization", "Commerce", "Support"];
23
+ const TAB_FOR = {
24
+ home: "", customers: "Lists", customer: "Lists", items: "Lists",
25
+ orders: "Transactions", order: "Transactions", invoices: "Transactions", invoice: "Transactions",
26
+ payments: "Payments", suiteql: "Analytics", subsidiaries: "Setup",
27
+ };
28
+
29
+ let token = 0;
30
+ async function render() {
31
+ const route = parseRoute();
32
+ let name = route.page;
33
+ if (name === "orders" && route.id) name = route.id === "new" ? "order-new" : "order";
34
+ if (name === "invoices" && route.id) name = route.id === "new" ? "invoice-new" : "invoice";
35
+ if (name === "customers" && route.id) name = "customer";
36
+ const page = app.pages[name];
37
+ const mine = (token += 1);
38
+ app.dirty = false;
39
+ closeMenu();
40
+ $("#overlay-root").replaceChildren();
41
+ $("#appbar").classList.remove("nav-open");
42
+ markTab(TAB_FOR[route.page] ?? "");
43
+ window.scrollTo(0, 0);
44
+ const main = $("#main");
45
+ if (app.sessionError) {
46
+ main.replaceChildren(errorBanner(app.sessionError, "This role cannot open the NetSuite interface"));
47
+ return;
48
+ }
49
+ if (!page) {
50
+ main.replaceChildren(errorBanner(new Error(`There is no page at ${location.hash}.`), "Page not found"));
51
+ return;
52
+ }
53
+ try {
54
+ await page(main, route);
55
+ } catch (error) {
56
+ if (mine === token) main.replaceChildren(errorBanner(error, "This page could not be loaded"));
57
+ }
58
+ }
59
+ export function rerender() { return render(); }
60
+
61
+ function markTab(current) {
62
+ for (const tab of document.querySelectorAll("#menubar .tab")) {
63
+ tab.classList.toggle("active", tab.dataset.tab === current);
64
+ }
65
+ }
66
+
67
+ function buildMenubar() {
68
+ const bar = $("#menubar");
69
+ bar.replaceChildren(...TABS.map((name) => {
70
+ const button = el("button", { type: "button", class: "tab", "aria-haspopup": "true", "aria-expanded": "false", text: name });
71
+ button.dataset.tab = name;
72
+ button.addEventListener("click", (event) => {
73
+ event.stopPropagation();
74
+ openMenu(button, MENUS[name] ?? [{ label: name }]);
75
+ });
76
+ return button;
77
+ }));
78
+ }
79
+
80
+ function recentMenu() {
81
+ if (app.recent.length === 0) return [{ heading: "Recent Records" }, { label: "No records opened yet", disabled: true }];
82
+ return [{ heading: "Recent Records" }, ...app.recent.map((entry) => ({ label: entry.label, run: () => go(entry.href) }))];
83
+ }
84
+
85
+ function paintIdentity() {
86
+ const session = app.session;
87
+ const user = session?.user;
88
+ const initials = user ? `${user.name.charAt(0)}${user.name.split(" ").pop().charAt(0)}` : "?";
89
+ $("#user-initials").textContent = initials;
90
+ $("#user-name").textContent = user?.name ?? "Not signed in";
91
+ $("#user-role").textContent = session?.role?.name ?? "";
92
+ $("#acct-name").textContent = session?.account?.companyName ?? "NetSuite";
93
+ $("#role-label").textContent = session?.role?.name ?? "Role";
94
+ $("#acct-date").textContent = session ? `Account date ${formatToday(session.accountDate)} · ${session.account.accountId}` : "";
95
+ $("#footer-account").textContent = session
96
+ ? `${session.account.companyName} (${session.account.accountId}) — ${session.role.name}`
97
+ : "NetSuite (synthetic)";
98
+ const scope = session?.subsidiaryScope;
99
+ const chip = $("#acct-chip");
100
+ chip.textContent = scope && scope.id !== "0"
101
+ ? `Firedrill synthetic account · ${scope.refName} only`
102
+ : "Firedrill synthetic account";
103
+ }
104
+ function formatToday(date) {
105
+ const match = /^(\d{4})-(\d{2})-(\d{2})/.exec(String(date ?? ""));
106
+ return match ? `${Number(match[2])}/${Number(match[3])}/${match[1]}` : "";
107
+ }
108
+
109
+ function wireBar() {
110
+ $("#menu-toggle").append(icon("menu", 20));
111
+ $(".gs-go").append(icon("search", 15));
112
+ $("#recent-btn").prepend(icon("clock", 17));
113
+ $("#create-btn").prepend(icon("plus", 17));
114
+ $("#shortcuts-btn").prepend(icon("star", 17));
115
+ $("#help-btn").prepend(icon("help", 17));
116
+
117
+ $("#menu-toggle").addEventListener("click", () => {
118
+ const bar = $("#appbar");
119
+ bar.classList.toggle("nav-open");
120
+ $("#menu-toggle").setAttribute("aria-expanded", String(bar.classList.contains("nav-open")));
121
+ });
122
+ $("#recent-btn").addEventListener("click", (event) => { event.stopPropagation(); openMenu(event.currentTarget, recentMenu(), { align: "right" }); });
123
+ $("#create-btn").addEventListener("click", (event) => { event.stopPropagation(); openMenu(event.currentTarget, CREATE_NEW, { align: "right" }); });
124
+ $("#shortcuts-btn").addEventListener("click", (event) => {
125
+ event.stopPropagation();
126
+ openMenu(event.currentTarget, [
127
+ { heading: "Shortcuts" },
128
+ { label: "Customers", run: () => go("#/customers") },
129
+ { label: "Sales Orders", run: () => go("#/orders") },
130
+ { label: "Invoices", run: () => go("#/invoices") },
131
+ { label: "SuiteQL Query Tool", run: () => go("#/suiteql") },
132
+ { divider: true },
133
+ { label: "Personalize Shortcuts" },
134
+ ], { align: "right" });
135
+ });
136
+ $("#help-btn").addEventListener("click", () => notSimulated("Help Center"));
137
+ $("#user-btn").addEventListener("click", (event) => {
138
+ event.stopPropagation();
139
+ const user = app.session?.user;
140
+ openMenu(event.currentTarget, [
141
+ { heading: user ? `${user.name} — ${user.title}` : "Not signed in" },
142
+ { label: "Set Preferences" },
143
+ { label: "Change Password" },
144
+ { label: "Change Role" },
145
+ { divider: true },
146
+ { label: "Log Out", disabled: true, hint: "No login in a Firedrill world" },
147
+ ], { align: "right" });
148
+ });
149
+ $("#role-btn").addEventListener("click", (event) => {
150
+ event.stopPropagation();
151
+ const role = app.session?.role;
152
+ openMenu(event.currentTarget, [
153
+ { heading: "Role" },
154
+ { label: role ? `${role.name} (current)` : "Role", disabled: true },
155
+ { divider: true },
156
+ { label: "Switch role", hint: "Set by the Firedrill actor" },
157
+ ]);
158
+ });
159
+ $("#global-search").addEventListener("submit", (event) => {
160
+ event.preventDefault();
161
+ const term = $("#global-search-input").value.trim();
162
+ if (term === "") return;
163
+ go(`#/customers?q=${encodeURIComponent(term)}`);
164
+ });
165
+ for (const button of document.querySelectorAll("[data-not-simulated]")) {
166
+ button.addEventListener("click", () => notSimulated(button.getAttribute("data-not-simulated")));
167
+ }
168
+ }
169
+
170
+ async function boot() {
171
+ hydrateIcons();
172
+ wireBar();
173
+ buildMenubar();
174
+ await loadSession();
175
+ paintIdentity();
176
+ if (!location.hash) location.replace("#/home");
177
+ window.addEventListener("hashchange", render);
178
+ await render();
179
+ watchWorld(async () => { await loadSession(); paintIdentity(); await render(); },
180
+ () => !app.dirty && !document.querySelector(".scrim"));
181
+ }
182
+ boot();
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="currentColor" d="M31.518 11.688c.026 0 .064 0 .077-.039c.013-.013.013-.025.013-.038a.07.07 0 0 0-.038-.064c-.026-.013-.052-.013-.09-.013h-.026v.14h.064m-.038-.204c.064 0 .102 0 .128.013c.09.025.09.115.09.14v.039c0 .026-.013.064-.065.09c0 0-.012.012-.025.012l.115.205h-.115l-.09-.192h-.064v.192h-.102v-.499zm.038.703a.445.445 0 0 0 .448-.447a.437.437 0 0 0-.448-.448a.453.453 0 0 0-.447.448c0 .243.204.447.447.447m-.345-.447c0-.192.153-.345.358-.345c.192 0 .345.153.345.345a.344.344 0 0 1-.345.345a.34.34 0 0 1-.358-.345m-3.107 2.851a1.29 1.29 0 0 1-1.24-.933h3.26l.448-.703h-3.708a1.29 1.29 0 0 1 1.24-.934h2.238l.447-.703h-2.736c-1.1 0-1.982.895-1.982 1.982c0 1.1.895 1.982 1.982 1.982h2.353l.447-.704h-2.749m-9.334.704h2.365l.448-.704h-2.749a1.285 1.285 0 0 1-1.292-1.278c0-.716.576-1.279 1.292-1.279h2.238l.447-.703h-2.736c-1.1 0-1.995.895-1.995 1.982c0 1.1.895 1.982 1.982 1.982m-14.487-.69H2.033a1.28 1.28 0 0 1-1.279-1.28c0-.715.576-1.278 1.279-1.278h2.2c.715 0 1.29.575 1.29 1.279c0 .703-.575 1.278-1.278 1.278m-2.263.69h2.301c1.1 0 1.982-.882 1.982-1.981s-.882-1.982-1.982-1.982H1.982A1.99 1.99 0 0 0 0 13.286c0 1.1.895 1.982 1.982 1.982m8.042-1.279a1.342 1.342 0 1 0 0-2.685H6.687v3.964h.767v-3.26h2.52c.357 0 .639.28.639.638c0 .359-.282.64-.64.64H7.825l2.276 1.982h1.113l-1.535-1.292h.345m12.62.601v-3.273h-.767v3.593q0 .154.115.268a.4.4 0 0 0 .282.115h3.478l.447-.703zm-9.334-.703h2.033l-1.074-1.739l-1.982 3.133h-.908l2.404-3.76a.56.56 0 0 1 .473-.242c.192 0 .358.089.46.242l2.417 3.772h-.895l-.422-.703h-2.059zM.371 17.659h1.01l1.227 2.57v-2.57h.653v3.273h-.96l-1.265-2.724v2.711H.371zm3.631 0h2.187v.537H4.705v.78h1.394v.537H4.705v.882H6.24v.537H4.002zm3.593.537h-.972v-.537h2.66v.537h-.972v2.736h-.703v-2.736zm2.532 1.777c.013.23.038.652.792.652c.678 0 .768-.422.768-.588c0-.37-.294-.435-.755-.55c-.498-.128-.716-.179-.882-.294a.73.73 0 0 1-.345-.64c0-.664.626-.958 1.24-.958c.217 0 .652.038.92.32c.18.204.192.421.205.562h-.473c-.025-.41-.37-.499-.69-.499c-.448 0-.73.205-.73.525c0 .294.193.383.59.486c.779.204.869.217 1.06.345c.307.204.32.511.32.652c0 .575-.448 1.023-1.291 1.023c-.243 0-.755-.039-1.01-.371c-.192-.243-.192-.499-.192-.665zm3.196-2.314v2.02c0 .345.077.499.14.588c.206.269.525.32.743.32c.882 0 .882-.69.882-.934V17.66h.435v2.02c0 .179 0 .537-.269.87c-.32.409-.818.447-1.061.447c-.307 0-.857-.09-1.15-.524c-.103-.141-.193-.333-.193-.819V17.66zm3.146 3.273h.447v-3.273h-.447zm2.212 0v-2.89h-1.1v-.383h2.634v.383h-1.099v2.89zm2.084-3.273h2.046v.383h-1.598v1.023h1.521v.384h-1.521v1.087h1.636v.396h-2.084z"/></svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 67"><path fill="#ea1b22" d="M221.034 43.303h33.832l-17.889-28.781l-32.833 52.037h-14.942l39.935-62.508c1.736-2.525 4.63-4.051 7.84-4.051c3.104 0 5.998 1.473 7.682 3.946l40.093 62.613H269.81l-7.05-11.628h-34.253zM376.251 54.93V.631h-12.68v59.614c0 1.631.631 3.21 1.841 4.42s2.841 1.894 4.63 1.894h57.825l7.472-11.628zm-209.78-9.734c12.313 0 22.31-9.944 22.31-22.256c0-12.313-9.997-22.31-22.31-22.31h-55.473v65.93h12.676v-54.3h41.956c5.893 0 10.628 4.789 10.628 10.682c0 5.892-4.735 10.68-10.628 10.68l-35.747-.052l37.851 32.99h18.416l-25.466-21.362zM32.97 66.559C14.77 66.56 0 51.827 0 33.622C0 15.416 14.77.632 32.97.632h38.32c18.204 0 32.963 14.784 32.963 32.99c0 18.205-14.759 32.937-32.964 32.937zm37.468-11.628c11.791 0 21.341-9.524 21.341-21.31S82.228 12.26 70.437 12.26h-36.62c-11.787 0-21.342 9.576-21.342 21.362S22.03 54.93 33.816 54.93zm240.78 11.628c-18.204 0-32.99-14.732-32.99-32.937c0-18.206 14.786-32.99 32.99-32.99h45.514l-7.42 11.628H312.06c-11.786 0-21.362 9.576-21.362 21.362s9.576 21.309 21.362 21.309h45.723l-7.472 11.628zm155.06-11.628c-9.734 0-17.995-6.524-20.52-15.522h54.194l7.471-11.628h-61.665c2.525-8.945 10.786-15.521 20.52-15.521h37.2L511 .63h-45.565c-18.205 0-32.99 14.785-32.99 32.99s14.785 32.938 32.99 32.938h39.094L512 54.931z"/></svg>