@servicenow/sdk-build-plugins 4.6.0 → 4.7.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.
Files changed (286) hide show
  1. package/dist/acl-plugin.js +3 -4
  2. package/dist/acl-plugin.js.map +1 -1
  3. package/dist/applicability-plugin.js +0 -2
  4. package/dist/applicability-plugin.js.map +1 -1
  5. package/dist/application-menu-plugin.js +0 -2
  6. package/dist/application-menu-plugin.js.map +1 -1
  7. package/dist/arrow-function-plugin.js +0 -1
  8. package/dist/arrow-function-plugin.js.map +1 -1
  9. package/dist/atf/test-plugin.js +6 -10
  10. package/dist/atf/test-plugin.js.map +1 -1
  11. package/dist/basic-syntax-plugin.js +10 -4
  12. package/dist/basic-syntax-plugin.js.map +1 -1
  13. package/dist/business-rule-plugin.js +0 -1
  14. package/dist/business-rule-plugin.js.map +1 -1
  15. package/dist/call-expression-plugin.js +0 -1
  16. package/dist/call-expression-plugin.js.map +1 -1
  17. package/dist/claims-plugin.js +0 -1
  18. package/dist/claims-plugin.js.map +1 -1
  19. package/dist/client-script-plugin.js +0 -1
  20. package/dist/client-script-plugin.js.map +1 -1
  21. package/dist/column-plugin.js +120 -49
  22. package/dist/column-plugin.js.map +1 -1
  23. package/dist/cross-scope-privilege-plugin.js +0 -1
  24. package/dist/cross-scope-privilege-plugin.js.map +1 -1
  25. package/dist/dashboard/dashboard-plugin.js +0 -2
  26. package/dist/dashboard/dashboard-plugin.js.map +1 -1
  27. package/dist/data-plugin.js +0 -1
  28. package/dist/data-plugin.js.map +1 -1
  29. package/dist/data-policy-plugin.d.ts +2 -0
  30. package/dist/data-policy-plugin.js +276 -0
  31. package/dist/data-policy-plugin.js.map +1 -0
  32. package/dist/email-notification-plugin.js +2 -3
  33. package/dist/email-notification-plugin.js.map +1 -1
  34. package/dist/flow/flow-logic/flow-logic-constants.d.ts +2 -0
  35. package/dist/flow/flow-logic/flow-logic-constants.js +6 -1
  36. package/dist/flow/flow-logic/flow-logic-constants.js.map +1 -1
  37. package/dist/flow/flow-logic/flow-logic-diagnostics.js +192 -56
  38. package/dist/flow/flow-logic/flow-logic-diagnostics.js.map +1 -1
  39. package/dist/flow/flow-logic/flow-logic-plugin-helpers.d.ts +2 -1
  40. package/dist/flow/flow-logic/flow-logic-plugin-helpers.js +44 -5
  41. package/dist/flow/flow-logic/flow-logic-plugin-helpers.js.map +1 -1
  42. package/dist/flow/flow-logic/flow-logic-plugin.js +279 -29
  43. package/dist/flow/flow-logic/flow-logic-plugin.js.map +1 -1
  44. package/dist/flow/flow-logic/flow-logic-shapes.d.ts +15 -0
  45. package/dist/flow/flow-logic/flow-logic-shapes.js +25 -1
  46. package/dist/flow/flow-logic/flow-logic-shapes.js.map +1 -1
  47. package/dist/flow/plugins/approval-rules-plugin.js +0 -1
  48. package/dist/flow/plugins/approval-rules-plugin.js.map +1 -1
  49. package/dist/flow/plugins/flow-action-definition-plugin.js +804 -205
  50. package/dist/flow/plugins/flow-action-definition-plugin.js.map +1 -1
  51. package/dist/flow/plugins/flow-data-pill-plugin.js +3 -5
  52. package/dist/flow/plugins/flow-data-pill-plugin.js.map +1 -1
  53. package/dist/flow/plugins/flow-definition-plugin.js +84 -17
  54. package/dist/flow/plugins/flow-definition-plugin.js.map +1 -1
  55. package/dist/flow/plugins/flow-diagnostics-plugin.js +65 -3
  56. package/dist/flow/plugins/flow-diagnostics-plugin.js.map +1 -1
  57. package/dist/flow/plugins/flow-instance-plugin.js +13 -5
  58. package/dist/flow/plugins/flow-instance-plugin.js.map +1 -1
  59. package/dist/flow/plugins/flow-trigger-instance-plugin.js +0 -1
  60. package/dist/flow/plugins/flow-trigger-instance-plugin.js.map +1 -1
  61. package/dist/flow/plugins/inline-script-plugin.js +0 -1
  62. package/dist/flow/plugins/inline-script-plugin.js.map +1 -1
  63. package/dist/flow/plugins/step-definition-plugin.js +0 -2
  64. package/dist/flow/plugins/step-definition-plugin.js.map +1 -1
  65. package/dist/flow/plugins/step-instance-plugin.js +216 -77
  66. package/dist/flow/plugins/step-instance-plugin.js.map +1 -1
  67. package/dist/flow/plugins/trigger-plugin.js +0 -2
  68. package/dist/flow/plugins/trigger-plugin.js.map +1 -1
  69. package/dist/flow/plugins/wfa-datapill-plugin.js +0 -1
  70. package/dist/flow/plugins/wfa-datapill-plugin.js.map +1 -1
  71. package/dist/flow/utils/datapill-transformer.js +9 -5
  72. package/dist/flow/utils/datapill-transformer.js.map +1 -1
  73. package/dist/flow/utils/flow-constants.d.ts +12 -0
  74. package/dist/flow/utils/flow-constants.js +17 -3
  75. package/dist/flow/utils/flow-constants.js.map +1 -1
  76. package/dist/flow/utils/flow-io-to-record.d.ts +1 -1
  77. package/dist/flow/utils/flow-io-to-record.js +21 -13
  78. package/dist/flow/utils/flow-io-to-record.js.map +1 -1
  79. package/dist/flow/utils/flow-pill-utils.d.ts +26 -0
  80. package/dist/flow/utils/flow-pill-utils.js +50 -0
  81. package/dist/flow/utils/flow-pill-utils.js.map +1 -0
  82. package/dist/flow/utils/flow-stage-processor.d.ts +138 -0
  83. package/dist/flow/utils/flow-stage-processor.js +665 -0
  84. package/dist/flow/utils/flow-stage-processor.js.map +1 -0
  85. package/dist/flow/utils/pill-string-parser.js +28 -43
  86. package/dist/flow/utils/pill-string-parser.js.map +1 -1
  87. package/dist/flow/utils/utils.d.ts +11 -6
  88. package/dist/flow/utils/utils.js +37 -28
  89. package/dist/flow/utils/utils.js.map +1 -1
  90. package/dist/form-plugin.js +4 -14
  91. package/dist/form-plugin.js.map +1 -1
  92. package/dist/html-import-plugin.js +0 -1
  93. package/dist/html-import-plugin.js.map +1 -1
  94. package/dist/import-sets-plugin.js +0 -2
  95. package/dist/import-sets-plugin.js.map +1 -1
  96. package/dist/inbound-email-action-plugin.js +0 -1
  97. package/dist/inbound-email-action-plugin.js.map +1 -1
  98. package/dist/index.d.ts +2 -1
  99. package/dist/index.js +5 -1
  100. package/dist/index.js.map +1 -1
  101. package/dist/instance-scan-plugin.js +0 -7
  102. package/dist/instance-scan-plugin.js.map +1 -1
  103. package/dist/json-plugin.js +0 -1
  104. package/dist/json-plugin.js.map +1 -1
  105. package/dist/list-plugin.js +4 -1
  106. package/dist/list-plugin.js.map +1 -1
  107. package/dist/now-attach-plugin.js +0 -1
  108. package/dist/now-attach-plugin.js.map +1 -1
  109. package/dist/now-config-plugin.js +1 -1
  110. package/dist/now-config-plugin.js.map +1 -1
  111. package/dist/now-id-plugin.js +0 -1
  112. package/dist/now-id-plugin.js.map +1 -1
  113. package/dist/now-include-plugin.js +0 -1
  114. package/dist/now-include-plugin.js.map +1 -1
  115. package/dist/now-ref-plugin.js +0 -1
  116. package/dist/now-ref-plugin.js.map +1 -1
  117. package/dist/now-unresolved-plugin.js +0 -1
  118. package/dist/now-unresolved-plugin.js.map +1 -1
  119. package/dist/package-json-plugin.js +3 -2
  120. package/dist/package-json-plugin.js.map +1 -1
  121. package/dist/property-plugin.js +0 -2
  122. package/dist/property-plugin.js.map +1 -1
  123. package/dist/record-plugin.d.ts +2 -0
  124. package/dist/record-plugin.js +5 -4
  125. package/dist/record-plugin.js.map +1 -1
  126. package/dist/repack/lint/Rules.d.ts +1 -2
  127. package/dist/rest-api-plugin.js +6 -5
  128. package/dist/rest-api-plugin.js.map +1 -1
  129. package/dist/role-plugin.js +0 -1
  130. package/dist/role-plugin.js.map +1 -1
  131. package/dist/schedule-script/scheduled-script-plugin.js +5 -4
  132. package/dist/schedule-script/scheduled-script-plugin.js.map +1 -1
  133. package/dist/script-action-plugin.js +0 -2
  134. package/dist/script-action-plugin.js.map +1 -1
  135. package/dist/script-include-plugin.js +4 -4
  136. package/dist/script-include-plugin.js.map +1 -1
  137. package/dist/server-module-plugin/index.js +2 -3
  138. package/dist/server-module-plugin/index.js.map +1 -1
  139. package/dist/service-catalog/catalog-clientscript-plugin.js +2 -4
  140. package/dist/service-catalog/catalog-clientscript-plugin.js.map +1 -1
  141. package/dist/service-catalog/catalog-item-plugin.js +0 -2
  142. package/dist/service-catalog/catalog-item-plugin.js.map +1 -1
  143. package/dist/service-catalog/catalog-ui-policy-plugin.js +2 -4
  144. package/dist/service-catalog/catalog-ui-policy-plugin.js.map +1 -1
  145. package/dist/service-catalog/sc-record-producer-plugin.js +0 -2
  146. package/dist/service-catalog/sc-record-producer-plugin.js.map +1 -1
  147. package/dist/service-catalog/service-catalog-base.d.ts +2 -2
  148. package/dist/service-catalog/service-catalog-base.js +2 -2
  149. package/dist/service-catalog/service-catalog-base.js.map +1 -1
  150. package/dist/service-catalog/utils.js +1 -1
  151. package/dist/service-catalog/utils.js.map +1 -1
  152. package/dist/service-catalog/variable-set-plugin.js +0 -2
  153. package/dist/service-catalog/variable-set-plugin.js.map +1 -1
  154. package/dist/service-portal/angular-provider-plugin.js +0 -2
  155. package/dist/service-portal/angular-provider-plugin.js.map +1 -1
  156. package/dist/service-portal/dependency-plugin.js +3 -5
  157. package/dist/service-portal/dependency-plugin.js.map +1 -1
  158. package/dist/service-portal/header-footer-plugin.js +3 -5
  159. package/dist/service-portal/header-footer-plugin.js.map +1 -1
  160. package/dist/service-portal/menu-plugin.js +0 -1
  161. package/dist/service-portal/menu-plugin.js.map +1 -1
  162. package/dist/service-portal/page-plugin.js +0 -1
  163. package/dist/service-portal/page-plugin.js.map +1 -1
  164. package/dist/service-portal/page-route-map-plugin.js +0 -1
  165. package/dist/service-portal/page-route-map-plugin.js.map +1 -1
  166. package/dist/service-portal/portal-plugin.js +0 -2
  167. package/dist/service-portal/portal-plugin.js.map +1 -1
  168. package/dist/service-portal/theme-plugin.js +0 -2
  169. package/dist/service-portal/theme-plugin.js.map +1 -1
  170. package/dist/service-portal/widget-plugin.js +3 -5
  171. package/dist/service-portal/widget-plugin.js.map +1 -1
  172. package/dist/sla-plugin.js +0 -2
  173. package/dist/sla-plugin.js.map +1 -1
  174. package/dist/static-content-plugin.js +32 -3
  175. package/dist/static-content-plugin.js.map +1 -1
  176. package/dist/table-plugin.js +303 -66
  177. package/dist/table-plugin.js.map +1 -1
  178. package/dist/ui-action-plugin.js +26 -17
  179. package/dist/ui-action-plugin.js.map +1 -1
  180. package/dist/ui-page-plugin.js +159 -17
  181. package/dist/ui-page-plugin.js.map +1 -1
  182. package/dist/ui-policy-plugin.js +28 -97
  183. package/dist/ui-policy-plugin.js.map +1 -1
  184. package/dist/user-preference-plugin.js +0 -2
  185. package/dist/user-preference-plugin.js.map +1 -1
  186. package/dist/utils.d.ts +5 -9
  187. package/dist/utils.js +38 -11
  188. package/dist/utils.js.map +1 -1
  189. package/dist/ux-list-menu-config-plugin.js +0 -2
  190. package/dist/ux-list-menu-config-plugin.js.map +1 -1
  191. package/dist/view-plugin.js +0 -1
  192. package/dist/view-plugin.js.map +1 -1
  193. package/dist/workspace-plugin.js +0 -2
  194. package/dist/workspace-plugin.js.map +1 -1
  195. package/package.json +6 -6
  196. package/src/acl-plugin.ts +4 -5
  197. package/src/applicability-plugin.ts +0 -2
  198. package/src/application-menu-plugin.ts +0 -2
  199. package/src/arrow-function-plugin.ts +0 -1
  200. package/src/atf/test-plugin.ts +6 -11
  201. package/src/basic-syntax-plugin.ts +11 -4
  202. package/src/business-rule-plugin.ts +1 -2
  203. package/src/call-expression-plugin.ts +0 -1
  204. package/src/claims-plugin.ts +0 -1
  205. package/src/client-script-plugin.ts +1 -2
  206. package/src/column-plugin.ts +163 -76
  207. package/src/cross-scope-privilege-plugin.ts +1 -2
  208. package/src/dashboard/dashboard-plugin.ts +0 -2
  209. package/src/data-plugin.ts +0 -1
  210. package/src/data-policy-plugin.ts +333 -0
  211. package/src/email-notification-plugin.ts +8 -4
  212. package/src/flow/flow-logic/flow-logic-constants.ts +6 -0
  213. package/src/flow/flow-logic/flow-logic-diagnostics.ts +236 -58
  214. package/src/flow/flow-logic/flow-logic-plugin-helpers.ts +59 -6
  215. package/src/flow/flow-logic/flow-logic-plugin.ts +368 -38
  216. package/src/flow/flow-logic/flow-logic-shapes.ts +25 -0
  217. package/src/flow/plugins/approval-rules-plugin.ts +0 -1
  218. package/src/flow/plugins/flow-action-definition-plugin.ts +940 -208
  219. package/src/flow/plugins/flow-data-pill-plugin.ts +3 -5
  220. package/src/flow/plugins/flow-definition-plugin.ts +159 -26
  221. package/src/flow/plugins/flow-diagnostics-plugin.ts +89 -3
  222. package/src/flow/plugins/flow-instance-plugin.ts +26 -12
  223. package/src/flow/plugins/flow-trigger-instance-plugin.ts +0 -1
  224. package/src/flow/plugins/inline-script-plugin.ts +0 -1
  225. package/src/flow/plugins/step-definition-plugin.ts +0 -2
  226. package/src/flow/plugins/step-instance-plugin.ts +259 -65
  227. package/src/flow/plugins/trigger-plugin.ts +0 -2
  228. package/src/flow/plugins/wfa-datapill-plugin.ts +0 -1
  229. package/src/flow/utils/datapill-transformer.ts +13 -5
  230. package/src/flow/utils/flow-constants.ts +19 -1
  231. package/src/flow/utils/flow-io-to-record.ts +29 -19
  232. package/src/flow/utils/flow-pill-utils.ts +48 -0
  233. package/src/flow/utils/flow-stage-processor.ts +831 -0
  234. package/src/flow/utils/pill-string-parser.ts +29 -47
  235. package/src/flow/utils/utils.ts +39 -35
  236. package/src/form-plugin.ts +5 -15
  237. package/src/html-import-plugin.ts +0 -1
  238. package/src/import-sets-plugin.ts +0 -2
  239. package/src/inbound-email-action-plugin.ts +1 -2
  240. package/src/index.ts +7 -1
  241. package/src/instance-scan-plugin.ts +0 -7
  242. package/src/json-plugin.ts +0 -1
  243. package/src/list-plugin.ts +6 -2
  244. package/src/now-attach-plugin.ts +0 -1
  245. package/src/now-config-plugin.ts +1 -1
  246. package/src/now-id-plugin.ts +0 -1
  247. package/src/now-include-plugin.ts +0 -1
  248. package/src/now-ref-plugin.ts +0 -1
  249. package/src/now-unresolved-plugin.ts +0 -1
  250. package/src/package-json-plugin.ts +8 -3
  251. package/src/property-plugin.ts +0 -2
  252. package/src/record-plugin.ts +14 -6
  253. package/src/repack/lint/Rules.ts +1 -1
  254. package/src/rest-api-plugin.ts +7 -6
  255. package/src/role-plugin.ts +1 -2
  256. package/src/schedule-script/scheduled-script-plugin.ts +11 -5
  257. package/src/script-action-plugin.ts +0 -2
  258. package/src/script-include-plugin.ts +8 -4
  259. package/src/server-module-plugin/index.ts +2 -3
  260. package/src/service-catalog/catalog-clientscript-plugin.ts +2 -4
  261. package/src/service-catalog/catalog-item-plugin.ts +0 -2
  262. package/src/service-catalog/catalog-ui-policy-plugin.ts +2 -4
  263. package/src/service-catalog/sc-record-producer-plugin.ts +0 -2
  264. package/src/service-catalog/service-catalog-base.ts +2 -2
  265. package/src/service-catalog/utils.ts +1 -1
  266. package/src/service-catalog/variable-set-plugin.ts +0 -2
  267. package/src/service-portal/angular-provider-plugin.ts +0 -2
  268. package/src/service-portal/dependency-plugin.ts +0 -2
  269. package/src/service-portal/header-footer-plugin.ts +0 -2
  270. package/src/service-portal/menu-plugin.ts +1 -2
  271. package/src/service-portal/page-plugin.ts +1 -2
  272. package/src/service-portal/page-route-map-plugin.ts +1 -2
  273. package/src/service-portal/portal-plugin.ts +0 -2
  274. package/src/service-portal/theme-plugin.ts +0 -2
  275. package/src/service-portal/widget-plugin.ts +0 -2
  276. package/src/sla-plugin.ts +0 -2
  277. package/src/static-content-plugin.ts +37 -4
  278. package/src/table-plugin.ts +371 -92
  279. package/src/ui-action-plugin.ts +30 -17
  280. package/src/ui-page-plugin.ts +188 -20
  281. package/src/ui-policy-plugin.ts +33 -130
  282. package/src/user-preference-plugin.ts +0 -2
  283. package/src/utils.ts +48 -11
  284. package/src/ux-list-menu-config-plugin.ts +0 -2
  285. package/src/view-plugin.ts +0 -1
  286. package/src/workspace-plugin.ts +0 -2
