openxiangda 1.0.16 → 1.0.18

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.
@@ -632,6 +632,29 @@ interface TriggerCallbackTaskParams {
632
632
  taskId: string;
633
633
  payload?: unknown;
634
634
  }
635
+ type ConnectorRequestBodyType = "json" | "form-data" | "x-www-form-urlencoded" | "text" | "raw";
636
+ type ConnectorResponseType = "json" | "text" | "binary";
637
+ interface ConnectorInvokeParams<TBody = unknown> {
638
+ appType?: string;
639
+ connector: string;
640
+ api: string;
641
+ pathParams?: Record<string, unknown>;
642
+ query?: Record<string, unknown>;
643
+ body?: TBody;
644
+ headers?: Record<string, string>;
645
+ requestBodyType?: ConnectorRequestBodyType;
646
+ responseType?: ConnectorResponseType;
647
+ }
648
+ interface ConnectorInvokeResult<TResult = unknown> {
649
+ status: number;
650
+ duration: number;
651
+ data: TResult;
652
+ headers?: Record<string, unknown>;
653
+ contentType?: string;
654
+ encoding?: "base64";
655
+ }
656
+ interface ConnectorCallParams<TBody = unknown> extends Omit<ConnectorInvokeParams<TBody>, "connector" | "api"> {
657
+ }
635
658
  interface PageSdk {
636
659
  context: PageContext;
637
660
  request<TResult = unknown, TRaw = TResult>(options: PageRequestOptions): Promise<PageApiResponse<TResult, TRaw>>;
@@ -640,6 +663,11 @@ interface PageSdk {
640
663
  request<TResult = unknown, TRaw = TResult>(options: PageRequestOptions): Promise<PageApiResponse<TResult, TRaw>>;
641
664
  download(options: PageRequestOptions): Promise<PageBinaryResponse>;
642
665
  };
666
+ connector: {
667
+ invoke<TResult = unknown, TBody = unknown>(params: ConnectorInvokeParams<TBody>): Promise<PageApiResponse<ConnectorInvokeResult<TResult>>>;
668
+ call<TResult = unknown, TBody = unknown>(name: string, params?: ConnectorCallParams<TBody>): Promise<PageApiResponse<ConnectorInvokeResult<TResult>>>;
669
+ download<TBody = unknown>(params: ConnectorInvokeParams<TBody>): Promise<PageBinaryResponse>;
670
+ };
643
671
  form: {
644
672
  getDetail<T = unknown>(params: FormGetDetailParams): Promise<PageApiResponse<T>>;
645
673
  create<T = unknown, TRaw = unknown>(params: FormCreateParams): Promise<PageApiResponse<T, TRaw>>;
@@ -828,4 +856,4 @@ declare const usePageRoute: () => PageRouteInfo;
828
856
 
829
857
  declare const usePageSdk: () => PageSdk;
830
858
 
831
- export { type ApiPermissionListParams, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeUserRoleParams, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreatePagePermissionGroupDto, type CreateRoleParams, type CreateUiPermissionParams, type CreateUserParams, type CurrentUserDepartmentParents, 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 };
859
+ 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 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 };
@@ -632,6 +632,29 @@ interface TriggerCallbackTaskParams {
632
632
  taskId: string;
633
633
  payload?: unknown;
634
634
  }
635
+ type ConnectorRequestBodyType = "json" | "form-data" | "x-www-form-urlencoded" | "text" | "raw";
636
+ type ConnectorResponseType = "json" | "text" | "binary";
637
+ interface ConnectorInvokeParams<TBody = unknown> {
638
+ appType?: string;
639
+ connector: string;
640
+ api: string;
641
+ pathParams?: Record<string, unknown>;
642
+ query?: Record<string, unknown>;
643
+ body?: TBody;
644
+ headers?: Record<string, string>;
645
+ requestBodyType?: ConnectorRequestBodyType;
646
+ responseType?: ConnectorResponseType;
647
+ }
648
+ interface ConnectorInvokeResult<TResult = unknown> {
649
+ status: number;
650
+ duration: number;
651
+ data: TResult;
652
+ headers?: Record<string, unknown>;
653
+ contentType?: string;
654
+ encoding?: "base64";
655
+ }
656
+ interface ConnectorCallParams<TBody = unknown> extends Omit<ConnectorInvokeParams<TBody>, "connector" | "api"> {
657
+ }
635
658
  interface PageSdk {
636
659
  context: PageContext;
637
660
  request<TResult = unknown, TRaw = TResult>(options: PageRequestOptions): Promise<PageApiResponse<TResult, TRaw>>;
@@ -640,6 +663,11 @@ interface PageSdk {
640
663
  request<TResult = unknown, TRaw = TResult>(options: PageRequestOptions): Promise<PageApiResponse<TResult, TRaw>>;
641
664
  download(options: PageRequestOptions): Promise<PageBinaryResponse>;
642
665
  };
666
+ connector: {
667
+ invoke<TResult = unknown, TBody = unknown>(params: ConnectorInvokeParams<TBody>): Promise<PageApiResponse<ConnectorInvokeResult<TResult>>>;
668
+ call<TResult = unknown, TBody = unknown>(name: string, params?: ConnectorCallParams<TBody>): Promise<PageApiResponse<ConnectorInvokeResult<TResult>>>;
669
+ download<TBody = unknown>(params: ConnectorInvokeParams<TBody>): Promise<PageBinaryResponse>;
670
+ };
643
671
  form: {
644
672
  getDetail<T = unknown>(params: FormGetDetailParams): Promise<PageApiResponse<T>>;
645
673
  create<T = unknown, TRaw = unknown>(params: FormCreateParams): Promise<PageApiResponse<T, TRaw>>;
@@ -828,4 +856,4 @@ declare const usePageRoute: () => PageRouteInfo;
828
856
 
829
857
  declare const usePageSdk: () => PageSdk;
830
858
 
831
- export { type ApiPermissionListParams, type ApproveTaskParams, type AssignPermissionsParams, type AssignRolesParams, type BatchAddUsersToRoleParams, type BatchSendNotificationByTypeParams, type ChangeUserRoleParams, type CreateApiPermissionParams, type CreateFormPermissionGroupDto, type CreatePagePermissionGroupDto, type CreateRoleParams, type CreateUiPermissionParams, type CreateUserParams, type CurrentUserDepartmentParents, 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 };
859
+ 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 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 };
@@ -50,6 +50,17 @@ var parseContentDispositionFileName = (contentDisposition) => {
50
50
  }
51
51
  return void 0;
52
52
  };
53
+ var parseConnectorCallName = (name) => {
54
+ const value = String(name || "").trim();
55
+ const separatorIndex = value.indexOf(".");
56
+ if (separatorIndex <= 0 || separatorIndex === value.length - 1) {
57
+ throw new Error("\u8FDE\u63A5\u5668\u8C03\u7528\u540D\u5FC5\u987B\u662F connector.api \u683C\u5F0F");
58
+ }
59
+ return {
60
+ connector: value.slice(0, separatorIndex),
61
+ api: value.slice(separatorIndex + 1)
62
+ };
63
+ };
53
64
  var serializeQuery = (query) => {
54
65
  if (!query) {
55
66
  return void 0;
@@ -339,6 +350,52 @@ var createPageSdk = (context) => {
339
350
  throw toSdkError(error, payload);
340
351
  }
341
352
  };
353
+ const connector = {
354
+ invoke: (params) => request({
355
+ path: buildAppPath(
356
+ context,
357
+ params.appType,
358
+ "/v1/connectors/actions/invoke"
359
+ ),
360
+ method: "post",
361
+ body: {
362
+ connector: params.connector,
363
+ api: params.api,
364
+ pathParams: params.pathParams,
365
+ query: params.query,
366
+ body: params.body,
367
+ headers: params.headers,
368
+ requestBodyType: params.requestBodyType,
369
+ responseType: params.responseType
370
+ }
371
+ }),
372
+ call: (name, params = {}) => {
373
+ const target = parseConnectorCallName(name);
374
+ return connector.invoke({
375
+ ...params,
376
+ connector: target.connector,
377
+ api: target.api
378
+ });
379
+ },
380
+ download: (params) => download({
381
+ path: buildAppPath(
382
+ context,
383
+ params.appType,
384
+ "/v1/connectors/actions/download"
385
+ ),
386
+ method: "post",
387
+ body: {
388
+ connector: params.connector,
389
+ api: params.api,
390
+ pathParams: params.pathParams,
391
+ query: params.query,
392
+ body: params.body,
393
+ headers: params.headers,
394
+ requestBodyType: params.requestBodyType,
395
+ responseType: "binary"
396
+ }
397
+ })
398
+ };
342
399
  const form = {
343
400
  getDetail: (params) => request({
344
401
  path: buildAppPath(
@@ -996,6 +1053,7 @@ var createPageSdk = (context) => {
996
1053
  request,
997
1054
  download
998
1055
  },
1056
+ connector,
999
1057
  form,
1000
1058
  user,
1001
1059
  department,
@@ -1098,19 +1156,20 @@ var antdTheme = {
1098
1156
  cssVar: { prefix: "sy-ant" },
1099
1157
  hashed: false,
1100
1158
  token: {
1101
- colorPrimary: "var(--sy-color-primary)",
1102
- colorSuccess: "var(--sy-color-success)",
1103
- colorWarning: "var(--sy-color-warning)",
1104
- colorError: "var(--sy-color-error)",
1105
- colorText: "var(--sy-color-text)",
1106
- colorTextSecondary: "var(--sy-color-text-secondary)",
1107
- colorTextTertiary: "var(--sy-color-text-tertiary)",
1108
- colorTextDisabled: "var(--sy-color-text-disabled)",
1109
- colorBgContainer: "var(--sy-color-bg-container)",
1110
- colorBgLayout: "var(--sy-color-bg-layout)",
1111
- colorBgElevated: "var(--sy-color-bg-elevated)",
1112
- colorBorder: "var(--sy-color-border)",
1113
- colorBorderSecondary: "var(--sy-color-border-secondary)",
1159
+ colorPrimary: "#1677ff",
1160
+ colorInfo: "#1677ff",
1161
+ colorSuccess: "#52c41a",
1162
+ colorWarning: "#faad14",
1163
+ colorError: "#ff4d4f",
1164
+ colorText: "rgba(0,0,0,0.88)",
1165
+ colorTextSecondary: "rgba(0,0,0,0.65)",
1166
+ colorTextTertiary: "rgba(0,0,0,0.45)",
1167
+ colorTextDisabled: "rgba(0,0,0,0.25)",
1168
+ colorBgContainer: "#ffffff",
1169
+ colorBgLayout: "#f5f5f5",
1170
+ colorBgElevated: "#ffffff",
1171
+ colorBorder: "#d9d9d9",
1172
+ colorBorderSecondary: "#f0f0f0",
1114
1173
  borderRadius: 6,
1115
1174
  borderRadiusSM: 4,
1116
1175
  borderRadiusLG: 8,