openxiangda 1.0.20 → 1.0.22

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.
@@ -608,6 +608,69 @@ interface BatchSendNotificationByTypeParams {
608
608
  channels?: NotificationChannel[];
609
609
  }>;
610
610
  }
611
+ interface NotificationChannelConfig {
612
+ enabled?: boolean;
613
+ title?: string;
614
+ content?: string;
615
+ config?: Record<string, unknown>;
616
+ [key: string]: unknown;
617
+ }
618
+ interface NotificationChannelsConfig {
619
+ inapp?: NotificationChannelConfig;
620
+ email?: NotificationChannelConfig;
621
+ dingding?: NotificationChannelConfig;
622
+ wechat?: NotificationChannelConfig;
623
+ thirdparty_todo?: NotificationChannelConfig;
624
+ [key: string]: NotificationChannelConfig | undefined;
625
+ }
626
+ type NotificationConfigLevel = "platform" | "app" | "form";
627
+ interface NotificationTemplate {
628
+ id?: string;
629
+ code: string;
630
+ name: string;
631
+ content?: string;
632
+ description?: string;
633
+ level?: NotificationConfigLevel;
634
+ appType?: string;
635
+ formUuid?: string;
636
+ priority?: number;
637
+ enabled?: boolean;
638
+ variables?: string[];
639
+ channelsConfig?: NotificationChannelsConfig;
640
+ [key: string]: unknown;
641
+ }
642
+ interface NotificationTypeConfig {
643
+ id?: string;
644
+ notificationType: string;
645
+ level?: NotificationConfigLevel;
646
+ appType?: string;
647
+ formUuid?: string;
648
+ templateId?: string;
649
+ template?: NotificationTemplate;
650
+ enabled?: boolean;
651
+ priority?: number;
652
+ description?: string;
653
+ [key: string]: unknown;
654
+ }
655
+ interface PreviewNotificationTemplateParams {
656
+ appType?: string;
657
+ templateId?: string;
658
+ templateCode?: string;
659
+ code?: string;
660
+ level?: "app" | "form";
661
+ formUuid?: string;
662
+ payload?: Record<string, unknown>;
663
+ }
664
+ interface NotificationTemplatePreview {
665
+ defaultContent?: string;
666
+ channelPreviews?: Record<string, string>;
667
+ enabledChannels?: Array<NotificationChannel | string>;
668
+ [key: string]: unknown;
669
+ }
670
+ interface FindNotificationConfigParams {
671
+ appType?: string;
672
+ formUuid?: string;
673
+ }
611
674
  interface NotificationMessageRecord {
612
675
  id?: string;
613
676
  messageId?: string;
@@ -787,6 +850,8 @@ interface PageSdk {
787
850
  notification: {
788
851
  sendByType<T = SendNotificationResult>(params: SendNotificationByTypeParams): Promise<PageApiResponse<T>>;
789
852
  batchSendByType<T = SendNotificationResult>(params: BatchSendNotificationByTypeParams): Promise<PageApiResponse<T>>;
853
+ findConfig<T = NotificationTypeConfig | null>(notificationType: string, params?: FindNotificationConfigParams): Promise<PageApiResponse<T>>;
854
+ previewTemplate<T = NotificationTemplatePreview>(params: PreviewNotificationTemplateParams): Promise<PageApiResponse<T>>;
790
855
  };
791
856
  navigation: PageNavigationApi;
792
857
  ui: PageContext["ui"];
@@ -866,4 +931,4 @@ declare const usePageRoute: () => PageRouteInfo;
866
931
 
867
932
  declare const usePageSdk: () => PageSdk;
868
933
 
869
- export { type ApiPermissionListParams, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreatePagePermissionGroupDto, type CreateRoleParams, type CreateUiPermissionParams, type CreateUserParams, type CurrentUserDepartmentParents, type CustomPageEntryConfig, type CustomPageEntryMode, type DataManagementConfigParams, type DataManagementFilterState, type DataPermissionConditionDto, type DataPermissionDto, type DataPermissionRuleDto, type FieldPermissionDto, type FormAdvancedSearchParams, type FormChangeRecordParams, type FormCreateParams, type FormExportParams, type FormGetDetailParams, type FormImportParams, type FormPermissionGroup, type FormRemoveParams, type FormSearchParams, type FormUpdateParams, type GetParentDepartmentsOptions, type GetProcessInstanceParams, type GetUserRolesParams, type ImportExportRecordDownloadParams, type ImportExportRecordQuery, type InstanceStatus, type NotificationChannel, type NotificationMessageRecord, type PageApiPermissionRecord, type PageApiResponse, type PageAppInfo, type PageBinaryResponse, type PageBridgeApi, type PageContext, type PageDataManagementConfig, type PageDataSourceDescriptor, type PageDepartmentInfo, type PageDepartmentRecord, type PageHttpMethod, type PageInfo, type PageListResult, type PageMessageApi, type PageModalApi, type PageNavigationApi, type PageOffsetListResult, type PagePermissionGroup, type PagePermissionInfo, PageProvider, type PageQueryValue, type PageRequestOptions, type PageRoleRecord, type PageRouteInfo, type PageScope, type PageSdk, type PageSdkError, type PageSdkMeta, type PageTransportDownloadPayload, type PageTransportRequestPayload, type PageUiPermissionRecord, type PageUiPermissionType, type PageUserInfo, type PageUserRecord, type PageUserType, type ProcessApproveAction, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RoleListParams, type RoleUsersParams, type SaveDataManagementConfigParams, type SearchComponentName, type SearchExpression, type SearchFieldKey, type SearchGroup, type SearchLogic, type SearchOperator, type SearchRule, type SearchSortItem, type SearchSystemField, type SendNotificationByTypeParams, type SendNotificationResult, type SubFormRule, type SwitchAppRoleParams, type SwitchPlatformRoleParams, type TerminateProcessInstanceParams, type TriggerCallbackTaskParams, type UiPermissionListParams, type UpdateApiPermissionParams, type UpdateFormPermissionGroupDto, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, createPageSdk, createReactPage, useCurrentUser, useDataSource, useFormViewPermissions, useMessage, useModal, useNavigation, usePageContext, usePageProps, usePageRoute, usePageSdk };
934
+ export { type ApiPermissionListParams, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeUserRoleParams, type ConnectorCallParams, type ConnectorInvokeParams, type ConnectorInvokeResult, type ConnectorRequestBodyType, type ConnectorResponseType, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreatePagePermissionGroupDto, type CreateRoleParams, type CreateUiPermissionParams, type CreateUserParams, type CurrentUserDepartmentParents, type CustomPageEntryConfig, type CustomPageEntryMode, type DataManagementConfigParams, type DataManagementFilterState, type DataPermissionConditionDto, type DataPermissionDto, type DataPermissionRuleDto, type FieldPermissionDto, type FindNotificationConfigParams, type FormAdvancedSearchParams, type FormChangeRecordParams, type FormCreateParams, type FormExportParams, type FormGetDetailParams, type FormImportParams, type FormPermissionGroup, type FormRemoveParams, type FormSearchParams, type FormUpdateParams, type GetParentDepartmentsOptions, type GetProcessInstanceParams, type GetUserRolesParams, type ImportExportRecordDownloadParams, type ImportExportRecordQuery, type InstanceStatus, type NotificationChannel, type NotificationChannelConfig, type NotificationChannelsConfig, type NotificationConfigLevel, type NotificationMessageRecord, type NotificationTemplate, type NotificationTemplatePreview, type NotificationTypeConfig, type PageApiPermissionRecord, type PageApiResponse, type PageAppInfo, type PageBinaryResponse, type PageBridgeApi, type PageContext, type PageDataManagementConfig, type PageDataSourceDescriptor, type PageDepartmentInfo, type PageDepartmentRecord, type PageHttpMethod, type PageInfo, type PageListResult, type PageMessageApi, type PageModalApi, type PageNavigationApi, type PageOffsetListResult, type PagePermissionGroup, type PagePermissionInfo, PageProvider, type PageQueryValue, type PageRequestOptions, type PageRoleRecord, type PageRouteInfo, type PageScope, type PageSdk, type PageSdkError, type PageSdkMeta, type PageTransportDownloadPayload, type PageTransportRequestPayload, type PageUiPermissionRecord, type PageUiPermissionType, type PageUserInfo, type PageUserRecord, type PageUserType, type PreviewNotificationTemplateParams, type ProcessApproveAction, type QueryFormPermissionGroupDto, type QueryPagePermissionGroupDto, type RoleListParams, type RoleUsersParams, type SaveDataManagementConfigParams, type SearchComponentName, type SearchExpression, type SearchFieldKey, type SearchGroup, type SearchLogic, type SearchOperator, type SearchRule, type SearchSortItem, type SearchSystemField, type SendNotificationByTypeParams, type SendNotificationResult, type SubFormRule, type SwitchAppRoleParams, type SwitchPlatformRoleParams, type TerminateProcessInstanceParams, type TriggerCallbackTaskParams, type UiPermissionListParams, type UpdateApiPermissionParams, type UpdateFormPermissionGroupDto, type UpdatePagePermissionGroupDto, type UpdateRoleParams, type UpdateUiPermissionParams, type UpdateUserParams, type UserListParams, type UserMenuPermissionsResponse, type ValidateUserParams, type ViewFieldPermissionValue, type ViewOperationPermission, type ViewPermissionSummary, createPageSdk, createReactPage, useCurrentUser, useDataSource, useFormViewPermissions, useMessage, useModal, useNavigation, usePageContext, usePageProps, usePageRoute, usePageSdk };
@@ -17,6 +17,9 @@ var resolveAppType = (context, explicitAppType) => {
17
17
  return appType;
18
18
  };
19
19
  var buildAppPath = (context, explicitAppType, suffix) => `/${resolveAppType(context, explicitAppType)}${suffix}`;
20
+ var buildOpenXiangdaAppPath = (context, explicitAppType, suffix) => `/openxiangda-api/v1/apps/${encodePathSegment(
21
+ resolveAppType(context, explicitAppType)
22
+ )}${suffix}`;
20
23
  var encodePathSegment = (value) => encodeURIComponent(String(value));
21
24
  var getHeaderValue = (headers, name) => {
22
25
  if (!headers) {
@@ -1029,7 +1032,11 @@ var createPageSdk = (context) => {
1029
1032
  };
1030
1033
  const notification = {
1031
1034
  sendByType: (params) => request({
1032
- path: "/api/notification-config/send-by-type",
1035
+ path: buildOpenXiangdaAppPath(
1036
+ context,
1037
+ params.appType,
1038
+ "/notifications/send-by-type"
1039
+ ),
1033
1040
  method: "post",
1034
1041
  body: {
1035
1042
  ...params,
@@ -1037,7 +1044,32 @@ var createPageSdk = (context) => {
1037
1044
  }
1038
1045
  }),
1039
1046
  batchSendByType: (params) => request({
1040
- path: "/api/notification-config/batch-send-by-type",
1047
+ path: buildOpenXiangdaAppPath(
1048
+ context,
1049
+ params.appType,
1050
+ "/notifications/batch-send-by-type"
1051
+ ),
1052
+ method: "post",
1053
+ body: {
1054
+ ...params,
1055
+ appType: resolveAppType(context, params.appType)
1056
+ }
1057
+ }),
1058
+ findConfig: (notificationType, params = {}) => request({
1059
+ path: buildOpenXiangdaAppPath(
1060
+ context,
1061
+ params.appType,
1062
+ `/notifications/type-configs/${encodePathSegment(notificationType)}`
1063
+ ),
1064
+ method: "get",
1065
+ query: params.formUuid ? { formUuid: params.formUuid } : void 0
1066
+ }),
1067
+ previewTemplate: (params) => request({
1068
+ path: buildOpenXiangdaAppPath(
1069
+ context,
1070
+ params.appType,
1071
+ "/notifications/templates/preview"
1072
+ ),
1041
1073
  method: "post",
1042
1074
  body: {
1043
1075
  ...params,