@@ -13,7 +13,7 @@ import {
13
13
  import { ModuleFunctionShape } from './server-module-plugin'
14
14
  import { NowIdShape } from './now-id-plugin'
15
15
  import { NowIncludeShape } from './now-include-plugin'
16
- import { createSdkDocEntry, generateDeprecatedDiagnostics } from './utils'
16
+ import { generateDeprecatedDiagnostics } from './utils'
17
17
  import { RecordPlugin } from './record-plugin'
18
18
 
19
19
  const DEFAULT_MEDIA_TYPE = 'application/json,application/xml,text/xml'
@@ -24,11 +24,13 @@ const restDefAliases = {
24
24
  enforceAcl: ['enforce_acl'],
25
25
  docLink: ['doc_link'],
26
26
  shortDescription: ['short_description'],
27
+ protectionPolicy: ['policy'],
27
28
  }
28
29
  const routeAliases = {
29
30
  shortDescription: ['short_description'],
30
31
  requestExample: ['request_example'],
31
32
  enforceAcl: ['enforce_acl'],
33
+ protectionPolicy: ['policy'],
32
34
  }
33
35
  const versionAliases = {
34
36
  isDefault: ['is_default'],
@@ -286,7 +288,7 @@ async function generateRouteAndRouteAttrRecords(
286
288
  request_example: $.from('requestExample').def(''),
287
289
  web_service_definition: $.val(restDef.getId()),
288
290
  web_service_version: $.val(versionId),
289
- sys_policy: $.from('policy').def(''),
291
+ sys_policy: $.from('protectionPolicy').def(''),
290
292
  })),
