@steedos-labs/content-compliance 0.8.36 → 1.0.1

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 (177) hide show
  1. package/dist/index.js +1 -1
  2. package/lib/actions/contentHubMaterialGroups.d.ts +19 -0
  3. package/lib/actions/contentHubMaterialGroups.js +70 -0
  4. package/lib/actions/contentHubMaterialGroups.js.map +1 -0
  5. package/lib/actions/contentHubSyncPreview.d.ts +21 -0
  6. package/lib/actions/contentHubSyncPreview.js +51 -0
  7. package/lib/actions/contentHubSyncPreview.js.map +1 -0
  8. package/lib/actions/contentHubTagValues.d.ts +12 -0
  9. package/lib/actions/contentHubTagValues.js +70 -0
  10. package/lib/actions/contentHubTagValues.js.map +1 -0
  11. package/lib/actions/index.d.ts +3 -0
  12. package/lib/actions/index.js +3 -0
  13. package/lib/actions/index.js.map +1 -1
  14. package/lib/actions/sendToContentHub.js +1 -1
  15. package/lib/actions/sendToContentHub.js.map +1 -1
  16. package/lib/actions/spotCheckMaterial.js +2 -1
  17. package/lib/actions/spotCheckMaterial.js.map +1 -1
  18. package/lib/index.js +173 -30
  19. package/lib/index.js.map +1 -1
  20. package/lib/methods/__tests__/contentHubMaterialGroup.test.d.ts +1 -0
  21. package/lib/methods/__tests__/contentHubMaterialGroup.test.js +97 -0
  22. package/lib/methods/__tests__/contentHubMaterialGroup.test.js.map +1 -0
  23. package/lib/methods/__tests__/contentHubMaterialGroupRule.test.d.ts +1 -0
  24. package/lib/methods/__tests__/contentHubMaterialGroupRule.test.js +168 -0
  25. package/lib/methods/__tests__/contentHubMaterialGroupRule.test.js.map +1 -0
  26. package/lib/methods/__tests__/contentHubPush.test.d.ts +1 -0
  27. package/lib/methods/__tests__/contentHubPush.test.js +568 -0
  28. package/lib/methods/__tests__/contentHubPush.test.js.map +1 -0
  29. package/lib/methods/__tests__/contentHubSyncRule.test.d.ts +1 -0
  30. package/lib/methods/__tests__/contentHubSyncRule.test.js +130 -0
  31. package/lib/methods/__tests__/contentHubSyncRule.test.js.map +1 -0
  32. package/lib/methods/__tests__/contentHubTagSync.test.d.ts +1 -0
  33. package/lib/methods/__tests__/contentHubTagSync.test.js +743 -0
  34. package/lib/methods/__tests__/contentHubTagSync.test.js.map +1 -0
  35. package/lib/methods/__tests__/tagLabel.test.d.ts +1 -0
  36. package/lib/methods/__tests__/tagLabel.test.js +136 -0
  37. package/lib/methods/__tests__/tagLabel.test.js.map +1 -0
  38. package/lib/methods/approval_engine.js +10 -7
  39. package/lib/methods/approval_engine.js.map +1 -1
  40. package/lib/methods/consts.d.ts +4 -0
  41. package/lib/methods/consts.js.map +1 -1
  42. package/lib/methods/content_hub.d.ts +8 -1
  43. package/lib/methods/content_hub.js +278 -27
  44. package/lib/methods/content_hub.js.map +1 -1
  45. package/lib/methods/content_hub_copyright.d.ts +15 -0
  46. package/lib/methods/content_hub_copyright.js +223 -0
  47. package/lib/methods/content_hub_copyright.js.map +1 -0
  48. package/lib/methods/content_hub_material_group.d.ts +29 -0
  49. package/lib/methods/content_hub_material_group.js +268 -0
  50. package/lib/methods/content_hub_material_group.js.map +1 -0
  51. package/lib/methods/content_hub_material_group_rule.d.ts +23 -0
  52. package/lib/methods/content_hub_material_group_rule.js +58 -0
  53. package/lib/methods/content_hub_material_group_rule.js.map +1 -0
  54. package/lib/methods/content_hub_sync_rule.d.ts +51 -0
  55. package/lib/methods/content_hub_sync_rule.js +122 -0
  56. package/lib/methods/content_hub_sync_rule.js.map +1 -0
  57. package/lib/methods/content_hub_tag.d.ts +57 -0
  58. package/lib/methods/content_hub_tag.js +830 -0
  59. package/lib/methods/content_hub_tag.js.map +1 -0
  60. package/lib/methods/pls.d.ts +4 -1
  61. package/lib/methods/pls.js +60 -51
  62. package/lib/methods/pls.js.map +1 -1
  63. package/lib/methods/tag_label.d.ts +19 -0
  64. package/lib/methods/tag_label.js +192 -0
  65. package/lib/methods/tag_label.js.map +1 -0
  66. package/main/default/applications/pepsico_content_setting.app.yml +8 -0
  67. package/main/default/objects/pepesio_ch__c/fields/media_type.field.yml +2 -0
  68. package/main/default/objects/pepesio_ch__c/fields/pepsico_material_approval.field.yml +6 -0
  69. package/main/default/objects/pepesio_ch__c/fields/push_status.field.yml +11 -0
  70. package/main/default/objects/pepesio_ch__c/fields/type.field.yml +48 -8
  71. package/main/default/objects/pepesio_ch__c/listviews/all.listview.yml +2 -0
  72. package/main/default/objects/pepsico_ch_material_group_rule/fields/active.field.yml +6 -0
  73. package/main/default/objects/pepsico_ch_material_group_rule/fields/classification.field.yml +73 -0
  74. package/main/default/objects/pepsico_ch_material_group_rule/fields/name.field.yml +9 -0
  75. package/main/default/objects/pepsico_ch_material_group_rule/fields/orgs.field.yml +10 -0
  76. package/main/default/objects/pepsico_ch_material_group_rule/fields/priority.field.yml +10 -0
  77. package/main/default/objects/pepsico_ch_material_group_rule/fields/query_mode.field.yml +12 -0
  78. package/main/default/objects/pepsico_ch_material_group_rule/fields/remark.field.yml +7 -0
  79. package/main/default/objects/pepsico_ch_material_group_rule/listviews/all.listview.yml +20 -0
  80. package/main/default/objects/pepsico_ch_material_group_rule/pepsico_ch_material_group_rule.object.yml +19 -0
  81. package/main/default/objects/pepsico_ch_material_group_rule/permissions/admin.permission.yml +15 -0
  82. package/main/default/objects/pepsico_ch_material_group_rule/permissions/user.permission.yml +14 -0
  83. package/main/default/objects/pepsico_ch_sync_rule/fields/active.field.yml +6 -0
  84. package/main/default/objects/pepsico_ch_sync_rule/fields/classification.field.yml +73 -0
  85. package/main/default/objects/pepsico_ch_sync_rule/fields/kol_classification.field.yml +67 -0
  86. package/main/default/objects/pepsico_ch_sync_rule/fields/name.field.yml +9 -0
  87. package/main/default/objects/pepsico_ch_sync_rule/fields/need_sync.field.yml +11 -0
  88. package/main/default/objects/pepsico_ch_sync_rule/fields/orgs.field.yml +10 -0
  89. package/main/default/objects/pepsico_ch_sync_rule/fields/priority.field.yml +10 -0
  90. package/main/default/objects/pepsico_ch_sync_rule/fields/product.field.yml +65 -0
  91. package/main/default/objects/pepsico_ch_sync_rule/fields/remark.field.yml +7 -0
  92. package/main/default/objects/pepsico_ch_sync_rule/fields/spot_check.field.yml +12 -0
  93. package/main/default/objects/pepsico_ch_sync_rule/listviews/all.listview.yml +24 -0
  94. package/main/default/objects/pepsico_ch_sync_rule/pepsico_ch_sync_rule.object.yml +19 -0
  95. package/main/default/objects/pepsico_ch_sync_rule/permissions/admin.permission.yml +15 -0
  96. package/main/default/objects/pepsico_ch_sync_rule/permissions/user.permission.yml +14 -0
  97. package/main/default/objects/pepsico_ch_tag_sync_log/fields/action.field.yml +6 -0
  98. package/main/default/objects/pepsico_ch_tag_sync_log/fields/changed_at.field.yml +6 -0
  99. package/main/default/objects/pepsico_ch_tag_sync_log/fields/duration.field.yml +6 -0
  100. package/main/default/objects/pepsico_ch_tag_sync_log/fields/error_code.field.yml +6 -0
  101. package/main/default/objects/pepsico_ch_tag_sync_log/fields/error_msg.field.yml +6 -0
  102. package/main/default/objects/pepsico_ch_tag_sync_log/fields/expired_date.field.yml +6 -0
  103. package/main/default/objects/pepsico_ch_tag_sync_log/fields/name.field.yml +7 -0
  104. package/main/default/objects/pepsico_ch_tag_sync_log/fields/parent_tag_val_id.field.yml +6 -0
  105. package/main/default/objects/pepsico_ch_tag_sync_log/fields/request_id.field.yml +7 -0
  106. package/main/default/objects/pepsico_ch_tag_sync_log/fields/result.field.yml +6 -0
  107. package/main/default/objects/pepsico_ch_tag_sync_log/fields/source_ip.field.yml +6 -0
  108. package/main/default/objects/pepsico_ch_tag_sync_log/fields/space.field.yml +6 -0
  109. package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_id.field.yml +6 -0
  110. package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_val_id.field.yml +7 -0
  111. package/main/default/objects/pepsico_ch_tag_sync_log/fields/tag_val_name.field.yml +6 -0
  112. package/main/default/objects/pepsico_ch_tag_sync_log/listviews/all.listview.yml +21 -0
  113. package/main/default/objects/pepsico_ch_tag_sync_log/pepsico_ch_tag_sync_log.object.yml +16 -0
  114. package/main/default/objects/pepsico_ch_tag_sync_log/permissions/admin.permission.yml +15 -0
  115. package/main/default/objects/pepsico_ch_tag_sync_log/permissions/user.permission.yml +14 -0
  116. package/main/default/objects/pepsico_ch_tag_sync_request/fields/changed_at.field.yml +6 -0
  117. package/main/default/objects/pepsico_ch_tag_sync_request/fields/duration.field.yml +6 -0
  118. package/main/default/objects/pepsico_ch_tag_sync_request/fields/expired_date.field.yml +6 -0
  119. package/main/default/objects/pepsico_ch_tag_sync_request/fields/item_count.field.yml +6 -0
  120. package/main/default/objects/pepsico_ch_tag_sync_request/fields/name.field.yml +7 -0
  121. package/main/default/objects/pepsico_ch_tag_sync_request/fields/request_id.field.yml +7 -0
  122. package/main/default/objects/pepsico_ch_tag_sync_request/fields/response.field.yml +9 -0
  123. package/main/default/objects/pepsico_ch_tag_sync_request/fields/result_code.field.yml +6 -0
  124. package/main/default/objects/pepsico_ch_tag_sync_request/fields/source_ip.field.yml +6 -0
  125. package/main/default/objects/pepsico_ch_tag_sync_request/fields/space.field.yml +6 -0
  126. package/main/default/objects/pepsico_ch_tag_sync_request/fields/tag_id.field.yml +6 -0
  127. package/main/default/objects/pepsico_ch_tag_sync_request/fields/tag_label.field.yml +6 -0
  128. package/main/default/objects/pepsico_ch_tag_sync_request/listviews/all.listview.yml +19 -0
  129. package/main/default/objects/pepsico_ch_tag_sync_request/pepsico_ch_tag_sync_request.object.yml +16 -0
  130. package/main/default/objects/pepsico_ch_tag_sync_request/permissions/admin.permission.yml +15 -0
  131. package/main/default/objects/pepsico_ch_tag_sync_request/permissions/user.permission.yml +14 -0
  132. package/main/default/objects/pepsico_material/fields/material_type_label.field.yml +10 -0
  133. package/main/default/objects/pepsico_material_approval/buttons/pepsico_confirm_online.button.yml +78 -1
  134. package/main/default/objects/pepsico_material_approval/buttons/pepsico_modify_pls.button.yml +1 -1
  135. package/main/default/objects/pepsico_material_approval/fields/available_channels.field.yml +2 -0
  136. package/main/default/objects/pepsico_material_approval/fields/available_channels_label.field.yml +10 -0
  137. package/main/default/objects/pepsico_material_approval/fields/ch_material_group.field.yml +56 -0
  138. package/main/default/objects/pepsico_material_approval/fields/ch_material_group_path.field.yml +14 -0
  139. package/main/default/objects/pepsico_material_approval/fields/ch_sync_enabled.field.yml +11 -0
  140. package/main/default/objects/pepsico_material_approval/fields/ch_sync_rule_check.field.yml +55 -0
  141. package/main/default/objects/pepsico_material_approval/fields/content_rule.field.yml +2 -0
  142. package/main/default/objects/pepsico_material_approval/fields/content_rule_label.field.yml +10 -0
  143. package/main/default/objects/pepsico_material_approval/fields/ec_check_food_name.field.yml +2 -2
  144. package/main/default/objects/pepsico_material_approval/fields/ec_check_ingredients.field.yml +2 -2
  145. package/main/default/objects/pepsico_material_approval/fields/ec_check_net_content.field.yml +2 -2
  146. package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_address.field.yml +2 -2
  147. package/main/default/objects/pepsico_material_approval/fields/ec_check_producer_name.field.yml +2 -2
  148. package/main/default/objects/pepsico_material_approval/fields/ec_check_shelf_life.field.yml +2 -2
  149. package/main/default/objects/pepsico_material_approval/fields/ec_check_standard_code.field.yml +2 -2
  150. package/main/default/objects/pepsico_material_approval/fields/ec_check_storage_condition.field.yml +2 -2
  151. package/main/default/objects/pepsico_material_approval/fields/ec_has_detail_page.field.yml +1 -1
  152. package/main/default/objects/pepsico_material_approval/fields/ec_producers.field.yml +1 -1
  153. package/main/default/objects/pepsico_material_approval/fields/ec_qc_production_email.field.yml +2 -2
  154. package/main/default/objects/pepsico_material_approval/fields/ec_related_approval.field.yml +1 -1
  155. package/main/default/objects/pepsico_material_approval/fields/effective_date.field.yml +2 -0
  156. package/main/default/objects/pepsico_material_approval/fields/expiry_date.field.yml +2 -0
  157. package/main/default/objects/pepsico_material_approval/fields/form_version.field.yml +6 -2
  158. package/main/default/objects/pepsico_material_approval/fields/has_nutrition_table.field.yml +1 -1
  159. package/main/default/objects/pepsico_material_approval/fields/material_editable.field.yml +78 -0
  160. package/main/default/objects/pepsico_material_approval/fields/material_type.field.yml +2 -0
  161. package/main/default/objects/pepsico_material_approval/fields/material_type_label.field.yml +10 -0
  162. package/main/default/objects/pepsico_material_approval/fields/pls_file.field.yml +1 -1
  163. package/main/default/objects/pepsico_material_approval/fields/pls_km_files.field.yml +2 -5
  164. package/main/default/objects/pepsico_material_approval/fields/pls_upload_files.field.yml +1 -1
  165. package/main/default/objects/pepsico_material_approval/fields/product_label.field.yml +10 -0
  166. package/main/default/objects/pepsico_material_approval_data/fields/guding_pass.field.yml +9 -1
  167. package/main/default/objects/pepsico_material_data/fields/guding_pass.field.yml +9 -1
  168. package/main/default/objects/picklist_options/fields/ch_changed_at.field.yml +8 -0
  169. package/main/default/objects/picklist_options/picklist_options.object.yml +7 -0
  170. package/main/default/tabs/object_pepsico_ch_material_group_rule.tab.yml +8 -0
  171. package/main/default/tabs/object_pepsico_ch_sync_rule.tab.yml +8 -0
  172. package/main/default/triggers/pepsico_material_approval_tag_label.trigger.yml +80 -0
  173. package/main/default/triggers/pepsico_material_tag_label.trigger.yml +77 -0
  174. package/package.json +1 -1
  175. package/scripts/audit-legacy-tags.js +246 -0
  176. package/scripts/probe-content-hub-tags.js +134 -0
  177. package/main/default/objects/pepsico_material_approval/fields/has_detail_page.field.yml +0 -18
