@servicenow/sdk-build-plugins 4.6.1 → 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 (279) hide show
  1. package/dist/acl-plugin.js +0 -3
  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 +0 -2
  10. package/dist/atf/test-plugin.js.map +1 -1
  11. package/dist/basic-syntax-plugin.js +0 -1
  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 +24 -7
  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 +0 -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 +2 -2
  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 +0 -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 +0 -2
  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 +0 -2
  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/variable-set-plugin.js +0 -2
  148. package/dist/service-catalog/variable-set-plugin.js.map +1 -1
  149. package/dist/service-portal/angular-provider-plugin.js +0 -2
  150. package/dist/service-portal/angular-provider-plugin.js.map +1 -1
  151. package/dist/service-portal/dependency-plugin.js +3 -5
  152. package/dist/service-portal/dependency-plugin.js.map +1 -1
  153. package/dist/service-portal/header-footer-plugin.js +3 -5
  154. package/dist/service-portal/header-footer-plugin.js.map +1 -1
  155. package/dist/service-portal/menu-plugin.js +0 -1
  156. package/dist/service-portal/menu-plugin.js.map +1 -1
  157. package/dist/service-portal/page-plugin.js +0 -1
  158. package/dist/service-portal/page-plugin.js.map +1 -1
  159. package/dist/service-portal/page-route-map-plugin.js +0 -1
  160. package/dist/service-portal/page-route-map-plugin.js.map +1 -1
  161. package/dist/service-portal/portal-plugin.js +0 -2
  162. package/dist/service-portal/portal-plugin.js.map +1 -1
  163. package/dist/service-portal/theme-plugin.js +0 -2
  164. package/dist/service-portal/theme-plugin.js.map +1 -1
  165. package/dist/service-portal/widget-plugin.js +3 -5
  166. package/dist/service-portal/widget-plugin.js.map +1 -1
  167. package/dist/sla-plugin.js +0 -2
  168. package/dist/sla-plugin.js.map +1 -1
  169. package/dist/static-content-plugin.js +32 -3
  170. package/dist/static-content-plugin.js.map +1 -1
  171. package/dist/table-plugin.js +102 -11
  172. package/dist/table-plugin.js.map +1 -1
  173. package/dist/ui-action-plugin.js +26 -17
  174. package/dist/ui-action-plugin.js.map +1 -1
  175. package/dist/ui-page-plugin.js +159 -17
  176. package/dist/ui-page-plugin.js.map +1 -1
  177. package/dist/ui-policy-plugin.js +0 -1
  178. package/dist/ui-policy-plugin.js.map +1 -1
  179. package/dist/user-preference-plugin.js +0 -2
  180. package/dist/user-preference-plugin.js.map +1 -1
  181. package/dist/utils.d.ts +1 -9
  182. package/dist/utils.js +0 -14
  183. package/dist/utils.js.map +1 -1
  184. package/dist/ux-list-menu-config-plugin.js +0 -2
  185. package/dist/ux-list-menu-config-plugin.js.map +1 -1
  186. package/dist/view-plugin.js +0 -1
  187. package/dist/view-plugin.js.map +1 -1
  188. package/dist/workspace-plugin.js +0 -2
  189. package/dist/workspace-plugin.js.map +1 -1
  190. package/package.json +6 -6
  191. package/src/acl-plugin.ts +1 -4
  192. package/src/applicability-plugin.ts +0 -2
  193. package/src/application-menu-plugin.ts +0 -2
  194. package/src/arrow-function-plugin.ts +0 -1
  195. package/src/atf/test-plugin.ts +0 -2
  196. package/src/basic-syntax-plugin.ts +0 -1
  197. package/src/business-rule-plugin.ts +1 -2
  198. package/src/call-expression-plugin.ts +0 -1
  199. package/src/claims-plugin.ts +0 -1
  200. package/src/client-script-plugin.ts +1 -2
  201. package/src/column-plugin.ts +29 -9
  202. package/src/cross-scope-privilege-plugin.ts +1 -2
  203. package/src/dashboard/dashboard-plugin.ts +0 -2
  204. package/src/data-plugin.ts +0 -1
  205. package/src/data-policy-plugin.ts +333 -0
  206. package/src/email-notification-plugin.ts +8 -4
  207. package/src/flow/flow-logic/flow-logic-constants.ts +6 -0
  208. package/src/flow/flow-logic/flow-logic-diagnostics.ts +236 -58
  209. package/src/flow/flow-logic/flow-logic-plugin-helpers.ts +59 -6
  210. package/src/flow/flow-logic/flow-logic-plugin.ts +368 -38
  211. package/src/flow/flow-logic/flow-logic-shapes.ts +25 -0
  212. package/src/flow/plugins/approval-rules-plugin.ts +0 -1
  213. package/src/flow/plugins/flow-action-definition-plugin.ts +940 -208
  214. package/src/flow/plugins/flow-data-pill-plugin.ts +3 -5
  215. package/src/flow/plugins/flow-definition-plugin.ts +159 -26
  216. package/src/flow/plugins/flow-diagnostics-plugin.ts +89 -3
  217. package/src/flow/plugins/flow-instance-plugin.ts +26 -12
  218. package/src/flow/plugins/flow-trigger-instance-plugin.ts +0 -1
  219. package/src/flow/plugins/inline-script-plugin.ts +0 -1
  220. package/src/flow/plugins/step-definition-plugin.ts +0 -2
  221. package/src/flow/plugins/step-instance-plugin.ts +259 -65
  222. package/src/flow/plugins/trigger-plugin.ts +0 -2
  223. package/src/flow/plugins/wfa-datapill-plugin.ts +0 -1
  224. package/src/flow/utils/datapill-transformer.ts +13 -5
  225. package/src/flow/utils/flow-constants.ts +19 -1
  226. package/src/flow/utils/flow-io-to-record.ts +29 -19
  227. package/src/flow/utils/flow-pill-utils.ts +48 -0
  228. package/src/flow/utils/flow-stage-processor.ts +831 -0
  229. package/src/flow/utils/pill-string-parser.ts +29 -47
  230. package/src/flow/utils/utils.ts +39 -35
  231. package/src/form-plugin.ts +5 -15
  232. package/src/html-import-plugin.ts +0 -1
  233. package/src/import-sets-plugin.ts +0 -2
  234. package/src/inbound-email-action-plugin.ts +1 -2
  235. package/src/index.ts +7 -1
  236. package/src/instance-scan-plugin.ts +0 -7
  237. package/src/json-plugin.ts +0 -1
  238. package/src/list-plugin.ts +6 -2
  239. package/src/now-attach-plugin.ts +0 -1
  240. package/src/now-config-plugin.ts +0 -1
  241. package/src/now-id-plugin.ts +0 -1
  242. package/src/now-include-plugin.ts +0 -1
  243. package/src/now-ref-plugin.ts +0 -1
  244. package/src/now-unresolved-plugin.ts +0 -1
  245. package/src/package-json-plugin.ts +8 -3
  246. package/src/property-plugin.ts +0 -2
  247. package/src/record-plugin.ts +3 -3
  248. package/src/repack/lint/Rules.ts +1 -1
  249. package/src/rest-api-plugin.ts +7 -6
  250. package/src/role-plugin.ts +1 -2
  251. package/src/schedule-script/scheduled-script-plugin.ts +11 -5
  252. package/src/script-action-plugin.ts +0 -2
  253. package/src/script-include-plugin.ts +0 -4
  254. package/src/server-module-plugin/index.ts +2 -3
  255. package/src/service-catalog/catalog-clientscript-plugin.ts +0 -2
  256. package/src/service-catalog/catalog-item-plugin.ts +0 -2
  257. package/src/service-catalog/catalog-ui-policy-plugin.ts +0 -2
  258. package/src/service-catalog/sc-record-producer-plugin.ts +0 -2
  259. package/src/service-catalog/variable-set-plugin.ts +0 -2
  260. package/src/service-portal/angular-provider-plugin.ts +0 -2
  261. package/src/service-portal/dependency-plugin.ts +0 -2
  262. package/src/service-portal/header-footer-plugin.ts +0 -2
  263. package/src/service-portal/menu-plugin.ts +1 -2
  264. package/src/service-portal/page-plugin.ts +1 -2
  265. package/src/service-portal/page-route-map-plugin.ts +1 -2
  266. package/src/service-portal/portal-plugin.ts +0 -2
  267. package/src/service-portal/theme-plugin.ts +0 -2
  268. package/src/service-portal/widget-plugin.ts +0 -2
  269. package/src/sla-plugin.ts +0 -2
  270. package/src/static-content-plugin.ts +37 -4
  271. package/src/table-plugin.ts +118 -16
  272. package/src/ui-action-plugin.ts +30 -17
  273. package/src/ui-page-plugin.ts +188 -20
  274. package/src/ui-policy-plugin.ts +1 -2
  275. package/src/user-preference-plugin.ts +0 -2
  276. package/src/utils.ts +0 -15
  277. package/src/ux-list-menu-config-plugin.ts +0 -2
  278. package/src/view-plugin.ts +0 -1
  279. package/src/workspace-plugin.ts +0 -2
@@ -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
  }),
@@ -112,7 +109,6 @@ export const ScriptIncludePlugin = Plugin.create({
112
109
  sandbox_callable: $.from('sandboxCallable').def(false),
113
110
  access: $.from('accessibleFrom').def('package_private'),
114
111
  active: $.def(true),
115
- sys_policy: $.from('protectionPolicy'),
116
112
  }
117
113
  }),
118
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 }) {
@@ -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: {
@@ -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,
@@ -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(