openxiangda 1.0.102 → 1.0.103
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.
- package/README.md +12 -0
- package/package.json +1 -1
- package/packages/sdk/dist/components/index.cjs +30 -5
- package/packages/sdk/dist/components/index.cjs.map +1 -1
- package/packages/sdk/dist/components/index.d.mts +2 -2
- package/packages/sdk/dist/components/index.d.ts +2 -2
- package/packages/sdk/dist/components/index.mjs +30 -5
- package/packages/sdk/dist/components/index.mjs.map +1 -1
- package/packages/sdk/dist/runtime/index.cjs +30 -5
- package/packages/sdk/dist/runtime/index.cjs.map +1 -1
- package/packages/sdk/dist/runtime/index.d.mts +1 -1
- package/packages/sdk/dist/runtime/index.d.ts +1 -1
- package/packages/sdk/dist/runtime/index.mjs +30 -5
- package/packages/sdk/dist/runtime/index.mjs.map +1 -1
- package/packages/sdk/dist/{types-U26h_FIh.d.mts → types-B1GRkvLM.d.mts} +3 -0
- package/packages/sdk/dist/{types-U26h_FIh.d.ts → types-B1GRkvLM.d.ts} +3 -0
|
@@ -2,7 +2,7 @@ import { PageContext, PageInfo, PageBridgeApi } from './react.mjs';
|
|
|
2
2
|
export { ApiPermissionListParams, AppAuthClient, ApproveTaskParams, AssignPermissionsParams, AssignRolesParams, AuthClientError, AuthClientOptions, AuthLogoutRedirectOptions, AuthMethod, AuthMethodType, AuthTokenData, AuthUser, BatchAddUsersToRoleParams, BatchSendNotificationByTypeParams, ChangeUserRoleParams, ConnectorCallParams, ConnectorInvokeParams, ConnectorInvokeResult, ConnectorRequestBodyType, ConnectorResponseType, CreateApiPermissionParams, CreateFormPermissionGroupDto, CreatePagePermissionGroupDto, CreateRoleParams, CreateUiPermissionParams, CreateUserParams, CurrentUserDepartmentParents, CustomPageEntryConfig, CustomPageEntryMode, DataManagementConfigParams, DataManagementFilterState, DataPermissionConditionDto, DataPermissionDto, DataPermissionRuleDto, DataViewQueryParams, DataViewQueryResult, DataViewStatsParams, DingTalkLoginInput, FieldAccessLevel, FieldAccessPolicyDto, FieldAccessPolicyItemDto, FieldPermissionDto, FindNotificationConfigParams, FormAdvancedSearchParams, FormChangeRecordParams, FormCreateParams, FormExportParams, FormGetDetailParams, FormImportParams, FormPermissionGroup, FormRemoveParams, FormSearchParams, FormUpdateParams, FunctionInvokeParams, FunctionInvokeResult, GetParentDepartmentsOptions, GetProcessInstanceParams, GetUserRolesParams, GuestLoginInput, ImportExportRecordDownloadParams, ImportExportRecordQuery, InstanceStatus, LoginMethodsResult, LoginPage, LoginPageProps, NotificationChannel, NotificationChannelConfig, NotificationChannelsConfig, NotificationConfigLevel, NotificationMessageRecord, NotificationTemplate, NotificationTemplatePreview, NotificationTypeConfig, OpenXiangdaPageProvider, OpenXiangdaPageProviderProps, OpenXiangdaProvider, OpenXiangdaProviderProps, PageApiPermissionRecord, PageApiResponse, PageAppInfo, PageBinaryResponse, PageDataManagementConfig, PageDataSourceDescriptor, PageDepartmentInfo, PageDepartmentRecord, PageHttpMethod, PageListResult, PageMessageApi, PageModalApi, PageNavigationApi, PageOffsetListResult, PagePermissionGroup, PagePermissionInfo, PageProvider, PageQueryValue, PageRequestOptions, PageRoleRecord, PageRouteInfo, PageScope, PageSdk, PageSdkError, PageSdkMeta, PageTransportDownloadPayload, PageTransportRequestPayload, PageUiPermissionRecord, PageUiPermissionType, PageUserInfo, PageUserRecord, PageUserType, PasswordLoginInput, PermissionBoundary, PermissionBoundaryFallback, PermissionBoundaryFallbackState, PermissionBoundaryProps, PhoneCodeInput, PhoneCodeLoginInput, PhoneCodeRegisterInput, PhoneCodeSendResult, PreviewNotificationTemplateParams, ProcessApproveAction, PublicAccessClaim, PublicAccessClient, PublicAccessClientError, PublicAccessClientOptions, PublicAccessGate, PublicAccessGateProps, PublicAccessSessionData, PublicAccessSessionInput, QueryFormPermissionGroupDto, QueryPagePermissionGroupDto, RefreshInput, ResolveLoginUrlInput, RoleListParams, RoleUsersParams, RouteAccessResult, RuntimeBootstrap, RuntimeErrorSnapshot, RuntimeErrorType, RuntimeLogoutOptions, RuntimeMenuItem, RuntimePagePermissions, RuntimeRedirectLoginOptions, RuntimeRequestError, RuntimeRequestState, RuntimeResolveLoginOptions, SaveDataManagementConfigParams, SearchComponentName, SearchExpression, SearchFieldKey, SearchGroup, SearchLogic, SearchOperator, SearchRule, SearchSortItem, SearchSystemField, SendNotificationByTypeParams, SendNotificationResult, SsoLoginUrlInput, SsoLoginUrlResult, SubFormRule, SwitchAppRoleParams, SwitchPlatformRoleParams, TerminateProcessInstanceParams, TriggerCallbackTaskParams, UiPermissionListParams, UpdateApiPermissionParams, UpdateFormPermissionGroupDto, UpdatePagePermissionGroupDto, UpdateRoleParams, UpdateUiPermissionParams, UpdateUserParams, UseAuthOptions, UseCanAccessRouteInput, UseLoginMethodsState, UsePublicAccessOptions, UsePublicAccessState, UserListParams, UserMenuPermissionsResponse, ValidateUserParams, ViewFieldPermissionValue, ViewOperationPermission, ViewPermissionSummary, createAuthClient, createPageSdk, createPublicAccessClient, createReactPage, useAppMenus, useAuth, useCanAccessRoute, useCurrentUser, useDataSource, useFormViewPermissions, useLoginMethods, useMessage, useModal, useNavigation, useOpenXiangda, usePageContext, usePageProps, usePageRoute, usePageSdk, usePermission, usePublicAccess, useRuntimeAuth, useRuntimeBootstrap } from './react.mjs';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import React__default from 'react';
|
|
5
|
-
import { _ as FormSchema, X as FormRuntimeApi, Y as FormRuntimeApiConfig, J as FieldDefinition } from '../types-
|
|
5
|
+
import { _ as FormSchema, X as FormRuntimeApi, Y as FormRuntimeApiConfig, J as FieldDefinition } from '../types-B1GRkvLM.mjs';
|
|
6
6
|
|
|
7
7
|
type RuntimeCssIsolation = "none" | "namespace" | "shadow";
|
|
8
8
|
interface RuntimeHostBootstrap {
|
|
@@ -2,7 +2,7 @@ import { PageContext, PageInfo, PageBridgeApi } from './react.js';
|
|
|
2
2
|
export { ApiPermissionListParams, AppAuthClient, ApproveTaskParams, AssignPermissionsParams, AssignRolesParams, AuthClientError, AuthClientOptions, AuthLogoutRedirectOptions, AuthMethod, AuthMethodType, AuthTokenData, AuthUser, BatchAddUsersToRoleParams, BatchSendNotificationByTypeParams, ChangeUserRoleParams, ConnectorCallParams, ConnectorInvokeParams, ConnectorInvokeResult, ConnectorRequestBodyType, ConnectorResponseType, CreateApiPermissionParams, CreateFormPermissionGroupDto, CreatePagePermissionGroupDto, CreateRoleParams, CreateUiPermissionParams, CreateUserParams, CurrentUserDepartmentParents, CustomPageEntryConfig, CustomPageEntryMode, DataManagementConfigParams, DataManagementFilterState, DataPermissionConditionDto, DataPermissionDto, DataPermissionRuleDto, DataViewQueryParams, DataViewQueryResult, DataViewStatsParams, DingTalkLoginInput, FieldAccessLevel, FieldAccessPolicyDto, FieldAccessPolicyItemDto, FieldPermissionDto, FindNotificationConfigParams, FormAdvancedSearchParams, FormChangeRecordParams, FormCreateParams, FormExportParams, FormGetDetailParams, FormImportParams, FormPermissionGroup, FormRemoveParams, FormSearchParams, FormUpdateParams, FunctionInvokeParams, FunctionInvokeResult, GetParentDepartmentsOptions, GetProcessInstanceParams, GetUserRolesParams, GuestLoginInput, ImportExportRecordDownloadParams, ImportExportRecordQuery, InstanceStatus, LoginMethodsResult, LoginPage, LoginPageProps, NotificationChannel, NotificationChannelConfig, NotificationChannelsConfig, NotificationConfigLevel, NotificationMessageRecord, NotificationTemplate, NotificationTemplatePreview, NotificationTypeConfig, OpenXiangdaPageProvider, OpenXiangdaPageProviderProps, OpenXiangdaProvider, OpenXiangdaProviderProps, PageApiPermissionRecord, PageApiResponse, PageAppInfo, PageBinaryResponse, PageDataManagementConfig, PageDataSourceDescriptor, PageDepartmentInfo, PageDepartmentRecord, PageHttpMethod, PageListResult, PageMessageApi, PageModalApi, PageNavigationApi, PageOffsetListResult, PagePermissionGroup, PagePermissionInfo, PageProvider, PageQueryValue, PageRequestOptions, PageRoleRecord, PageRouteInfo, PageScope, PageSdk, PageSdkError, PageSdkMeta, PageTransportDownloadPayload, PageTransportRequestPayload, PageUiPermissionRecord, PageUiPermissionType, PageUserInfo, PageUserRecord, PageUserType, PasswordLoginInput, PermissionBoundary, PermissionBoundaryFallback, PermissionBoundaryFallbackState, PermissionBoundaryProps, PhoneCodeInput, PhoneCodeLoginInput, PhoneCodeRegisterInput, PhoneCodeSendResult, PreviewNotificationTemplateParams, ProcessApproveAction, PublicAccessClaim, PublicAccessClient, PublicAccessClientError, PublicAccessClientOptions, PublicAccessGate, PublicAccessGateProps, PublicAccessSessionData, PublicAccessSessionInput, QueryFormPermissionGroupDto, QueryPagePermissionGroupDto, RefreshInput, ResolveLoginUrlInput, RoleListParams, RoleUsersParams, RouteAccessResult, RuntimeBootstrap, RuntimeErrorSnapshot, RuntimeErrorType, RuntimeLogoutOptions, RuntimeMenuItem, RuntimePagePermissions, RuntimeRedirectLoginOptions, RuntimeRequestError, RuntimeRequestState, RuntimeResolveLoginOptions, SaveDataManagementConfigParams, SearchComponentName, SearchExpression, SearchFieldKey, SearchGroup, SearchLogic, SearchOperator, SearchRule, SearchSortItem, SearchSystemField, SendNotificationByTypeParams, SendNotificationResult, SsoLoginUrlInput, SsoLoginUrlResult, SubFormRule, SwitchAppRoleParams, SwitchPlatformRoleParams, TerminateProcessInstanceParams, TriggerCallbackTaskParams, UiPermissionListParams, UpdateApiPermissionParams, UpdateFormPermissionGroupDto, UpdatePagePermissionGroupDto, UpdateRoleParams, UpdateUiPermissionParams, UpdateUserParams, UseAuthOptions, UseCanAccessRouteInput, UseLoginMethodsState, UsePublicAccessOptions, UsePublicAccessState, UserListParams, UserMenuPermissionsResponse, ValidateUserParams, ViewFieldPermissionValue, ViewOperationPermission, ViewPermissionSummary, createAuthClient, createPageSdk, createPublicAccessClient, createReactPage, useAppMenus, useAuth, useCanAccessRoute, useCurrentUser, useDataSource, useFormViewPermissions, useLoginMethods, useMessage, useModal, useNavigation, useOpenXiangda, usePageContext, usePageProps, usePageRoute, usePageSdk, usePermission, usePublicAccess, useRuntimeAuth, useRuntimeBootstrap } from './react.js';
|
|
3
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
4
|
import React__default from 'react';
|
|
5
|
-
import { _ as FormSchema, X as FormRuntimeApi, Y as FormRuntimeApiConfig, J as FieldDefinition } from '../types-
|
|
5
|
+
import { _ as FormSchema, X as FormRuntimeApi, Y as FormRuntimeApiConfig, J as FieldDefinition } from '../types-B1GRkvLM.js';
|
|
6
6
|
|
|
7
7
|
type RuntimeCssIsolation = "none" | "namespace" | "shadow";
|
|
8
8
|
interface RuntimeHostBootstrap {
|
|
@@ -5142,6 +5142,7 @@ import { Alert as Alert4, Button as Button17, Card as Card3, Empty as Empty9, Sp
|
|
|
5142
5142
|
// packages/sdk/src/components/core/runtimeApi.ts
|
|
5143
5143
|
var DEFAULT_CHUNK_SIZE = 5 * 1024 * 1024;
|
|
5144
5144
|
var CHUNK_UPLOAD_THRESHOLD = 10 * 1024 * 1024;
|
|
5145
|
+
var DEFAULT_PUBLIC_FILE_BUCKET = "public-assets";
|
|
5145
5146
|
var trimTrailingSlash2 = (value) => String(value || "").replace(/\/$/, "");
|
|
5146
5147
|
var getDefaultBaseUrl = () => {
|
|
5147
5148
|
const globalEnv = globalThis.process?.env;
|
|
@@ -5188,6 +5189,7 @@ var normalizeFilePayloadUrls = (baseUrl, payload) => {
|
|
|
5188
5189
|
...payload,
|
|
5189
5190
|
url: normalizeRuntimeFileUrl(baseUrl, payload.url),
|
|
5190
5191
|
downloadUrl: normalizeRuntimeFileUrl(baseUrl, payload.downloadUrl),
|
|
5192
|
+
publicUrl: normalizeRuntimeFileUrl(baseUrl, payload.publicUrl),
|
|
5191
5193
|
relayUrl: normalizeRuntimeFileUrl(baseUrl, payload.relayUrl),
|
|
5192
5194
|
previewUrl: normalizeRuntimeFileUrl(baseUrl, payload.previewUrl),
|
|
5193
5195
|
metadataUrl: normalizeRuntimeFileUrl(baseUrl, payload.metadataUrl),
|
|
@@ -5283,6 +5285,8 @@ var normalizeUploadData = (data, file, bucketName, baseUrl = "") => {
|
|
|
5283
5285
|
url: normalizeRuntimeFileUrl(baseUrl, item?.url) || "",
|
|
5284
5286
|
downloadUrl: normalizeRuntimeFileUrl(baseUrl, item?.downloadUrl),
|
|
5285
5287
|
previewUrl: normalizeRuntimeFileUrl(baseUrl, item?.previewUrl),
|
|
5288
|
+
publicUrl: normalizeRuntimeFileUrl(baseUrl, item?.publicUrl),
|
|
5289
|
+
visibility: item?.visibility,
|
|
5286
5290
|
status: "done",
|
|
5287
5291
|
size: item?.size ?? file.size,
|
|
5288
5292
|
objectName,
|
|
@@ -5291,7 +5295,7 @@ var normalizeUploadData = (data, file, bucketName, baseUrl = "") => {
|
|
|
5291
5295
|
mimeType: item?.contentType || file.type
|
|
5292
5296
|
};
|
|
5293
5297
|
};
|
|
5294
|
-
var uploadWithXhr = (baseUrl, file, bucketName, onProgress) => new Promise((resolve, reject) => {
|
|
5298
|
+
var uploadWithXhr = (baseUrl, file, bucketName, onProgress, options = {}) => new Promise((resolve, reject) => {
|
|
5295
5299
|
if (globalThis.process?.env?.VITEST) {
|
|
5296
5300
|
onProgress?.(100);
|
|
5297
5301
|
resolve({
|
|
@@ -5302,14 +5306,24 @@ var uploadWithXhr = (baseUrl, file, bucketName, onProgress) => new Promise((reso
|
|
|
5302
5306
|
status: "done",
|
|
5303
5307
|
size: file.size,
|
|
5304
5308
|
bucketName,
|
|
5305
|
-
contentType: file.type
|
|
5309
|
+
contentType: file.type,
|
|
5310
|
+
visibility: options.visibility
|
|
5306
5311
|
});
|
|
5307
5312
|
return;
|
|
5308
5313
|
}
|
|
5309
5314
|
const xhr = new XMLHttpRequest();
|
|
5310
5315
|
const formData = new FormData();
|
|
5311
5316
|
formData.append("files", file);
|
|
5312
|
-
xhr.open(
|
|
5317
|
+
xhr.open(
|
|
5318
|
+
"POST",
|
|
5319
|
+
joinUrl(
|
|
5320
|
+
baseUrl,
|
|
5321
|
+
appendQuery2("/file/upload", {
|
|
5322
|
+
bucketName,
|
|
5323
|
+
visibility: options.visibility
|
|
5324
|
+
})
|
|
5325
|
+
)
|
|
5326
|
+
);
|
|
5313
5327
|
xhr.withCredentials = true;
|
|
5314
5328
|
const token = typeof window !== "undefined" ? window.localStorage?.getItem("token") : void 0;
|
|
5315
5329
|
if (token) xhr.setRequestHeader("authorization", token);
|
|
@@ -5333,7 +5347,7 @@ var uploadWithXhr = (baseUrl, file, bucketName, onProgress) => new Promise((reso
|
|
|
5333
5347
|
xhr.onerror = () => reject(new Error("\u4E0A\u4F20\u5931\u8D25"));
|
|
5334
5348
|
xhr.send(formData);
|
|
5335
5349
|
});
|
|
5336
|
-
async function uploadChunkedFile(request, file, bucketName, baseUrl, onProgress) {
|
|
5350
|
+
async function uploadChunkedFile(request, file, bucketName, baseUrl, onProgress, options = {}) {
|
|
5337
5351
|
const initiate = await request({
|
|
5338
5352
|
url: "/file/multipart/initiate",
|
|
5339
5353
|
method: "post",
|
|
@@ -5341,7 +5355,8 @@ async function uploadChunkedFile(request, file, bucketName, baseUrl, onProgress)
|
|
|
5341
5355
|
fileName: file.name,
|
|
5342
5356
|
fileSize: file.size,
|
|
5343
5357
|
chunkSize: DEFAULT_CHUNK_SIZE,
|
|
5344
|
-
bucketName
|
|
5358
|
+
bucketName,
|
|
5359
|
+
visibility: options.visibility
|
|
5345
5360
|
}
|
|
5346
5361
|
});
|
|
5347
5362
|
const uploadInfo = initiate.data || initiate.result;
|
|
@@ -5402,6 +5417,16 @@ function createFormRuntimeApi(config3) {
|
|
|
5402
5417
|
}
|
|
5403
5418
|
return uploadWithXhr(baseUrl, file, bucketName, onProgress);
|
|
5404
5419
|
},
|
|
5420
|
+
uploadPublicFile: async (file, bucketName = DEFAULT_PUBLIC_FILE_BUCKET, onProgress) => {
|
|
5421
|
+
if (file.size > CHUNK_UPLOAD_THRESHOLD) {
|
|
5422
|
+
return uploadChunkedFile(request, file, bucketName, baseUrl, onProgress, {
|
|
5423
|
+
visibility: "public"
|
|
5424
|
+
});
|
|
5425
|
+
}
|
|
5426
|
+
return uploadWithXhr(baseUrl, file, bucketName, onProgress, {
|
|
5427
|
+
visibility: "public"
|
|
5428
|
+
});
|
|
5429
|
+
},
|
|
5405
5430
|
deleteFile: async (objectName, bucketName = "files") => {
|
|
5406
5431
|
await request({ url: "/file/delete", method: "post", data: { bucketName, objectName } });
|
|
5407
5432
|
return { success: true };
|