291
293
  })
292
294
 
@@ -436,7 +438,6 @@ function versionsTransform(versions: Record[]) {
436
438
 
437
439
  export const RestApiPlugin = Plugin.create({
438
440
  name: 'RestApiPlugin',
439
- docs: [createSdkDocEntry('RestApi', ['sys_ws_definition'])],
440
441
  records: {
441
442
  sys_ws_header_map: {
442
443
  coalesce: ['web_service_operation', 'web_service_header'],
@@ -517,7 +518,7 @@ export const RestApiPlugin = Plugin.create({
517
518
  internalRole: $.from('requires_snc_internal_role').toBoolean().def(true),
518
519
  shortDescription: $.from('short_description').def(''),
519
520
  requestExample: $.from('request_example').def(''),
520
- policy: $.from('sys_policy').def(''),
521
+ protectionPolicy: $.from('sys_policy').def(''),
521
522
  parameters: $.val(
522
523
  routeAttributeTransform(
523
524
  paramRouteAssociations,
@@ -556,7 +557,7 @@ export const RestApiPlugin = Plugin.create({
556
557
  .def([DEFAULT_REST_ENFORCED_ACL]),
557
558
  serviceId: $.from('service_id'),
558
559
  shortDescription: $.from('short_description').def(''),
559
- policy: $.from('sys_policy').def(''),
560
+ protectionPolicy: $.from('sys_policy').def(''),
560
561
  docLink: $.from('doc_link').def(''),
561
562
  routes: $.val(routesWithScript).def([]),
562
563
  versions: $.val(versionsTransform(versions)).def([]),
@@ -650,7 +651,7 @@ export const RestApiPlugin = Plugin.create({
650
651
  produces_customized: $.from('produces').map((v) =>
651
652
  v.isString() ? v.getValue() !== DEFAULT_MEDIA_TYPE : false
652
653
  ),
653
- sys_policy: $.from('policy').def(''),
654
+ sys_policy: $.from('protectionPolicy').def(''),
654
655
  enforce_acl: $.val(mergeAcls(enforceAcls)),
655
656
  })),
656
657
  })
@@ -1,6 +1,6 @@
1
1
  import { isSNScope, type Record } from '@servicenow/sdk-build-core'
2
2
  import { CallExpressionShape, Plugin } from '@servicenow/sdk-build-core'
3
- import { createSdkDocEntry, generateDeprecatedDiagnostics } from './utils'
3
+ import { generateDeprecatedDiagnostics } from './utils'
4
4
 
5
5
  const roleAliases = {
6
6
  canDelegate: ['can_delegate'],
@@ -12,7 +12,6 @@ const roleAliases = {
12
12
 
13
13
  export const RolePlugin = Plugin.create({
14
14
  name: 'RolePlugin',
15
- docs: [createSdkDocEntry('Role', ['sys_user_role'])],
16
15
  records: {
17
16
  sys_user_role: {
18
17
  relationships: {
@@ -10,7 +10,7 @@ import {
10
10
  import { NowIdShape } from '../now-id-plugin'
11
11
  import { NowIncludeShape } from '../now-include-plugin'
12
12
  import { ModuleFunctionShape } from '../server-module-plugin'
13
- import { createSdkDocEntry, toReference } from '../utils'
13
+ import { toReference } from '../utils'
14
14
  import { dateTimeFieldToXML, convertXMLToDateTime, formatTimeDataToDateTime, formatToUTC } from './timeZoneConverter'
15
15
 
16
16
  const DEFAULT_DATE_TIME = '1970-01-01 00:00:00'
@@ -289,7 +289,6 @@ function validateRecurringJobSchedule(
289
289
 
290
290
  export const ScheduledScriptPlugin = Plugin.create({
291
291
  name: 'ScheduledScriptPlugin',
292
- docs: [createSdkDocEntry('ScheduledScript', ['sysauto_script'])],
293
292
  records: {
294
293
  sysauto_script: {
295
294
  async toShape(record, { transform }) {
@@ -469,9 +468,16 @@ export const ScheduledScriptPlugin = Plugin.create({
469
468
  )
470
469
  }
471
470
 
472
- // Validate daysOfWeek is defined when frequency is 'weekly'
473
- if (frequency === 'weekly' && args.get('daysOfWeek').isUndefined()) {
474
- diagnostics.error(args.get('frequency'), `daysOfWeek must be defined when frequency is 'weekly'`)
471
+ // Validate dayOfWeek or daysOfWeek is defined when frequency is 'weekly'
472
+ if (
473
+ frequency === 'weekly' &&
474
+ args.get('daysOfWeek').isUndefined() &&
475
+ args.get('dayOfWeek').isUndefined()
476
+ ) {
477
+ diagnostics.error(
478
+ args.get('frequency'),
479
+ `dayOfWeek or daysOfWeek must be defined when frequency is 'weekly'`
480
+ )
475
481
  }
476
482
 
477
483
  // Validate businessCalendar is not empty when frequency is business calendar related
@@ -1,11 +1,9 @@
1
1
  import { CallExpressionShape, Plugin } from '@servicenow/sdk-build-core'
2
2
  import { NowIdShape } from './now-id-plugin'
3
3
  import { ModuleFunctionShape } from './server-module-plugin'
4
- import { createSdkDocEntry } from './utils'
5
4
 
6
5
  export const ScriptActionPlugin = Plugin.create({
7
6
  name: 'ScriptActionPlugin',
8
- docs: [createSdkDocEntry('ScriptAction', ['sysevent_script_action'])],
9
7
  records: {
10
8
  sysevent_script_action: {
11
9
  toShape(record) {
@@ -1,13 +1,11 @@
1
1
  import { CallExpressionShape, isSNScope, Plugin } from '@servicenow/sdk-build-core'
2
2
  import { NowIdShape } from './now-id-plugin'
3
3
  import { NowIncludeShape } from './now-include-plugin'
4
- import { createSdkDocEntry } from './utils'
5
4
 
6
5
  const nameRegex = /^[a-zA-Z_$][0-9a-zA-Z_$]+$/
7
6
 
8
7
  export const ScriptIncludePlugin = Plugin.create({
9
8
  name: `ScriptIncludePlugin`,
10
- docs: [createSdkDocEntry('ScriptInclude', ['sys_script_include'])],
11
9
  records: {
12
10
  sys_script_include: {
13
11
  async toShape(record, { transform }) {
@@ -37,7 +35,6 @@ export const ScriptIncludePlugin = Plugin.create({
37
35
  sandboxCallable: $.from('sandbox_callable').toBoolean(),
38
36
  accessibleFrom: $.from('access').def('package_private'),
39
37
  active: $.toBoolean(),
40
- protectionPolicy: $.from('sys_policy').def(''),
41
38
  })),
42
39
  ],
43
40
  }),
@@ -61,6 +58,14 @@ export const ScriptIncludePlugin = Plugin.create({
61
58
  diagnostics.error(name.getOriginalNode(), `name must be a valid JavaScript identifier`)
62
59
  }
63
60
 
61
+ const callerAccess = prop.get('callerAccess')
62
+ if (callerAccess.isDefined() && prop.get('accessibleFrom').ifString()?.getValue() !== 'public') {
63
+ diagnostics.hint(
64
+ callerAccess.getOriginalNode(),
65
+ `'callerAccess' is only effective when 'accessibleFrom' is set to 'public'. It is ignored by the platform otherwise.`
66
+ )
67
+ }
68
+
64
69
  const apiName = prop.get('apiName')
65
70
 
66
71
  if (apiName.isDefined()) {
@@ -104,7 +109,6 @@ export const ScriptIncludePlugin = Plugin.create({
104
109
  sandbox_callable: $.from('sandboxCallable').def(false),
105
110
  access: $.from('accessibleFrom').def('package_private'),
106
111
  active: $.def(true),
107
- sys_policy: $.from('protectionPolicy'),
108
112
  }
109
113
  }),
110
114
  }),
@@ -351,7 +351,6 @@ function getModuleDependencyPath(
351
351
 
352
352
  export const ServerModulePlugin = Plugin.create({
353
353
  name: 'ServerModulePlugin',
354
- docs: [],
355
354
  files: [
356
355
  {
357
356
  entryPoint: true,
@@ -434,7 +433,7 @@ export const ServerModulePlugin = Plugin.create({
434
433
  }
435
434
 
436
435
  // Lint local module for Rhino compatibility (no Glide restrictions)
437
- if (/\.(js|cjs|mjs|ts)$/.test(pathModule.extname(resolvedPath))) {
436
+ if (config.linter.module.enabled && /\.(js|cjs|mjs|ts)$/.test(pathModule.extname(resolvedPath))) {
438
437
  const { LocalModuleLint } = await import('../repack/lint/index.js')
439
438
  const lint = new LocalModuleLint()
440
439
  const lintResult = lint.check(content)
@@ -511,7 +510,7 @@ export const ServerModulePlugin = Plugin.create({
511
510
  )
512
511
  for (const file of files) {
513
512
  const fileContent = fs.readFileSync(pathModule.join(packagePath, file)).toString('utf-8')
514
- if (/\.(js|cjs|mjs)$/.test(pathModule.extname(file))) {
513
+ if (config.linter.module.enabled && /\.(js|cjs|mjs)$/.test(pathModule.extname(file))) {
515
514
  const result = lint.check(fileContent)
516
515
  if (result) {
517
516
  logger.warn(`Use of unsupported APIs detected in npm dependency ${name}`)
@@ -11,11 +11,9 @@ import {
11
11
  resolveAndValidateVariableId,
12
12
  } from './utils'
13
13
  import { validateCatalogItemVariableSetExclusivity } from './service-catalog-diagnostics'
14
- import { createSdkDocEntry } from '../utils'
15
14
 
16
15
  export const CatalogClientScriptPlugin = Plugin.create({
17
16
  name: 'CatalogClientScriptPlugin',
18
- docs: [createSdkDocEntry('CatalogClientScript', ['catalog_script_client'])],
19
17
  records: {
20
18
  catalog_script_client: {
21
19
  async toShape(record, { database, transform }) {
@@ -58,7 +56,7 @@ export const CatalogClientScriptPlugin = Plugin.create({
58
56
  .map((v) =>
59
57
  v.ifString()?.isEmpty() ? undefined : getUITypeFromId(v.toNumber()?.getValue())
60
58
  )
61
- .def('desktop'),
59
+ .def('all'),
62
60
  catalogItem: $.val(catalogItemReference).def(''),
63
61
  variableName: $.val(propertyAccess).def(''),
64
62
  variableSet: $.val(variableSetReference).def(''),
@@ -130,7 +128,7 @@ export const CatalogClientScriptPlugin = Plugin.create({
130
128
  isolate_script: $.from('isolateScript').def(true),
131
129
  ui_type: $.from('uiType')
132
130
  .map((v) => (v.isString() && !v.isEmpty() ? getUITypeId(v.getValue()) : undefined))
133
- .def(0),
131
+ .def(10),
134
132
  va_supported: $.from('vaSupported').toBoolean().def(false),
135
133
  published_ref: $.from('publishedRef').def(''),
136
134
  })),
@@ -14,7 +14,6 @@ import {
14
14
  createScript,
15
15
  } from './utils'
16
16
  import { validateFulfillmentProcessExclusivity, validateCategoriesRequireCatalogs } from './service-catalog-diagnostics'
17
- import { createSdkDocEntry } from '../utils'
18
17
  import {
19
18
  buildVariablesSchema,
20
19
  CatalogItemBaseRelationships,
@@ -28,7 +27,6 @@ import {
28
27
 
29
28
  export const CatalogItemPlugin = Plugin.create({
30
29
  name: 'CatalogItemPlugin',
31
- docs: [createSdkDocEntry('CatalogItem', ['sc_cat_item'])],
32
30
  records: {
33
31
  sc_cat_item: {
34
32
  relationships: CatalogItemBaseRelationships,
@@ -25,7 +25,6 @@ import {
25
25
  getValueActionToDb,
26
26
  } from './utils'
27
27
  import { validateCatalogItemVariableSetExclusivity, validateUiPolicyActionMessage } from './service-catalog-diagnostics'
28
- import { createSdkDocEntry } from '../utils'
29
28
 
30
29
  // Define table names as constants since they're not exported from the core tables
31
30
  const CATALOG_UI_POLICY = 'catalog_ui_policy'
@@ -51,7 +50,6 @@ const stripIOPrefix = (value: string): string => {
51
50
 
52
51
  export const CatalogUiPolicyPlugin = Plugin.create({
53
52
  name: 'CatalogUiPolicyPlugin',
54
- docs: [createSdkDocEntry('CatalogUiPolicy', ['catalog_ui_policy'])],
55
53
  records: {
56
54
  [CATALOG_UI_POLICY]: {
57
55
  relationships: {
@@ -166,7 +164,7 @@ export const CatalogUiPolicyPlugin = Plugin.create({
166
164
  .map((v) =>
167
165
  v.ifString()?.isEmpty() ? undefined : getUITypeFromId(v.toNumber()?.getValue())
168
166
  )
169
- .def('desktop'),
167
+ .def('all'),
170
168
  actions: $.val(actions.length > 0 ? actions : []).def([]),
171
169
  })),
172
170
  ],
@@ -239,7 +237,7 @@ export const CatalogUiPolicyPlugin = Plugin.create({
239
237
  published_ref: $.from('publishedRef').def(''),
240
238
  ui_type: $.from('runScriptsInUiType')
241
239
  .map((v) => (v.isString() && !v.isEmpty() ? getUITypeId(v.getValue()) : undefined))
242
- .def(0),
240
+ .def(10),
243
241
  table: $.def(''),
244
242
  va_supported: $.from('vaSupported').def(true),
245
243
  view: $.def(''),
@@ -28,11 +28,9 @@ import {
28
28
  } from './service-catalog-base'
29
29
  import { validateFulfillmentProcessExclusivity, validateCategoriesRequireCatalogs } from './service-catalog-diagnostics'
30
30
  import { ModuleFunctionShape } from '../server-module-plugin'
31
- import { createSdkDocEntry } from '../utils'
32
31
 
33
32
  export const CatalogItemRecordProducerPlugin = Plugin.create({
34
33
  name: 'CatalogItemRecordProducerPlugin',
35
- docs: [createSdkDocEntry('CatalogItemRecordProducer', ['sc_cat_item_producer'])],
36
34
  records: {
37
35
  sc_cat_item_producer: {
38
36
  relationships: CatalogItemBaseRelationships,
@@ -266,6 +266,7 @@ export function transformCatalogBaseFieldsToShape(record: Record, $: ShapeTransf
266
266
  .map((v: Shape) => getMobilePictureTypeFromDb(v.toString().getValue()))
267
267
  .def('desktopPicture'),
268
268
  makeItemNonConversational: $.from('make_item_non_conversational').toBoolean().def(false),
269
+ noSearch: $.from('no_search').toBoolean().def(false),
269
270
  }
270
271
  }
271
272
 
@@ -349,6 +350,7 @@ export function transformCatalogItemBaseFieldsToRecord($: ShapeTransform) {
349
350
  .map((v: Shape) => getMobilePictureTypeToDb(v.toString().getValue()))
350
351
  .def('use_desktop_picture'),
351
352
  make_item_non_conversational: $.from('makeItemNonConversational').def(false),
353
+ no_search: $.from('noSearch').def(false),
352
354
  }
353
355
  }
354
356
 
@@ -406,7 +408,6 @@ export function transformCatalogItemSpecificFieldsToShape(record: Record, $: Sha
406
408
  noOrderNow: $.from('no_order_now').toBoolean().def(false),
407
409
  noProceedCheckout: $.from('no_proceed_checkout').toBoolean().def(false),
408
410
  noQuantity: $.from('no_quantity').toBoolean().def(false),
409
- noSearch: $.from('no_search').toBoolean().def(false),
410
411
 
411
412
  // Additional fields
412
413
  vendor: $.def(''),
@@ -468,7 +469,6 @@ export function transformCatalogItemSpecificFieldsToRecord(arg: ObjectShape, $:
468
469
  no_order_now: $.from('noOrderNow').def(false),
469
470
  no_proceed_checkout: $.from('noProceedCheckout').def(false),
470
471
  no_quantity: $.from('noQuantity').def(false),
471
- no_search: $.from('noSearch').def(false),
472
472
 
473
473
  // Additional
474
474
  vendor: $.def(''),
@@ -318,7 +318,7 @@ export function getUITypeId(value: string): number {
318
318
  case 'all':
319
319
  return 10
320
320
  default:
321
- return 0 // Default to desktop
321
+ return 10 // Default to all
322
322
  }
323
323
  }
324
324
 
@@ -20,11 +20,9 @@ import {
20
20
  getVariableSetTypeFromDb,
21
21
  getVariableSetTypeToDb,
22
22
  } from './utils'
23
- import { createSdkDocEntry } from '../utils'
24
23
 
25
24
  export const VariableSetPlugin = Plugin.create({
26
25
  name: 'VariableSetPlugin',
27
- docs: [createSdkDocEntry('VariableSet', ['item_option_new_set'])],
28
26
  records: {
29
27
  item_option_new_set: {
30
28
  relationships: {
@@ -1,10 +1,8 @@
1
1
  import { CallExpressionShape, Plugin } from '@servicenow/sdk-build-core'
2
2
  import { NowIdShape } from '../now-id-plugin'
3
- import { createSdkDocEntry } from '../utils'
4
3
 
5
4
  export const SPAngularProviderPlugin = Plugin.create({
6
5
  name: 'SPAngularProviderPlugin',
7
- docs: [createSdkDocEntry('SPAngularProvider', ['sp_angular_provider'])],
8
6
  records: {
9
7
  sp_angular_provider: {
10
8
  relationships: {
@@ -1,12 +1,10 @@
1
1
  import { CallExpressionShape, Plugin } from '@servicenow/sdk-build-core'
2
2
  import { toReference } from '../utils'
3
3
  import { NowIdShape } from '../now-id-plugin'
4
- import { createSdkDocEntry } from '../utils'
5
4
  import { getIncludeRecords } from './utils'
6
5
 
7
6
  export const SPWidgetDependencyPlugin = Plugin.create({
8
7
  name: 'SPWidgetDependencyPlugin',
9
- docs: [createSdkDocEntry('SPWidgetDependency', ['sp_dependency'])],
10
8
  records: {
11
9
  sp_dependency: {
12
10
  relationships: {
@@ -1,5 +1,4 @@
1
1
  import { CallExpressionShape, Plugin } from '@servicenow/sdk-build-core'
2
- import { createSdkDocEntry } from '../utils'
3
2
  import { createWidgetToRecord, createWidgetToShape } from './utils'
4
3
  import {
5
4
  getDefaultClientScript,
@@ -10,7 +9,6 @@ import {
10
9
 
11
10
  export const SPHeaderFooterPlugin = Plugin.create({
12
11
  name: 'SPHeaderFooterPlugin',
13
- docs: [createSdkDocEntry('SPHeaderFooter', ['sp_header_footer'])],
14
12
  records: {
15
13
  sp_header_footer: {
16
14
  relationships: {
@@ -9,7 +9,7 @@ import {
9
9
  } from '@servicenow/sdk-build-core'
10
10
  import { NowIdShape } from '../now-id-plugin'
11
11
  import { NowIncludeShape } from '../now-include-plugin'
12
- import { toReference, getFieldAsNumber, noThrow, createSdkDocEntry } from '../utils'
12
+ import { toReference, getFieldAsNumber, noThrow } from '../utils'
13
13
  import { getRolesString } from './utils'
14
14
 
15
15
  const default_placeholder_dimensions = `{
@@ -219,7 +219,6 @@ async function createItemRecords(
219
219
 
220
220
  export const SPMenuPlugin = Plugin.create({
221
221
  name: 'SPMenuPlugin',
222
- docs: [createSdkDocEntry('SPMenu', ['sp_instance_menu'])],
223
222
  records: {
224
223
  sp_instance_menu: {
225
224
  relationships: {
@@ -9,7 +9,7 @@ import {
9
9
  type ObjectShape,
10
10
  } from '@servicenow/sdk-build-core'
11
11
  import isEmpty from 'lodash/isEmpty'
12
- import { toReference, getFieldAsNumber, createSdkDocEntry } from '../utils'
12
+ import { toReference, getFieldAsNumber } from '../utils'
13
13
  import { getRolesString } from './utils'
14
14
 
15
15
  type Dict = { [key: string]: unknown }
@@ -566,7 +566,6 @@ async function createInstanceRecords(instancesArray: Shape[], columnId: RecordId
566
566
 
567
567
  export const SPPagePlugin = Plugin.create({
568
568
  name: 'SPPagePlugin',
569
- docs: [createSdkDocEntry('SPPage', ['sp_page'])],
570
569
  records: {
571
570
  sp_page: {
572
571
  coalesce: ['id'],
@@ -1,6 +1,6 @@
1
1
  import { CallExpressionShape, Plugin, type Shape } from '@servicenow/sdk-build-core'
2
2
  import { NowIdShape } from '../now-id-plugin'
3
- import { toReference, createSdkDocEntry } from '../utils'
3
+ import { toReference } from '../utils'
4
4
  import { getRolesString } from './utils'
5
5
 
6
6
  function getPortalsString(portalsShape: Shape): string {
@@ -21,7 +21,6 @@ function getPortalsString(portalsShape: Shape): string {
21
21
 
22
22
  export const SPPageRouteMapPlugin = Plugin.create({
23
23
  name: 'SPPageRouteMapPlugin',
24
- docs: [createSdkDocEntry('SPPageRouteMap', ['sp_page_route_map'])],
25
24
  records: {
26
25
  sp_page_route_map: {
27
26
  coalesce: ['route_from_page', 'portals'],
@@ -1,6 +1,5 @@
1
1
  import { Plugin, CallExpressionShape, type Record, type Shape } from '@servicenow/sdk-build-core'
2
2
  import { NowIdShape } from '../now-id-plugin'
3
- import { createSdkDocEntry } from '../utils'
4
3
 
5
4
  function convertToNumber(value: Shape, defaultValue: number = 0): number {
6
5
  if (!value || value.isUndefined() || value.ifString()?.isEmpty()) {
@@ -11,7 +10,6 @@ function convertToNumber(value: Shape, defaultValue: number = 0): number {
11
10
 
12
11
  export const ServicePortalPlugin = Plugin.create({
13
12
  name: 'ServicePortalPlugin',
14
- docs: [createSdkDocEntry('ServicePortal', ['sp_portal'])],
15
13
  records: {
16
14
  sp_portal: {
17
15
  relationships: {
@@ -1,11 +1,9 @@
1
1
  import { CallExpressionShape, Plugin } from '@servicenow/sdk-build-core'
2
2
  import { NowIdShape } from '../now-id-plugin'
3
3
  import { DEFAULT_ORDER, getIncludeRecords } from './utils'
4
- import { createSdkDocEntry } from '../utils'
5
4
 
6
5
  export const SPThemePlugin = Plugin.create({
7
6
  name: 'SPThemePlugin',
8
- docs: [createSdkDocEntry('SPTheme', ['sp_theme'])],
9
7
  records: {
10
8
  sp_theme: {
11
9
  relationships: {
@@ -1,10 +1,8 @@
1
1
  import { CallExpressionShape, Plugin } from '@servicenow/sdk-build-core'
2
- import { createSdkDocEntry } from '../utils'
3
2
  import { createWidgetToRecord, createWidgetToShape } from './utils'
4
3
 
5
4
  export const SPWidgetPlugin = Plugin.create({
6
5
  name: 'SPWidgetPlugin',
7
- docs: [createSdkDocEntry('SPWidget', ['sp_widget'])],
8
6
  records: {
9
7
  sp_widget: {
10
8
  relationships: {
package/src/sla-plugin.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { CallExpressionShape, Plugin, DurationShape } from '@servicenow/sdk-build-core'
2
2
  import { NowIdShape } from './now-id-plugin'
3
- import { createSdkDocEntry } from './utils'
4
3
  import {
5
4
  validateUserSpecifiedDuration,
6
5
  validateRelativeDuration,
@@ -37,7 +36,6 @@ const DEFAULT_DURATION_ON_PLATFORM = '1970-01-01 00:00:00'
37
36
  */
38
37
  export const SLAPlugin = Plugin.create({
39
38
  name: 'SLAPlugin',
40
- docs: [createSdkDocEntry('Sla', ['contract_sla'])],
41
39
 
42
40
  records: {
43
41
  contract_sla: {
@@ -3,7 +3,7 @@ import * as mime from 'mime-types'
3
3
  import { Shape, Plugin, type Record, unloadBuilder, gzipSync, type RecordContext } from '@servicenow/sdk-build-core'
4
4
  import { path as pathModule } from '@servicenow/sdk-build-core'
5
5
  import { INVALID_XML_CHARACTERS } from './utils'
6
- import { TRANSLATIONS_ASSET_NAME } from '@servicenow/isomorphic-rollup'
6
+ import { TRANSLATIONS_SUFFIX } from '@servicenow/isomorphic-rollup'
7
7
 
8
8
  // based on tectonic code for attachments
9
9
  // https://code.devsnc.com/dev/sn-tectonic/blob/b3ab42ce742158cb5a0d00efd540b97eeafcbdd7/core/metadata-transform-san-diego/utils/index.js#L66
@@ -92,7 +92,6 @@ const toNoOpShape = (record: Record) => {
92
92
 
93
93
  export const StaticContentPlugin = Plugin.create({
94
94
  name: 'StaticContentPlugin',
95
- docs: [],
96
95
  records: {
97
96
  // TODO: remove when we have generic attachment support
98
97
  sys_attachment: {
@@ -102,6 +101,9 @@ export const StaticContentPlugin = Plugin.create({
102
101
  sys_attachment_doc: {
103
102
  toShape: toNoOpShape,
104
103
  },
104
+ sys_ui_message: {
105
+ toShape: toNoOpShape,
106
+ },
105
107
  sys_ux_lib_asset: {
106
108
  coalesce: ['name'],
107
109
  relationships: { ...attachmentRelationships, ...sourceArtifactRelationships },
@@ -167,8 +169,39 @@ export const StaticContentPlugin = Plugin.create({
167
169
  // Build-time manifest produced by the uiPageSourceManifest rollup plugin.
168
170
  // Consumed by UiPage during build to determine which source files to include
169
171
  // in the source artifact record. Not a deployable asset.
170
- } else if (relativePath === TRANSLATIONS_ASSET_NAME) {
171
- logger.debug('translations not supported yet')
172
+ } else if (relativePath.endsWith(TRANSLATIONS_SUFFIX)) {
173
+ // Build-time asset produced by collectSnTranslate() rollup plugin.
174
+ // Create sys_ui_message records for each collected translation message key.
175
+ // Messages can be plain strings (t('key')) or objects (t({ code, message, ... })).
176
+ const parsed = JSON.parse(stringFileContent) as {
177
+ messages: Array<string | { [key: string]: string }>
178
+ }
179
+ const { messages } = parsed
180
+ if (messages.length > 0) {
181
+ const messageRecords = await Promise.all(
182
+ messages.map((entry) => {
183
+ const key = typeof entry === 'string' ? entry : (entry['code'] ?? '')
184
+ const messageText = typeof entry === 'string' ? entry : (entry['message'] ?? key)
185
+ return factory.createRecord({
186
+ source: file,
187
+ explicitId: key,
188
+ table: 'sys_ui_message',
189
+ properties: {
190
+ code: config.scope,
191
+ key,
192
+ language: config.defaultLanguage,
193
+ message: messageText,
194
+ },
195
+ })
196
+ })
197
+ )
198
+ const [first, ...rest] = messageRecords
199
+ if (!first) {
200
+ return { success: false }
201
+ }
202
+ return { success: true, value: first.with(...rest) }
203
+ }
204
+ return { success: false }
172
205
  } else if (mimeType === 'application/javascript') {
173
206
  tableName = 'sys_ux_lib_asset'
174
207
  assetName = pathModule.join(