@@ -0,0 +1,10 @@
1
+ name: content_rule_label
2
+ description: 选中「素材授权规则」时的标签名称快照, 路径各级名称用 - 连接。标签后续改名/停用不影响已存的值
3
+ group: 素材标签
4
+ is_wide: true
5
+ label: 素材授权规则(名称)
6
+ readonly: true
7
+ required: false
8
+ sort_no: 1510
9
+ type: text
10
+ visible_on: '{{false}}'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -11,8 +11,8 @@ amis:
11
11
  multiple: false
12
12
  requiredOn: >-
13
13
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
14
- form_version == 'v2' && ec_has_detail_page == 'yes'}
14
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
15
15
  options:
16
16
  - label: 已自查
17
17
  value: 'yes'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -15,4 +15,4 @@ options:
15
15
  value: 'yes'
16
16
  - label: 否
17
17
  value: 'no'
18
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2'
18
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3')
@@ -16,4 +16,4 @@ group: 电商合规自查
16
16
  sort_no: 1276
17
17
  is_wide: true
18
18
  required: true
19
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_check_producer_name == 'yes' && ec_check_producer_address == 'yes' && ec_has_detail_page == 'yes'
19
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_check_producer_name == 'yes' && ec_check_producer_address == 'yes' && ec_has_detail_page == 'yes'
@@ -12,5 +12,5 @@ amis:
12
12
  accept: image/*,.pdf
13
13
  requiredOn: >-
14
14
  ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') &&
15
- form_version == 'v2' && ec_has_detail_page == 'yes'}
16
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'yes'
15
+ (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'}
16
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'yes'
@@ -6,4 +6,4 @@ group: 电商合规自查
6
6
  sort_no: 1259
7
7
  is_wide: true
8
8
  required: true
9
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && form_version == 'v2' && ec_has_detail_page == 'no'
9
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25') && (form_version == 'v2' || form_version == 'v3') && ec_has_detail_page == 'no'
@@ -10,3 +10,5 @@ label: 素材生效日期
10
10
  required: true
11
11
  sort_no: 1550
12
12
  type: date
13
+ # 只在 Content Hub 改版后的新版表单(v3)且勾选「同步到 Content Hub」时显示, 该日期只用于推送 Content Hub
14
+ visible_on: form_version == 'v3' && ch_sync_enabled == true
@@ -10,3 +10,5 @@ is_wide: false
10
10
  label: 素材失效日期
11
11
  sort_no: 1600
12
12
  type: date
13
+ # 只在 Content Hub 改版后的新版表单(v3)且勾选「同步到 Content Hub」时显示, 该日期只用于推送 Content Hub
14
+ visible_on: form_version == 'v3' && ch_sync_enabled == true
@@ -1,10 +1,14 @@
1
1
  name: form_version
2
+ # 只在界面上藏起来, 字段仍渲染在表单里: 多个字段的 visible_on 引用 form_version,
3
+ # 新建时的默认值 v1 也要靠表单写入; 用 visible_on 置 false 会把它从表单数据里拿掉
4
+ amis:
5
+ className: hidden
2
6
  label: 表单版本
3
7
  type: text
4
8
  data_type: text
5
9
  group: 系统信息
6
- inlineHelpText: v1=PLS知识库关联;v2=增加电商合规自查与QC审核
10
+ inlineHelpText: v1=PLS知识库关联;v2=增加电商合规自查与QC审核;v3=Content Hub 改版(含 v1、v2 全部功能, 另加同步规则、同步开关、素材组)
7
11
  sort_no: 100000
8
12
  is_wide: false
9
13
  readonly: true
10
- defaultValue: 'v1'
14
+ defaultValue: 'v3'
@@ -15,4 +15,4 @@ options:
15
15
  value: 'yes'
16
16
  - label: 否
17
17
  value: 'no'
18
- visible_on: (classification == 'MD-SC1-SC16' || classification == 'MD-SC1-SC16-SC161' || classification == 'MD-SC1-SC16-SC162' || classification == 'MD-SC1-SC112' || classification == 'SLS-SC2-SC26' || classification == 'SLS-SC2-SC26-SC261' || classification == 'SLS-SC2-SC26-SC262' || classification == 'SLS-SC2-SC212') && form_version == 'v2'
18
+ visible_on: (classification == 'MD-SC1-SC16' || classification == 'MD-SC1-SC16-SC161' || classification == 'MD-SC1-SC16-SC162' || classification == 'MD-SC1-SC112' || classification == 'SLS-SC2-SC26' || classification == 'SLS-SC2-SC26-SC261' || classification == 'SLS-SC2-SC26-SC262' || classification == 'SLS-SC2-SC212') && (form_version == 'v2' || form_version == 'v3')
@@ -0,0 +1,78 @@
1
+ name: material_editable
2
+ # 选项与素材授权规则(content_rule)相同, 动态读取 picklist 223321022150011 的启用选项
3
+ amis:
4
+ id: 'u:material_editable'
5
+ type: tree-select
6
+ label: 是否可以进行素材编辑
7
+ multiple: false
8
+ enableNodePath: true
9
+ showIcon: true
10
+ initiallyOpen: false
11
+ hideRoot: true
12
+ clearable: true
13
+ onlyLeaf: true
14
+ searchable: true
15
+ autoCheckChildren: true
16
+ joinValues: true
17
+ delimiter: 、
18
+ source:
19
+ url: /graphql
20
+ method: post
21
+ requestAdaptor: |-
22
+ api.data = { query:`
23
+ query{
24
+ picklists(filters: [["code", "=", "223321022150011"]]){
25
+ options: _related_picklist_options_picklist(filters: [["enable", "=", true]], sort: "sort_no desc"){
26
+ label: name, value, , parent: parent__expand{ value }
27
+ }
28
+ }
29
+ }
30
+ `}
31
+ adaptor: |+
32
+ const pOptions = payload.data.picklists[0].options;
33
+ let depth = 0;
34
+ function getChildren(value) {
35
+ depth++;
36
+ // 控制递归次数;
37
+ if (depth > 2000) {
38
+ console.log('递归次数过多,请检查数据:', depth, pOptions)
39
+ return [];
40
+ }
41
+ return _.map(_.filter(pOptions, (op) => {
42
+ if (value == null) {
43
+ return op.parent == null
44
+ }
45
+ return op.parent && op.parent.value === value;
46
+ }), item => {
47
+ return {
48
+ ...item,
49
+ children: getChildren(item.value || item.label)
50
+ };
51
+ });
52
+ }
53
+ const options = getChildren(null);
54
+ return { options }
55
+
56
+ messages: {}
57
+ sendOn: ''
58
+ cache: 86400000
59
+ showOutline: false
60
+ cascade: true
61
+ description: ''
62
+ pathSeparator: '-'
63
+ unfoldedLevel: 2
64
+ data_type: text
65
+ description: ''
66
+ enable_thousands: true
67
+ group: 素材标签
68
+ inlineHelpText: ''
69
+ is_wide: true
70
+ label: 是否可以进行素材编辑
71
+ options:
72
+ - label: '1'
73
+ value: '1'
74
+ required: true
75
+ sort_no: 1625
76
+ type: select
77
+ # 只在 Content Hub 改版后的新版表单(v3)且勾选「同步到 Content Hub」时显示, 存量 v1/v2 单据不受影响
78
+ visible_on: form_version == 'v3' && ch_sync_enabled == true
@@ -75,3 +75,5 @@ options:
75
75
  required: true
76
76
  sort_no: 1400
77
77
  type: select
78
+ # Content Hub 改版后的新版表单(v3)不再需要该字段, 隐藏; 存量 v1/v2 单据照常显示
79
+ visible_on: form_version != 'v3'
@@ -0,0 +1,10 @@
1
+ name: material_type_label
2
+ description: 选中「素材类型」时的标签名称快照, 路径各级名称用 - 连接。标签后续改名/停用不影响已存的值
3
+ group: 素材标签
4
+ is_wide: true
5
+ label: 素材类型(名称)
6
+ readonly: true
7
+ required: false
8
+ sort_no: 1410
9
+ type: text
10
+ visible_on: '{{false}}'
@@ -8,4 +8,4 @@ multiple: true
8
8
  required: false
9
9
  sort_no: 800
10
10
  type: file
11
- visible_on: '${(classification == ''MD-PO1-PO15'') && form_version != ''v2'' && form_version != ''v1''}'
11
+ visible_on: '${(classification == ''MD-PO1-PO15'') && form_version != ''v2'' && form_version != ''v1'' && form_version != ''v3''}'
@@ -22,10 +22,7 @@ amis:
22
22
  className: pepsico-pls-files-field m-1 border-b
23
23
  # requiredOn: >-
24
24
  # ${(classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' ||
25
- # has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2') && (!pls_upload_files ||
25
+ # has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2' || form_version == 'v3') && (!pls_upload_files ||
26
26
  # pls_upload_files.length === 0)}
27
- # 过渡规则: 素材包含商品详情页(过渡字段 has_detail_page)且未上传本地PLS文件时必填
28
- requiredOn: >-
29
- ${has_detail_page == 'yes' && (!pls_upload_files || pls_upload_files.length === 0)}
30
27
  placeholder: 请选择PLS文件
31
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2')
28
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2' || form_version == 'v3')
@@ -6,7 +6,7 @@ group: 基本信息
6
6
  sort_no: 1241
7
7
  is_wide: false
8
8
  required: false
9
- visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2')
9
+ visible_on: (classification == 'MD-PO1-PO15' || classification == 'SLS-PO2-PO25' || has_nutrition_table == 'yes') && (form_version == 'v1' || form_version == 'v2' || form_version == 'v3')
10
10
  amis:
11
11
  accept: .pdf
12
12
  btnLabel: 上传本地PLS文件
@@ -0,0 +1,10 @@
1
+ name: product_label
2
+ description: 选中「品牌/产品」时的标签名称快照, 路径各级名称用 - 连接。标签后续改名/停用不影响已存的值
3
+ group: 素材标签
4
+ is_wide: true
5
+ label: 品牌/产品(名称)
6
+ readonly: true
7
+ required: false
8
+ sort_no: 1360
9
+ type: text
10
+ visible_on: '{{false}}'
@@ -7,4 +7,12 @@ group: 审核信息
7
7
  inlineHelpText: ''
8
8
  label: 固定人员审核通过
9
9
  sort_no: 1050
10
- type: boolean
10
+ options:
11
+ - label: √
12
+ value: true
13
+ - label: X
14
+ value: false
15
+ - label: Bypass
16
+ value: pass
17
+ color: '#02355a'
18
+ type: select
@@ -5,4 +5,12 @@ group: 通用
5
5
  label: 固定人员审核通过
6
6
  required: false
7
7
  sort_no: 650
8
- type: boolean
8
+ options:
9
+ - label: √
10
+ value: true
11
+ - label: X
12
+ value: false
13
+ - label: Bypass
14
+ value: pass
15
+ color: '#02355a'
16
+ type: select
@@ -0,0 +1,8 @@
1
+ name: ch_changed_at
2
+ group: 通用
3
+ label: Content Hub 变更时间
4
+ description: 该选项最近一次已处理的 Content Hub 同步事件的 changedAt, 用于丢弃迟到的过期事件
5
+ hidden: true
6
+ required: false
7
+ sort_no: 900
8
+ type: datetime
@@ -0,0 +1,7 @@
1
+ name: picklist_options
2
+ custom: true
3
+ extend: picklist_options
4
+ is_enable: true
5
+ is_system: true
6
+ label: 选项列表值
7
+ version: 2
@@ -0,0 +1,8 @@
1
+ name: object_pepsico_ch_material_group_rule
2
+ desktop: true
3
+ icon: hierarchy
4
+ label: Content Hub 素材组查询规则
5
+ mobile: false
6
+ object: pepsico_ch_material_group_rule
7
+ permissions: []
8
+ type: object
@@ -0,0 +1,8 @@
1
+ name: object_pepsico_ch_sync_rule
2
+ desktop: true
3
+ icon: approval
4
+ label: Content Hub 同步规则
5
+ mobile: false
6
+ object: pepsico_ch_sync_rule
7
+ permissions: []
8
+ type: object
@@ -0,0 +1,80 @@
1
+ name: pepsico_material_approval_tag_label
2
+ listenTo: pepsico_material_approval
3
+ when:
4
+ - beforeInsert
5
+ - beforeUpdate
6
+ isEnabled: true
7
+ handler: |-
8
+ const { _ } = global;
9
+ const { doc } = ctx.params;
10
+ const isInsert = ctx.params.isInsert === true;
11
+
12
+ // 标签名称快照: 选中标签时把名称存到 *_label, 之后标签在 Content Hub 改名 / 停用都不回刷,
13
+ // 历史单据不会因为选项停用而只剩一串 ID。
14
+ // 解析规则与 src/methods/tag_label.ts 一致(那边供存量回填与单测), 改一处要同步改另一处。
15
+ const OBJECT_NAME = 'pepsico_material_approval';
16
+ const FIELDS = [
17
+ { field: 'product', labelField: 'product_label', tagId: '223321001114213' },
18
+ { field: 'material_type', labelField: 'material_type_label', tagId: '223321001114222' },
19
+ { field: 'available_channels', labelField: 'available_channels_label', tagId: '223321001114944' },
20
+ { field: 'content_rule', labelField: 'content_rule_label', tagId: '223321022150011' }
21
+ ];
22
+
23
+ // 字段值 → 路径列表(各级 tagValId); 值可能是字符串或数组, 多个路径可能用 、 或 , 连接
24
+ const parsePaths = (value) => _.compact(
25
+ _.flatMap(_.castArray(value), (v) => _.isString(v) ? v.split(/[,、]/) : []).map((entry) => {
26
+ const ids = _.compact(entry.split('-').map((id) => id.trim()));
27
+ return ids.length > 0 ? ids : null;
28
+ })
29
+ );
30
+
31
+ const touched = _.filter(FIELDS, (conf) => _.has(doc, conf.field));
32
+ if(touched.length === 0){
33
+ return;
34
+ }
35
+
36
+ // beforeUpdate 的 doc 可能带着没改的字段原样回传; 值没变就不重算, 否则标签改名后
37
+ // 随便保存一次历史单据就会把快照刷成新名称
38
+ // 快照只是附加信息, 任何异常都不能挡住单据保存(系统已上线, 存量单据照常可改)
39
+ try {
40
+ let previousDoc = null;
41
+ if(!isInsert && ctx.params.id){
42
+ const prevRows = await ctx.getObject(OBJECT_NAME).directFind({
43
+ filters: [['_id', '=', ctx.params.id]],
44
+ fields: _.flatMap(FIELDS, (conf) => [conf.field, conf.labelField]),
45
+ top: 1
46
+ });
47
+ previousDoc = prevRows && prevRows.length > 0 ? prevRows[0] : null;
48
+ }
49
+
50
+ for(const conf of touched){
51
+ const paths = parsePaths(doc[conf.field]);
52
+ if(previousDoc && previousDoc[conf.labelField]
53
+ && _.isEqual(paths, parsePaths(previousDoc[conf.field]))){
54
+ continue;
55
+ }
56
+ if(paths.length === 0){
57
+ doc[conf.labelField] = null;
58
+ continue;
59
+ }
60
+ let nameByValue = {};
61
+ const picklists = await ctx.getObject('picklists').directFind({
62
+ filters: [['code', '=', conf.tagId]], fields: ['_id'], top: 1
63
+ });
64
+ if(picklists.length > 0){
65
+ // 不过滤 enable: 已停用的选项也要能还原名称
66
+ const options = await ctx.getObject('picklist_options').directFind({
67
+ filters: [['picklist', '=', picklists[0]._id], ['value', 'in', _.uniq(_.flatten(paths))]],
68
+ fields: ['value', 'name']
69
+ });
70
+ nameByValue = _.fromPairs(_.map(options, (op) => [op.value, op.name]));
71
+ }
72
+ // 查不到名称的那一级保留原 ID, 不留空
73
+ doc[conf.labelField] = _.map(paths, (ids) => _.map(ids, (id) => nameByValue[id] || id).join('-')).join('、');
74
+ }
75
+ } catch (e) {
76
+ console.error('[标签名称快照]计算失败, 不影响保存', ctx.params && ctx.params.id, e && e.message);
77
+ }
78
+ authentication_type: none
79
+ locked: false
80
+ type: code
@@ -0,0 +1,77 @@
1
+ name: pepsico_material_tag_label
2
+ listenTo: pepsico_material
3
+ when:
4
+ - beforeInsert
5
+ - beforeUpdate
6
+ isEnabled: true
7
+ handler: |-
8
+ const { _ } = global;
9
+ const { doc } = ctx.params;
10
+ const isInsert = ctx.params.isInsert === true;
11
+
12
+ // 标签名称快照: 选中标签时把名称存到 *_label, 之后标签在 Content Hub 改名 / 停用都不回刷,
13
+ // 历史单据不会因为选项停用而只剩一串 ID。
14
+ // 解析规则与 src/methods/tag_label.ts 一致(那边供存量回填与单测), 改一处要同步改另一处。
15
+ const OBJECT_NAME = 'pepsico_material';
16
+ const FIELDS = [
17
+ { field: 'material_type', labelField: 'material_type_label', tagId: '223321001114222' }
18
+ ];
19
+
20
+ // 字段值 → 路径列表(各级 tagValId); 值可能是字符串或数组, 多个路径可能用 、 或 , 连接
21
+ const parsePaths = (value) => _.compact(
22
+ _.flatMap(_.castArray(value), (v) => _.isString(v) ? v.split(/[,、]/) : []).map((entry) => {
23
+ const ids = _.compact(entry.split('-').map((id) => id.trim()));
24
+ return ids.length > 0 ? ids : null;
25
+ })
26
+ );
27
+
28
+ const touched = _.filter(FIELDS, (conf) => _.has(doc, conf.field));
29
+ if(touched.length === 0){
30
+ return;
31
+ }
32
+
33
+ // beforeUpdate 的 doc 可能带着没改的字段原样回传; 值没变就不重算, 否则标签改名后
34
+ // 随便保存一次历史单据就会把快照刷成新名称
35
+ // 快照只是附加信息, 任何异常都不能挡住单据保存(系统已上线, 存量单据照常可改)
36
+ try {
37
+ let previousDoc = null;
38
+ if(!isInsert && ctx.params.id){
39
+ const prevRows = await ctx.getObject(OBJECT_NAME).directFind({
40
+ filters: [['_id', '=', ctx.params.id]],
41
+ fields: _.flatMap(FIELDS, (conf) => [conf.field, conf.labelField]),
42
+ top: 1
43
+ });
44
+ previousDoc = prevRows && prevRows.length > 0 ? prevRows[0] : null;
45
+ }
46
+
47
+ for(const conf of touched){
48
+ const paths = parsePaths(doc[conf.field]);
49
+ if(previousDoc && previousDoc[conf.labelField]
50
+ && _.isEqual(paths, parsePaths(previousDoc[conf.field]))){
51
+ continue;
52
+ }
53
+ if(paths.length === 0){
54
+ doc[conf.labelField] = null;
55
+ continue;
56
+ }
57
+ let nameByValue = {};
58
+ const picklists = await ctx.getObject('picklists').directFind({
59
+ filters: [['code', '=', conf.tagId]], fields: ['_id'], top: 1
60
+ });
61
+ if(picklists.length > 0){
62
+ // 不过滤 enable: 已停用的选项也要能还原名称
63
+ const options = await ctx.getObject('picklist_options').directFind({
64
+ filters: [['picklist', '=', picklists[0]._id], ['value', 'in', _.uniq(_.flatten(paths))]],
65
+ fields: ['value', 'name']
66
+ });
67
+ nameByValue = _.fromPairs(_.map(options, (op) => [op.value, op.name]));
68
+ }
69
+ // 查不到名称的那一级保留原 ID, 不留空
70
+ doc[conf.labelField] = _.map(paths, (ids) => _.map(ids, (id) => nameByValue[id] || id).join('-')).join('、');
71
+ }
72
+ } catch (e) {
73
+ console.error('[标签名称快照]计算失败, 不影响保存', ctx.params && ctx.params.id, e && e.message);
74
+ }
75
+ authentication_type: none
76
+ locked: false
77
+ type: code
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos-labs/content-compliance",
3
- "version": "0.8.36",
3
+ "version": "1.0.1",
4
4
  "description": "内容审核系统",
5
5
  "main": "package.service.js",
6
6
  "scripts": {