@nocobase/plugin-file-manager 0.11.1-alpha.5 → 0.12.0-alpha.2
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/client.d.ts +2 -3
- package/client.js +1 -1
- package/dist/client/index.js +979 -0
- package/{lib → dist}/index.d.ts +1 -0
- package/dist/index.js +18 -0
- package/dist/locale/en-US.js +25 -0
- package/dist/locale/fr-FR.js +25 -0
- package/dist/locale/ja-JP.js +22 -0
- package/dist/locale/ru-RU.js +22 -0
- package/dist/locale/tr-TR.js +21 -0
- package/dist/locale/zh-CN.js +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/LICENSE +201 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/S3.js +197 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/S3Client.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/AbortMultipartUploadCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/CompleteMultipartUploadCommand.js +57 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/CopyObjectCommand.js +57 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/CreateBucketCommand.js +55 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/CreateMultipartUploadCommand.js +55 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketAnalyticsConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketCorsCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketEncryptionCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketIntelligentTieringConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketInventoryConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketLifecycleCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketMetricsConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketOwnershipControlsCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketPolicyCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketReplicationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketTaggingCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteBucketWebsiteCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteObjectCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteObjectTaggingCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeleteObjectsCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/DeletePublicAccessBlockCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketAccelerateConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketAclCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketAnalyticsConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketCorsCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketEncryptionCommand.js +53 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketIntelligentTieringConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketInventoryConfigurationCommand.js +53 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketLifecycleConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketLocationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketLoggingCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketMetricsConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketNotificationConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketOwnershipControlsCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketPolicyCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketPolicyStatusCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketReplicationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketRequestPaymentCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketTaggingCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketVersioningCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetBucketWebsiteCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetObjectAclCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetObjectAttributesCommand.js +55 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetObjectCommand.js +62 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetObjectLegalHoldCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetObjectLockConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetObjectRetentionCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetObjectTaggingCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetObjectTorrentCommand.js +53 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/GetPublicAccessBlockCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/HeadBucketCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/HeadObjectCommand.js +55 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/ListBucketAnalyticsConfigurationsCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/ListBucketIntelligentTieringConfigurationsCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/ListBucketInventoryConfigurationsCommand.js +53 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/ListBucketMetricsConfigurationsCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/ListBucketsCommand.js +51 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/ListMultipartUploadsCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/ListObjectVersionsCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/ListObjectsCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/ListObjectsV2Command.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/ListPartsCommand.js +55 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketAccelerateConfigurationCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketAclCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketAnalyticsConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketCorsCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketEncryptionCommand.js +59 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketIntelligentTieringConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketInventoryConfigurationCommand.js +53 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketLifecycleConfigurationCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketLoggingCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketMetricsConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketNotificationConfigurationCommand.js +52 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketOwnershipControlsCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketPolicyCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketReplicationCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketRequestPaymentCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketTaggingCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketVersioningCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutBucketWebsiteCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutObjectAclCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutObjectCommand.js +63 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutObjectLegalHoldCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutObjectLockConfigurationCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutObjectRetentionCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutObjectTaggingCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/PutPublicAccessBlockCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/RestoreObjectCommand.js +59 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/SelectObjectContentCommand.js +55 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/UploadPartCommand.js +61 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/UploadPartCopyCommand.js +57 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/WriteGetObjectResponseCommand.js +53 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/commands/index.js +96 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/EndpointParameters.js +15 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/endpointResolver.js +12 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/endpoint/ruleset.js +7 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +31 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/models/S3ServiceException.js +12 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/models/index.js +5 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/models/models_0.js +629 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/models/models_1.js +139 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/pagination/Interfaces.js +2 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/pagination/ListObjectsV2Paginator.js +29 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/pagination/ListPartsPaginator.js +29 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/pagination/index.js +6 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/protocols/Aws_restXml.js +9691 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.browser.js +47 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.js +56 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.native.js +15 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/runtimeConfig.shared.js +28 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/waiters/index.js +7 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/waiters/waitForBucketExists.js +31 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/waiters/waitForBucketNotExists.js +30 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/waiters/waitForObjectExists.js +31 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/waiters/waitForObjectNotExists.js +30 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/S3.js +193 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/S3Client.js +44 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/AbortMultipartUploadCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/CompleteMultipartUploadCommand.js +53 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/CopyObjectCommand.js +53 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateBucketCommand.js +51 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/CreateMultipartUploadCommand.js +51 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketAnalyticsConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketCorsCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketEncryptionCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketIntelligentTieringConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketInventoryConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketLifecycleCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketMetricsConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketOwnershipControlsCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketPolicyCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketReplicationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketTaggingCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteBucketWebsiteCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectTaggingCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeleteObjectsCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/DeletePublicAccessBlockCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAccelerateConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAclCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketAnalyticsConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketCorsCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketEncryptionCommand.js +49 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketIntelligentTieringConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketInventoryConfigurationCommand.js +49 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLifecycleConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLocationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketLoggingCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketMetricsConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketNotificationConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketOwnershipControlsCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketPolicyCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketPolicyStatusCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketReplicationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketRequestPaymentCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketTaggingCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketVersioningCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetBucketWebsiteCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectAclCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectAttributesCommand.js +51 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectCommand.js +58 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectLegalHoldCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectLockConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectRetentionCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectTaggingCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetObjectTorrentCommand.js +49 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/GetPublicAccessBlockCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/HeadBucketCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/HeadObjectCommand.js +51 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketAnalyticsConfigurationsCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketIntelligentTieringConfigurationsCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketInventoryConfigurationsCommand.js +49 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketMetricsConfigurationsCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/ListBucketsCommand.js +47 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/ListMultipartUploadsCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectVersionsCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectsCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/ListObjectsV2Command.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/ListPartsCommand.js +51 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAccelerateConfigurationCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAclCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketAnalyticsConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketCorsCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketEncryptionCommand.js +55 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketIntelligentTieringConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketInventoryConfigurationCommand.js +49 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketLifecycleConfigurationCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketLoggingCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketMetricsConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketNotificationConfigurationCommand.js +48 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketOwnershipControlsCommand.js +50 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketPolicyCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketReplicationCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketRequestPaymentCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketTaggingCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketVersioningCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutBucketWebsiteCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectAclCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectCommand.js +59 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectLegalHoldCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectLockConfigurationCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectRetentionCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutObjectTaggingCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/PutPublicAccessBlockCommand.js +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/RestoreObjectCommand.js +55 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/SelectObjectContentCommand.js +51 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/UploadPartCommand.js +57 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/UploadPartCopyCommand.js +53 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/WriteGetObjectResponseCommand.js +49 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/commands/index.js +93 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/endpoint/EndpointParameters.js +11 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/endpoint/endpointResolver.js +8 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/endpoint/ruleset.js +4 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/index.js +7 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/models/S3ServiceException.js +8 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/models/index.js +2 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/models/models_0.js +589 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/models/models_1.js +122 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/pagination/Interfaces.js +1 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/pagination/ListObjectsV2Paginator.js +25 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/pagination/ListPartsPaginator.js +25 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/pagination/index.js +3 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/protocols/Aws_restXml.js +9499 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.browser.js +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.js +51 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.native.js +11 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/runtimeConfig.shared.js +24 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/waiters/index.js +4 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForBucketExists.js +26 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForBucketNotExists.js +25 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectExists.js +26 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-es/waiters/waitForObjectNotExists.js +25 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/S3.d.ts +661 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/S3Client.d.ts +299 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/AbortMultipartUploadCommand.d.ts +131 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/CompleteMultipartUploadCommand.d.ts +260 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/CopyObjectCommand.d.ts +370 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateBucketCommand.d.ts +213 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/CreateMultipartUploadCommand.d.ts +427 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketAnalyticsConfigurationCommand.d.ts +100 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketCommand.d.ts +97 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketCorsCommand.d.ts +103 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketEncryptionCommand.d.ts +94 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketIntelligentTieringConfigurationCommand.d.ts +93 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketInventoryConfigurationCommand.d.ts +98 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketLifecycleCommand.d.ts +105 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketMetricsConfigurationCommand.d.ts +106 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketOwnershipControlsCommand.d.ts +90 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketPolicyCommand.d.ts +115 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketReplicationCommand.d.ts +107 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketTaggingCommand.d.ts +99 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteBucketWebsiteCommand.d.ts +106 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteObjectCommand.d.ts +130 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteObjectTaggingCommand.d.ts +130 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeleteObjectsCommand.d.ts +229 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/DeletePublicAccessBlockCommand.d.ts +99 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketAccelerateConfigurationCommand.d.ts +100 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketAclCommand.d.ts +114 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketAnalyticsConfigurationCommand.d.ts +133 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketCorsCommand.d.ts +144 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketEncryptionCommand.d.ts +105 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketIntelligentTieringConfigurationCommand.d.ts +120 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketInventoryConfigurationCommand.d.ts +128 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketLifecycleConfigurationCommand.d.ts +207 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketLocationCommand.d.ts +115 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketLoggingCommand.d.ts +103 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketMetricsConfigurationCommand.d.ts +127 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketNotificationConfigurationCommand.d.ts +153 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketOwnershipControlsCommand.d.ts +98 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketPolicyCommand.d.ts +120 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketPolicyStatusCommand.d.ts +104 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketReplicationCommand.d.ts +194 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketRequestPaymentCommand.d.ts +100 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketTaggingCommand.d.ts +133 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketVersioningCommand.d.ts +114 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetBucketWebsiteCommand.d.ts +138 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectAclCommand.d.ts +188 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectAttributesCommand.d.ts +263 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectCommand.d.ts +351 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectLegalHoldCommand.d.ts +89 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectLockConfigurationCommand.d.ts +93 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectRetentionCommand.d.ts +90 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectTaggingCommand.d.ts +162 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetObjectTorrentCommand.d.ts +105 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/GetPublicAccessBlockCommand.d.ts +115 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/HeadBucketCommand.d.ts +106 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/HeadObjectCommand.d.ts +267 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketAnalyticsConfigurationsCommand.d.ts +146 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketIntelligentTieringConfigurationsCommand.d.ts +125 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketInventoryConfigurationsCommand.d.ts +141 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketMetricsConfigurationsCommand.d.ts +135 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListBucketsCommand.d.ts +114 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListMultipartUploadsCommand.d.ts +258 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListObjectVersionsCommand.d.ts +213 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListObjectsCommand.d.ts +195 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListObjectsV2Command.d.ts +197 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/ListPartsCommand.d.ts +201 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketAccelerateConfigurationCommand.d.ts +114 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketAclCommand.d.ts +302 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketAnalyticsConfigurationCommand.d.ts +206 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketCorsCommand.d.ts +192 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketEncryptionCommand.d.ts +119 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketIntelligentTieringConfigurationCommand.d.ts +151 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketInventoryConfigurationCommand.d.ts +184 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketLifecycleConfigurationCommand.d.ts +248 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketLoggingCommand.d.ts +200 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketMetricsConfigurationCommand.d.ts +140 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketNotificationConfigurationCommand.d.ts +205 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketOwnershipControlsCommand.d.ts +98 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketPolicyCommand.d.ts +118 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketReplicationCommand.d.ts +227 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketRequestPaymentCommand.d.ts +108 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketTaggingCommand.d.ts +179 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketVersioningCommand.d.ts +134 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutBucketWebsiteCommand.d.ts +242 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectAclCommand.d.ts +303 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectCommand.d.ts +366 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectLegalHoldCommand.d.ts +85 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectLockConfigurationCommand.d.ts +107 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectRetentionCommand.d.ts +88 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutObjectTaggingCommand.d.ts +205 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/PutPublicAccessBlockCommand.d.ts +116 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/RestoreObjectCommand.d.ts +439 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/SelectObjectContentCommand.d.ts +247 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/UploadPartCommand.d.ts +249 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/UploadPartCopyCommand.d.ts +320 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/WriteGetObjectResponseCommand.d.ts +152 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/commands/index.d.ts +93 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/endpoint/EndpointParameters.d.ts +32 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/endpoint/endpointResolver.d.ts +5 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/endpoint/ruleset.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/index.d.ts +12 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/models/S3ServiceException.d.ts +13 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/models/index.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/models/models_0.d.ts +10348 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/models/models_1.d.ts +1764 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/pagination/Interfaces.d.ts +8 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/pagination/ListObjectsV2Paginator.d.ts +7 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/pagination/ListPartsPaginator.d.ts +7 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/pagination/index.d.ts +3 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/protocols/Aws_restXml.d.ts +839 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/runtimeConfig.browser.d.ts +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/runtimeConfig.d.ts +54 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/runtimeConfig.native.d.ts +53 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/runtimeConfig.shared.d.ts +25 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/S3.d.ts +1646 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/S3Client.d.ts +693 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/AbortMultipartUploadCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/CompleteMultipartUploadCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/CopyObjectCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/CreateBucketCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/CreateMultipartUploadCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketAnalyticsConfigurationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketCommand.d.ts +33 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketCorsCommand.d.ts +33 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketEncryptionCommand.d.ts +37 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketIntelligentTieringConfigurationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketInventoryConfigurationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketLifecycleCommand.d.ts +37 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketMetricsConfigurationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketOwnershipControlsCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketPolicyCommand.d.ts +34 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketReplicationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketTaggingCommand.d.ts +34 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteBucketWebsiteCommand.d.ts +34 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteObjectCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteObjectTaggingCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeleteObjectsCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/DeletePublicAccessBlockCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketAccelerateConfigurationCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketAclCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketAnalyticsConfigurationCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketCorsCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketEncryptionCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketIntelligentTieringConfigurationCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketInventoryConfigurationCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketLifecycleConfigurationCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketLocationCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketLoggingCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketMetricsConfigurationCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketNotificationConfigurationCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketOwnershipControlsCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketPolicyCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketPolicyStatusCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketReplicationCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketRequestPaymentCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketTaggingCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketVersioningCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetBucketWebsiteCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetObjectAclCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetObjectAttributesCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetObjectCommand.d.ts +36 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetObjectLegalHoldCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetObjectLockConfigurationCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetObjectRetentionCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetObjectTaggingCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetObjectTorrentCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/GetPublicAccessBlockCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/HeadBucketCommand.d.ts +33 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/HeadObjectCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListBucketAnalyticsConfigurationsCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListBucketIntelligentTieringConfigurationsCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListBucketInventoryConfigurationsCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListBucketMetricsConfigurationsCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListBucketsCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListMultipartUploadsCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListObjectVersionsCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListObjectsCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListObjectsV2Command.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/ListPartsCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketAccelerateConfigurationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketAclCommand.d.ts +33 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketAnalyticsConfigurationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketCorsCommand.d.ts +33 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketEncryptionCommand.d.ts +34 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketIntelligentTieringConfigurationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketInventoryConfigurationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketLifecycleConfigurationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketLoggingCommand.d.ts +33 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketMetricsConfigurationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketNotificationConfigurationCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketOwnershipControlsCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketPolicyCommand.d.ts +33 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketReplicationCommand.d.ts +37 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketRequestPaymentCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketTaggingCommand.d.ts +33 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketVersioningCommand.d.ts +34 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutBucketWebsiteCommand.d.ts +33 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutObjectAclCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutObjectCommand.d.ts +41 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutObjectLegalHoldCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutObjectLockConfigurationCommand.d.ts +42 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutObjectRetentionCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutObjectTaggingCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/PutPublicAccessBlockCommand.d.ts +37 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/RestoreObjectCommand.d.ts +35 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/SelectObjectContentCommand.d.ts +39 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/UploadPartCommand.d.ts +41 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/UploadPartCopyCommand.d.ts +38 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/WriteGetObjectResponseCommand.d.ts +43 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/commands/index.d.ts +93 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +46 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/index.d.ts +7 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/S3ServiceException.d.ts +8 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/index.d.ts +2 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_0.d.ts +2211 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/models/models_1.d.ts +460 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/pagination/Interfaces.d.ts +5 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/pagination/ListObjectsV2Paginator.d.ts +11 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/pagination/ListPartsPaginator.d.ts +11 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/pagination/index.d.ts +3 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/protocols/Aws_restXml.d.ts +1125 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/runtimeConfig.browser.d.ts +115 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/runtimeConfig.d.ts +115 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/runtimeConfig.native.d.ts +100 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/runtimeConfig.shared.d.ts +33 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/waiters/index.d.ts +4 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/waiters/waitForBucketExists.d.ts +11 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/waiters/waitForBucketNotExists.d.ts +11 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/waiters/waitForObjectExists.d.ts +11 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/ts3.4/waiters/waitForObjectNotExists.d.ts +11 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/waiters/index.d.ts +4 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/waiters/waitForBucketExists.d.ts +14 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/waiters/waitForBucketNotExists.d.ts +14 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/waiters/waitForObjectExists.d.ts +14 -0
- package/dist/node_modules/@aws-sdk/client-s3/dist-types/waiters/waitForObjectNotExists.d.ts +14 -0
- package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -0
- package/dist/node_modules/mime-match/.travis.yml +11 -0
- package/dist/node_modules/mime-match/example.js +17 -0
- package/dist/node_modules/mime-match/index.js +1 -0
- package/dist/node_modules/mime-match/package.json +1 -0
- package/dist/node_modules/mime-match/test.js +45 -0
- package/dist/node_modules/mkdirp/LICENSE +21 -0
- package/dist/node_modules/mkdirp/bin/cmd.js +33 -0
- package/dist/node_modules/mkdirp/bin/usage.txt +12 -0
- package/dist/node_modules/mkdirp/index.js +1 -0
- package/dist/node_modules/mkdirp/package.json +1 -0
- package/dist/node_modules/mkdirp/readme.markdown +100 -0
- package/dist/node_modules/multer-aliyun-oss/bridge.js +1010 -0
- package/dist/node_modules/multer-aliyun-oss/events.js +977 -0
- package/dist/node_modules/multer-aliyun-oss/index.js +166 -0
- package/dist/node_modules/multer-aliyun-oss/package.json +1 -0
- package/dist/node_modules/multer-aliyun-oss/setup-node-sandbox.js +461 -0
- package/dist/node_modules/multer-aliyun-oss/setup-sandbox.js +545 -0
- package/dist/node_modules/multer-cos/LICENSE +24 -0
- package/dist/node_modules/multer-cos/demo/index.js +39 -0
- package/dist/node_modules/multer-cos/demo/myMulter.js +88 -0
- package/dist/node_modules/multer-cos/index.js +220 -0
- package/dist/node_modules/multer-cos/package.json +1 -0
- package/dist/node_modules/multer-s3/.gitattributes +1 -0
- package/dist/node_modules/multer-s3/.travis.yml +6 -0
- package/dist/node_modules/multer-s3/LICENSE +22 -0
- package/dist/node_modules/multer-s3/index.js +35 -0
- package/dist/node_modules/multer-s3/package.json +1 -0
- package/dist/node_modules/multer-s3/test/basic.js +293 -0
- package/dist/node_modules/multer-s3/test/files/a.txt +1 -0
- package/dist/node_modules/multer-s3/test/files/test.svg +3 -0
- package/dist/node_modules/multer-s3/test/files/test2.svg +9 -0
- package/dist/node_modules/multer-s3/test/util/mock-s3.js +17 -0
- package/dist/server/actions/attachments.js +173 -0
- package/dist/server/actions/index.js +16 -0
- package/dist/server/collections/attachments.js +67 -0
- package/dist/server/collections/storages.js +67 -0
- package/dist/server/constants.js +17 -0
- package/dist/server/index.js +23 -0
- package/dist/server/rules/index.js +14 -0
- package/dist/server/rules/mimetype.js +13 -0
- package/dist/server/server.js +75 -0
- package/{src/server/storages/ali-oss.ts → dist/server/storages/ali-oss.js} +17 -14
- package/dist/server/storages/index.js +30 -0
- package/dist/server/storages/local.js +148 -0
- package/{src/server/storages/s3.ts → dist/server/storages/s3.js} +26 -26
- package/dist/server/storages/tx-cos.js +44 -0
- package/dist/server/utils.js +26 -0
- package/package.json +21 -32
- package/server.d.ts +2 -3
- package/server.js +1 -1
- package/lib/client/FileManagerProvider.js +0 -94
- package/lib/client/FileStorage.js +0 -41
- package/lib/client/StorageOptions.js +0 -181
- package/lib/client/hooks/index.js +0 -16
- package/lib/client/hooks/useUploadFiles.js +0 -78
- package/lib/client/index.js +0 -27
- package/lib/client/initializers/UploadActionInitializer.js +0 -67
- package/lib/client/initializers/index.js +0 -16
- package/lib/client/interfaces/attachment.js +0 -139
- package/lib/client/locale/index.js +0 -19
- package/lib/client/schemas/storage.js +0 -408
- package/lib/client/templates/file.js +0 -164
- package/lib/client/templates/index.js +0 -16
- package/lib/index.js +0 -13
- package/lib/locale/en-US.js +0 -28
- package/lib/locale/fr-FR.js +0 -28
- package/lib/locale/ja-JP.js +0 -25
- package/lib/locale/ru-RU.js +0 -25
- package/lib/locale/tr-TR.js +0 -24
- package/lib/locale/zh-CN.js +0 -38
- package/lib/server/actions/attachments.js +0 -211
- package/lib/server/actions/index.js +0 -22
- package/lib/server/collections/attachments.js +0 -61
- package/lib/server/collections/storages.js +0 -61
- package/lib/server/constants.js +0 -20
- package/lib/server/index.js +0 -26
- package/lib/server/rules/index.js +0 -13
- package/lib/server/rules/mimetype.js +0 -17
- package/lib/server/server.js +0 -105
- package/lib/server/storages/ali-oss.js +0 -44
- package/lib/server/storages/index.js +0 -30
- package/lib/server/storages/local.js +0 -233
- package/lib/server/storages/s3.js +0 -86
- package/lib/server/storages/tx-cos.js +0 -58
- package/lib/server/utils.js +0 -36
- package/src/client/FileManagerProvider.tsx +0 -84
- package/src/client/FileStorage.tsx +0 -15
- package/src/client/StorageOptions.tsx +0 -146
- package/src/client/hooks/index.ts +0 -1
- package/src/client/hooks/useUploadFiles.ts +0 -55
- package/src/client/index.tsx +0 -10
- package/src/client/initializers/UploadActionInitializer.tsx +0 -42
- package/src/client/initializers/index.ts +0 -1
- package/src/client/interfaces/attachment.ts +0 -116
- package/src/client/locale/index.ts +0 -7
- package/src/client/schemas/storage.ts +0 -391
- package/src/client/templates/file.ts +0 -154
- package/src/client/templates/index.ts +0 -1
- package/src/index.ts +0 -1
- package/src/locale/en-US.ts +0 -21
- package/src/locale/fr-FR.ts +0 -21
- package/src/locale/ja-JP.ts +0 -18
- package/src/locale/ru-RU.ts +0 -18
- package/src/locale/tr-TR.ts +0 -17
- package/src/locale/zh-CN.ts +0 -31
- package/src/server/__tests__/action.test.ts +0 -332
- package/src/server/__tests__/attachment.test.ts +0 -50
- package/src/server/__tests__/files/image.jpg +0 -0
- package/src/server/__tests__/files/image.png +0 -0
- package/src/server/__tests__/files/text.txt +0 -1
- package/src/server/__tests__/index.ts +0 -34
- package/src/server/__tests__/storages/ali-oss.test.ts +0 -127
- package/src/server/__tests__/storages/s3.test.ts +0 -126
- package/src/server/__tests__/storages/tx-cos.test.ts +0 -69
- package/src/server/__tests__/tables/users.ts +0 -26
- package/src/server/actions/attachments.ts +0 -175
- package/src/server/actions/index.ts +0 -9
- package/src/server/collections/attachments.ts +0 -65
- package/src/server/collections/storages.ts +0 -65
- package/src/server/constants.ts +0 -8
- package/src/server/index.ts +0 -2
- package/src/server/rules/index.ts +0 -3
- package/src/server/rules/mimetype.ts +0 -5
- package/src/server/server.ts +0 -79
- package/src/server/storages/index.ts +0 -46
- package/src/server/storages/local.ts +0 -167
- package/src/server/storages/tx-cos.ts +0 -42
- package/src/server/utils.ts +0 -17
- /package/{lib → dist}/client/FileManagerProvider.d.ts +0 -0
- /package/{lib → dist}/client/FileStorage.d.ts +0 -0
- /package/{lib → dist}/client/StorageOptions.d.ts +0 -0
- /package/{lib → dist}/client/hooks/index.d.ts +0 -0
- /package/{lib → dist}/client/hooks/useUploadFiles.d.ts +0 -0
- /package/{lib → dist}/client/index.d.ts +0 -0
- /package/{lib → dist}/client/initializers/UploadActionInitializer.d.ts +0 -0
- /package/{lib → dist}/client/initializers/index.d.ts +0 -0
- /package/{lib → dist}/client/interfaces/attachment.d.ts +0 -0
- /package/{lib → dist}/client/locale/index.d.ts +0 -0
- /package/{lib → dist}/client/schemas/storage.d.ts +0 -0
- /package/{lib → dist}/client/templates/file.d.ts +0 -0
- /package/{lib → dist}/client/templates/index.d.ts +0 -0
- /package/{lib → dist}/locale/en-US.d.ts +0 -0
- /package/{lib → dist}/locale/fr-FR.d.ts +0 -0
- /package/{lib → dist}/locale/ja-JP.d.ts +0 -0
- /package/{lib → dist}/locale/ru-RU.d.ts +0 -0
- /package/{lib → dist}/locale/tr-TR.d.ts +0 -0
- /package/{lib → dist}/locale/zh-CN.d.ts +0 -0
- /package/{lib → dist}/server/actions/attachments.d.ts +0 -0
- /package/{lib → dist}/server/actions/index.d.ts +0 -0
- /package/{lib → dist}/server/collections/attachments.d.ts +0 -0
- /package/{lib → dist}/server/collections/storages.d.ts +0 -0
- /package/{lib → dist}/server/constants.d.ts +0 -0
- /package/{lib → dist}/server/index.d.ts +0 -0
- /package/{lib → dist}/server/rules/index.d.ts +0 -0
- /package/{lib → dist}/server/rules/mimetype.d.ts +0 -0
- /package/{lib → dist}/server/server.d.ts +0 -0
- /package/{lib → dist}/server/storages/ali-oss.d.ts +0 -0
- /package/{lib → dist}/server/storages/index.d.ts +0 -0
- /package/{lib → dist}/server/storages/local.d.ts +0 -0
- /package/{lib → dist}/server/storages/s3.d.ts +0 -0
- /package/{lib → dist}/server/storages/tx-cos.d.ts +0 -0
- /package/{lib → dist}/server/utils.d.ts +0 -0
|
@@ -0,0 +1,1010 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* __ ___ ____ _ _ ___ _ _ ____
|
|
5
|
+
* \ \ / / \ | _ \| \ | |_ _| \ | |/ ___|
|
|
6
|
+
* \ \ /\ / / _ \ | |_) | \| || || \| | | _
|
|
7
|
+
* \ V V / ___ \| _ <| |\ || || |\ | |_| |
|
|
8
|
+
* \_/\_/_/ \_\_| \_\_| \_|___|_| \_|\____|
|
|
9
|
+
*
|
|
10
|
+
* This file is critical for vm2. It implements the bridge between the host and the sandbox.
|
|
11
|
+
* If you do not know exactly what you are doing, you should NOT edit this file.
|
|
12
|
+
*
|
|
13
|
+
* The file is loaded in the host and sandbox to handle objects in both directions.
|
|
14
|
+
* This is done to ensure that RangeErrors are from the correct context.
|
|
15
|
+
* The boundary between the sandbox and host might throw RangeErrors from both contexts.
|
|
16
|
+
* Therefore, thisFromOther and friends can handle objects from both domains.
|
|
17
|
+
*
|
|
18
|
+
* Method parameters have comments to tell from which context they came.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
const globalsList = [
|
|
23
|
+
'Number',
|
|
24
|
+
'String',
|
|
25
|
+
'Boolean',
|
|
26
|
+
'Date',
|
|
27
|
+
'RegExp',
|
|
28
|
+
'Map',
|
|
29
|
+
'WeakMap',
|
|
30
|
+
'Set',
|
|
31
|
+
'WeakSet',
|
|
32
|
+
'Promise',
|
|
33
|
+
'Function'
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const errorsList = [
|
|
37
|
+
'RangeError',
|
|
38
|
+
'ReferenceError',
|
|
39
|
+
'SyntaxError',
|
|
40
|
+
'TypeError',
|
|
41
|
+
'EvalError',
|
|
42
|
+
'URIError',
|
|
43
|
+
'Error'
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
const OPNA = 'Operation not allowed on contextified object.';
|
|
47
|
+
|
|
48
|
+
const thisGlobalPrototypes = {
|
|
49
|
+
__proto__: null,
|
|
50
|
+
Object: Object.prototype,
|
|
51
|
+
Array: Array.prototype
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
for (let i = 0; i < globalsList.length; i++) {
|
|
55
|
+
const key = globalsList[i];
|
|
56
|
+
const g = global[key];
|
|
57
|
+
if (g) thisGlobalPrototypes[key] = g.prototype;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
for (let i = 0; i < errorsList.length; i++) {
|
|
61
|
+
const key = errorsList[i];
|
|
62
|
+
const g = global[key];
|
|
63
|
+
if (g) thisGlobalPrototypes[key] = g.prototype;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const {
|
|
67
|
+
getPrototypeOf: thisReflectGetPrototypeOf,
|
|
68
|
+
setPrototypeOf: thisReflectSetPrototypeOf,
|
|
69
|
+
defineProperty: thisReflectDefineProperty,
|
|
70
|
+
deleteProperty: thisReflectDeleteProperty,
|
|
71
|
+
getOwnPropertyDescriptor: thisReflectGetOwnPropertyDescriptor,
|
|
72
|
+
isExtensible: thisReflectIsExtensible,
|
|
73
|
+
preventExtensions: thisReflectPreventExtensions,
|
|
74
|
+
apply: thisReflectApply,
|
|
75
|
+
construct: thisReflectConstruct,
|
|
76
|
+
set: thisReflectSet,
|
|
77
|
+
get: thisReflectGet,
|
|
78
|
+
has: thisReflectHas,
|
|
79
|
+
ownKeys: thisReflectOwnKeys,
|
|
80
|
+
enumerate: thisReflectEnumerate,
|
|
81
|
+
} = Reflect;
|
|
82
|
+
|
|
83
|
+
const thisObject = Object;
|
|
84
|
+
const {
|
|
85
|
+
freeze: thisObjectFreeze,
|
|
86
|
+
prototype: thisObjectPrototype
|
|
87
|
+
} = thisObject;
|
|
88
|
+
const thisObjectHasOwnProperty = thisObjectPrototype.hasOwnProperty;
|
|
89
|
+
const ThisProxy = Proxy;
|
|
90
|
+
const ThisWeakMap = WeakMap;
|
|
91
|
+
const {
|
|
92
|
+
get: thisWeakMapGet,
|
|
93
|
+
set: thisWeakMapSet
|
|
94
|
+
} = ThisWeakMap.prototype;
|
|
95
|
+
const ThisMap = Map;
|
|
96
|
+
const thisMapGet = ThisMap.prototype.get;
|
|
97
|
+
const thisMapSet = ThisMap.prototype.set;
|
|
98
|
+
const thisFunction = Function;
|
|
99
|
+
const thisFunctionBind = thisFunction.prototype.bind;
|
|
100
|
+
const thisArrayIsArray = Array.isArray;
|
|
101
|
+
const thisErrorCaptureStackTrace = Error.captureStackTrace;
|
|
102
|
+
|
|
103
|
+
const thisSymbolToString = Symbol.prototype.toString;
|
|
104
|
+
const thisSymbolToStringTag = Symbol.toStringTag;
|
|
105
|
+
const thisSymbolIterator = Symbol.iterator;
|
|
106
|
+
const thisSymbolNodeJSUtilInspectCustom = Symbol.for('nodejs.util.inspect.custom');
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* VMError.
|
|
110
|
+
*
|
|
111
|
+
* @public
|
|
112
|
+
* @extends {Error}
|
|
113
|
+
*/
|
|
114
|
+
class VMError extends Error {
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Create VMError instance.
|
|
118
|
+
*
|
|
119
|
+
* @public
|
|
120
|
+
* @param {string} message - Error message.
|
|
121
|
+
* @param {string} code - Error code.
|
|
122
|
+
*/
|
|
123
|
+
constructor(message, code) {
|
|
124
|
+
super(message);
|
|
125
|
+
|
|
126
|
+
this.name = 'VMError';
|
|
127
|
+
this.code = code;
|
|
128
|
+
|
|
129
|
+
thisErrorCaptureStackTrace(this, this.constructor);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
thisGlobalPrototypes['VMError'] = VMError.prototype;
|
|
134
|
+
|
|
135
|
+
function thisUnexpected() {
|
|
136
|
+
return new VMError('Unexpected');
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
if (!thisReflectSetPrototypeOf(exports, null)) throw thisUnexpected();
|
|
140
|
+
|
|
141
|
+
function thisSafeGetOwnPropertyDescriptor(obj, key) {
|
|
142
|
+
const desc = thisReflectGetOwnPropertyDescriptor(obj, key);
|
|
143
|
+
if (!desc) return desc;
|
|
144
|
+
if (!thisReflectSetPrototypeOf(desc, null)) throw thisUnexpected();
|
|
145
|
+
return desc;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function thisThrowCallerCalleeArgumentsAccess(key) {
|
|
149
|
+
'use strict';
|
|
150
|
+
thisThrowCallerCalleeArgumentsAccess[key];
|
|
151
|
+
return thisUnexpected();
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function thisIdMapping(factory, other) {
|
|
155
|
+
return other;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const thisThrowOnKeyAccessHandler = thisObjectFreeze({
|
|
159
|
+
__proto__: null,
|
|
160
|
+
get(target, key, receiver) {
|
|
161
|
+
if (typeof key === 'symbol') {
|
|
162
|
+
key = thisReflectApply(thisSymbolToString, key, []);
|
|
163
|
+
}
|
|
164
|
+
throw new VMError(`Unexpected access to key '${key}'`);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
const emptyForzenObject = thisObjectFreeze({
|
|
169
|
+
__proto__: null
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
const thisThrowOnKeyAccess = new ThisProxy(emptyForzenObject, thisThrowOnKeyAccessHandler);
|
|
173
|
+
|
|
174
|
+
function SafeBase() {}
|
|
175
|
+
|
|
176
|
+
if (!thisReflectDefineProperty(SafeBase, 'prototype', {
|
|
177
|
+
__proto__: null,
|
|
178
|
+
value: thisThrowOnKeyAccess
|
|
179
|
+
})) throw thisUnexpected();
|
|
180
|
+
|
|
181
|
+
function SHARED_FUNCTION() {}
|
|
182
|
+
|
|
183
|
+
const TEST_PROXY_HANDLER = thisObjectFreeze({
|
|
184
|
+
__proto__: thisThrowOnKeyAccess,
|
|
185
|
+
construct() {
|
|
186
|
+
return this;
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
function thisIsConstructor(obj) {
|
|
191
|
+
// Note: obj@any(unsafe)
|
|
192
|
+
const Func = new ThisProxy(obj, TEST_PROXY_HANDLER);
|
|
193
|
+
try {
|
|
194
|
+
// eslint-disable-next-line no-new
|
|
195
|
+
new Func();
|
|
196
|
+
return true;
|
|
197
|
+
} catch (e) {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
function thisCreateTargetObject(obj, proto) {
|
|
203
|
+
// Note: obj@any(unsafe) proto@any(unsafe) returns@this(unsafe) throws@this(unsafe)
|
|
204
|
+
let base;
|
|
205
|
+
if (typeof obj === 'function') {
|
|
206
|
+
if (thisIsConstructor(obj)) {
|
|
207
|
+
// Bind the function since bound functions do not have a prototype property.
|
|
208
|
+
base = thisReflectApply(thisFunctionBind, SHARED_FUNCTION, [null]);
|
|
209
|
+
} else {
|
|
210
|
+
base = () => {};
|
|
211
|
+
}
|
|
212
|
+
} else if (thisArrayIsArray(obj)) {
|
|
213
|
+
base = [];
|
|
214
|
+
} else {
|
|
215
|
+
return {__proto__: proto};
|
|
216
|
+
}
|
|
217
|
+
if (!thisReflectSetPrototypeOf(base, proto)) throw thisUnexpected();
|
|
218
|
+
return base;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function createBridge(otherInit, registerProxy) {
|
|
222
|
+
|
|
223
|
+
const mappingOtherToThis = new ThisWeakMap();
|
|
224
|
+
const protoMappings = new ThisMap();
|
|
225
|
+
const protoName = new ThisMap();
|
|
226
|
+
|
|
227
|
+
function thisAddProtoMapping(proto, other, name) {
|
|
228
|
+
// Note: proto@this(unsafe) other@other(unsafe) name@this(unsafe) throws@this(unsafe)
|
|
229
|
+
thisReflectApply(thisMapSet, protoMappings, [proto, thisIdMapping]);
|
|
230
|
+
thisReflectApply(thisMapSet, protoMappings, [other,
|
|
231
|
+
(factory, object) => thisProxyOther(factory, object, proto)]);
|
|
232
|
+
if (name) thisReflectApply(thisMapSet, protoName, [proto, name]);
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
function thisAddProtoMappingFactory(protoFactory, other, name) {
|
|
236
|
+
// Note: protoFactory@this(unsafe) other@other(unsafe) name@this(unsafe) throws@this(unsafe)
|
|
237
|
+
let proto;
|
|
238
|
+
thisReflectApply(thisMapSet, protoMappings, [other,
|
|
239
|
+
(factory, object) => {
|
|
240
|
+
if (!proto) {
|
|
241
|
+
proto = protoFactory();
|
|
242
|
+
thisReflectApply(thisMapSet, protoMappings, [proto, thisIdMapping]);
|
|
243
|
+
if (name) thisReflectApply(thisMapSet, protoName, [proto, name]);
|
|
244
|
+
}
|
|
245
|
+
return thisProxyOther(factory, object, proto);
|
|
246
|
+
}]);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const result = {
|
|
250
|
+
__proto__: null,
|
|
251
|
+
globalPrototypes: thisGlobalPrototypes,
|
|
252
|
+
safeGetOwnPropertyDescriptor: thisSafeGetOwnPropertyDescriptor,
|
|
253
|
+
fromArguments: thisFromOtherArguments,
|
|
254
|
+
from: thisFromOther,
|
|
255
|
+
fromWithFactory: thisFromOtherWithFactory,
|
|
256
|
+
ensureThis: thisEnsureThis,
|
|
257
|
+
mapping: mappingOtherToThis,
|
|
258
|
+
connect: thisConnect,
|
|
259
|
+
reflectSet: thisReflectSet,
|
|
260
|
+
reflectGet: thisReflectGet,
|
|
261
|
+
reflectDefineProperty: thisReflectDefineProperty,
|
|
262
|
+
reflectDeleteProperty: thisReflectDeleteProperty,
|
|
263
|
+
reflectApply: thisReflectApply,
|
|
264
|
+
reflectConstruct: thisReflectConstruct,
|
|
265
|
+
reflectHas: thisReflectHas,
|
|
266
|
+
reflectOwnKeys: thisReflectOwnKeys,
|
|
267
|
+
reflectEnumerate: thisReflectEnumerate,
|
|
268
|
+
reflectGetPrototypeOf: thisReflectGetPrototypeOf,
|
|
269
|
+
reflectIsExtensible: thisReflectIsExtensible,
|
|
270
|
+
reflectPreventExtensions: thisReflectPreventExtensions,
|
|
271
|
+
objectHasOwnProperty: thisObjectHasOwnProperty,
|
|
272
|
+
weakMapSet: thisWeakMapSet,
|
|
273
|
+
addProtoMapping: thisAddProtoMapping,
|
|
274
|
+
addProtoMappingFactory: thisAddProtoMappingFactory,
|
|
275
|
+
defaultFactory,
|
|
276
|
+
protectedFactory,
|
|
277
|
+
readonlyFactory,
|
|
278
|
+
VMError
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
const isHost = typeof otherInit !== 'object';
|
|
282
|
+
|
|
283
|
+
if (isHost) {
|
|
284
|
+
otherInit = otherInit(result, registerProxy);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
result.other = otherInit;
|
|
288
|
+
|
|
289
|
+
const {
|
|
290
|
+
globalPrototypes: otherGlobalPrototypes,
|
|
291
|
+
safeGetOwnPropertyDescriptor: otherSafeGetOwnPropertyDescriptor,
|
|
292
|
+
fromArguments: otherFromThisArguments,
|
|
293
|
+
from: otherFromThis,
|
|
294
|
+
mapping: mappingThisToOther,
|
|
295
|
+
reflectSet: otherReflectSet,
|
|
296
|
+
reflectGet: otherReflectGet,
|
|
297
|
+
reflectDefineProperty: otherReflectDefineProperty,
|
|
298
|
+
reflectDeleteProperty: otherReflectDeleteProperty,
|
|
299
|
+
reflectApply: otherReflectApply,
|
|
300
|
+
reflectConstruct: otherReflectConstruct,
|
|
301
|
+
reflectHas: otherReflectHas,
|
|
302
|
+
reflectOwnKeys: otherReflectOwnKeys,
|
|
303
|
+
reflectEnumerate: otherReflectEnumerate,
|
|
304
|
+
reflectGetPrototypeOf: otherReflectGetPrototypeOf,
|
|
305
|
+
reflectIsExtensible: otherReflectIsExtensible,
|
|
306
|
+
reflectPreventExtensions: otherReflectPreventExtensions,
|
|
307
|
+
objectHasOwnProperty: otherObjectHasOwnProperty,
|
|
308
|
+
weakMapSet: otherWeakMapSet
|
|
309
|
+
} = otherInit;
|
|
310
|
+
|
|
311
|
+
function thisOtherHasOwnProperty(object, key) {
|
|
312
|
+
// Note: object@other(safe) key@prim throws@this(unsafe)
|
|
313
|
+
try {
|
|
314
|
+
return otherReflectApply(otherObjectHasOwnProperty, object, [key]) === true;
|
|
315
|
+
} catch (e) { // @other(unsafe)
|
|
316
|
+
throw thisFromOtherForThrow(e);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
function thisDefaultGet(handler, object, key, desc) {
|
|
321
|
+
// Note: object@other(unsafe) key@prim desc@other(safe)
|
|
322
|
+
let ret; // @other(unsafe)
|
|
323
|
+
if (desc.get || desc.set) {
|
|
324
|
+
const getter = desc.get;
|
|
325
|
+
if (!getter) return undefined;
|
|
326
|
+
try {
|
|
327
|
+
ret = otherReflectApply(getter, object, [key]);
|
|
328
|
+
} catch (e) {
|
|
329
|
+
throw thisFromOtherForThrow(e);
|
|
330
|
+
}
|
|
331
|
+
} else {
|
|
332
|
+
ret = desc.value;
|
|
333
|
+
}
|
|
334
|
+
return handler.fromOtherWithContext(ret);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
function otherFromThisIfAvailable(to, from, key) {
|
|
338
|
+
// Note: to@other(safe) from@this(safe) key@prim throws@this(unsafe)
|
|
339
|
+
if (!thisReflectApply(thisObjectHasOwnProperty, from, [key])) return false;
|
|
340
|
+
try {
|
|
341
|
+
to[key] = otherFromThis(from[key]);
|
|
342
|
+
} catch (e) { // @other(unsafe)
|
|
343
|
+
throw thisFromOtherForThrow(e);
|
|
344
|
+
}
|
|
345
|
+
return true;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
class BaseHandler extends SafeBase {
|
|
349
|
+
|
|
350
|
+
constructor(object) {
|
|
351
|
+
// Note: object@other(unsafe) throws@this(unsafe)
|
|
352
|
+
super();
|
|
353
|
+
this.objectWrapper = () => object;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
getObject() {
|
|
357
|
+
return this.objectWrapper();
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
getFactory() {
|
|
361
|
+
return defaultFactory;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
fromOtherWithContext(other) {
|
|
365
|
+
// Note: other@other(unsafe) throws@this(unsafe)
|
|
366
|
+
return thisFromOtherWithFactory(this.getFactory(), other);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
doPreventExtensions(target, object, factory) {
|
|
370
|
+
// Note: target@this(unsafe) object@other(unsafe) throws@this(unsafe)
|
|
371
|
+
let keys; // @other(safe-array-of-prim)
|
|
372
|
+
try {
|
|
373
|
+
keys = otherReflectOwnKeys(object);
|
|
374
|
+
} catch (e) { // @other(unsafe)
|
|
375
|
+
throw thisFromOtherForThrow(e);
|
|
376
|
+
}
|
|
377
|
+
for (let i = 0; i < keys.length; i++) {
|
|
378
|
+
const key = keys[i]; // @prim
|
|
379
|
+
let desc;
|
|
380
|
+
try {
|
|
381
|
+
desc = otherSafeGetOwnPropertyDescriptor(object, key);
|
|
382
|
+
} catch (e) { // @other(unsafe)
|
|
383
|
+
throw thisFromOtherForThrow(e);
|
|
384
|
+
}
|
|
385
|
+
if (!desc) continue;
|
|
386
|
+
if (!desc.configurable) {
|
|
387
|
+
const current = thisSafeGetOwnPropertyDescriptor(target, key);
|
|
388
|
+
if (current && !current.configurable) continue;
|
|
389
|
+
if (desc.get || desc.set) {
|
|
390
|
+
desc.get = this.fromOtherWithContext(desc.get);
|
|
391
|
+
desc.set = this.fromOtherWithContext(desc.set);
|
|
392
|
+
} else if (typeof object === 'function' && (key === 'caller' || key === 'callee' || key === 'arguments')) {
|
|
393
|
+
desc.value = null;
|
|
394
|
+
} else {
|
|
395
|
+
desc.value = this.fromOtherWithContext(desc.value);
|
|
396
|
+
}
|
|
397
|
+
} else {
|
|
398
|
+
if (desc.get || desc.set) {
|
|
399
|
+
desc = {
|
|
400
|
+
__proto__: null,
|
|
401
|
+
configurable: true,
|
|
402
|
+
enumerable: desc.enumerable,
|
|
403
|
+
writable: true,
|
|
404
|
+
value: null
|
|
405
|
+
};
|
|
406
|
+
} else {
|
|
407
|
+
desc.value = null;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
if (!thisReflectDefineProperty(target, key, desc)) throw thisUnexpected();
|
|
411
|
+
}
|
|
412
|
+
if (!thisReflectPreventExtensions(target)) throw thisUnexpected();
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
get(target, key, receiver) {
|
|
416
|
+
// Note: target@this(unsafe) key@prim receiver@this(unsafe) throws@this(unsafe)
|
|
417
|
+
const object = this.getObject(); // @other(unsafe)
|
|
418
|
+
switch (key) {
|
|
419
|
+
case 'constructor': {
|
|
420
|
+
const desc = otherSafeGetOwnPropertyDescriptor(object, key);
|
|
421
|
+
if (desc) return thisDefaultGet(this, object, key, desc);
|
|
422
|
+
const proto = thisReflectGetPrototypeOf(target);
|
|
423
|
+
return proto === null ? undefined : proto.constructor;
|
|
424
|
+
}
|
|
425
|
+
case '__proto__': {
|
|
426
|
+
const desc = otherSafeGetOwnPropertyDescriptor(object, key);
|
|
427
|
+
if (desc) return thisDefaultGet(this, object, key, desc);
|
|
428
|
+
return thisReflectGetPrototypeOf(target);
|
|
429
|
+
}
|
|
430
|
+
case thisSymbolToStringTag:
|
|
431
|
+
if (!thisOtherHasOwnProperty(object, thisSymbolToStringTag)) {
|
|
432
|
+
const proto = thisReflectGetPrototypeOf(target);
|
|
433
|
+
const name = thisReflectApply(thisMapGet, protoName, [proto]);
|
|
434
|
+
if (name) return name;
|
|
435
|
+
}
|
|
436
|
+
break;
|
|
437
|
+
case 'arguments':
|
|
438
|
+
case 'caller':
|
|
439
|
+
case 'callee':
|
|
440
|
+
if (typeof object === 'function' && thisOtherHasOwnProperty(object, key)) {
|
|
441
|
+
throw thisThrowCallerCalleeArgumentsAccess(key);
|
|
442
|
+
}
|
|
443
|
+
break;
|
|
444
|
+
}
|
|
445
|
+
let ret; // @other(unsafe)
|
|
446
|
+
try {
|
|
447
|
+
ret = otherReflectGet(object, key);
|
|
448
|
+
} catch (e) { // @other(unsafe)
|
|
449
|
+
throw thisFromOtherForThrow(e);
|
|
450
|
+
}
|
|
451
|
+
return this.fromOtherWithContext(ret);
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
set(target, key, value, receiver) {
|
|
455
|
+
// Note: target@this(unsafe) key@prim value@this(unsafe) receiver@this(unsafe) throws@this(unsafe)
|
|
456
|
+
const object = this.getObject(); // @other(unsafe)
|
|
457
|
+
if (key === '__proto__' && !thisOtherHasOwnProperty(object, key)) {
|
|
458
|
+
return this.setPrototypeOf(target, value);
|
|
459
|
+
}
|
|
460
|
+
try {
|
|
461
|
+
value = otherFromThis(value);
|
|
462
|
+
return otherReflectSet(object, key, value) === true;
|
|
463
|
+
} catch (e) { // @other(unsafe)
|
|
464
|
+
throw thisFromOtherForThrow(e);
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
getPrototypeOf(target) {
|
|
469
|
+
// Note: target@this(unsafe)
|
|
470
|
+
return thisReflectGetPrototypeOf(target);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
setPrototypeOf(target, value) {
|
|
474
|
+
// Note: target@this(unsafe) throws@this(unsafe)
|
|
475
|
+
throw new VMError(OPNA);
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
apply(target, context, args) {
|
|
479
|
+
// Note: target@this(unsafe) context@this(unsafe) args@this(safe-array) throws@this(unsafe)
|
|
480
|
+
const object = this.getObject(); // @other(unsafe)
|
|
481
|
+
let ret; // @other(unsafe)
|
|
482
|
+
try {
|
|
483
|
+
context = otherFromThis(context);
|
|
484
|
+
args = otherFromThisArguments(args);
|
|
485
|
+
ret = otherReflectApply(object, context, args);
|
|
486
|
+
} catch (e) { // @other(unsafe)
|
|
487
|
+
throw thisFromOtherForThrow(e);
|
|
488
|
+
}
|
|
489
|
+
return thisFromOther(ret);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
construct(target, args, newTarget) {
|
|
493
|
+
// Note: target@this(unsafe) args@this(safe-array) newTarget@this(unsafe) throws@this(unsafe)
|
|
494
|
+
const object = this.getObject(); // @other(unsafe)
|
|
495
|
+
let ret; // @other(unsafe)
|
|
496
|
+
try {
|
|
497
|
+
args = otherFromThisArguments(args);
|
|
498
|
+
ret = otherReflectConstruct(object, args);
|
|
499
|
+
} catch (e) { // @other(unsafe)
|
|
500
|
+
throw thisFromOtherForThrow(e);
|
|
501
|
+
}
|
|
502
|
+
return thisFromOtherWithFactory(this.getFactory(), ret, thisFromOther(object));
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
getOwnPropertyDescriptorDesc(target, prop, desc) {
|
|
506
|
+
// Note: target@this(unsafe) prop@prim desc@other{safe} throws@this(unsafe)
|
|
507
|
+
const object = this.getObject(); // @other(unsafe)
|
|
508
|
+
if (desc && typeof object === 'function' && (prop === 'arguments' || prop === 'caller' || prop === 'callee')) desc.value = null;
|
|
509
|
+
return desc;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
getOwnPropertyDescriptor(target, prop) {
|
|
513
|
+
// Note: target@this(unsafe) prop@prim throws@this(unsafe)
|
|
514
|
+
const object = this.getObject(); // @other(unsafe)
|
|
515
|
+
let desc; // @other(safe)
|
|
516
|
+
try {
|
|
517
|
+
desc = otherSafeGetOwnPropertyDescriptor(object, prop);
|
|
518
|
+
} catch (e) { // @other(unsafe)
|
|
519
|
+
throw thisFromOtherForThrow(e);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
desc = this.getOwnPropertyDescriptorDesc(target, prop, desc);
|
|
523
|
+
|
|
524
|
+
if (!desc) return undefined;
|
|
525
|
+
|
|
526
|
+
let thisDesc;
|
|
527
|
+
if (desc.get || desc.set) {
|
|
528
|
+
thisDesc = {
|
|
529
|
+
__proto__: null,
|
|
530
|
+
get: this.fromOtherWithContext(desc.get),
|
|
531
|
+
set: this.fromOtherWithContext(desc.set),
|
|
532
|
+
enumerable: desc.enumerable === true,
|
|
533
|
+
configurable: desc.configurable === true
|
|
534
|
+
};
|
|
535
|
+
} else {
|
|
536
|
+
thisDesc = {
|
|
537
|
+
__proto__: null,
|
|
538
|
+
value: this.fromOtherWithContext(desc.value),
|
|
539
|
+
writable: desc.writable === true,
|
|
540
|
+
enumerable: desc.enumerable === true,
|
|
541
|
+
configurable: desc.configurable === true
|
|
542
|
+
};
|
|
543
|
+
}
|
|
544
|
+
if (!thisDesc.configurable) {
|
|
545
|
+
const oldDesc = thisSafeGetOwnPropertyDescriptor(target, prop);
|
|
546
|
+
if (!oldDesc || oldDesc.configurable || oldDesc.writable !== thisDesc.writable) {
|
|
547
|
+
if (!thisReflectDefineProperty(target, prop, thisDesc)) throw thisUnexpected();
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
return thisDesc;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
definePropertyDesc(target, prop, desc) {
|
|
554
|
+
// Note: target@this(unsafe) prop@prim desc@this(safe) throws@this(unsafe)
|
|
555
|
+
return desc;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
defineProperty(target, prop, desc) {
|
|
559
|
+
// Note: target@this(unsafe) prop@prim desc@this(unsafe) throws@this(unsafe)
|
|
560
|
+
const object = this.getObject(); // @other(unsafe)
|
|
561
|
+
if (!thisReflectSetPrototypeOf(desc, null)) throw thisUnexpected();
|
|
562
|
+
|
|
563
|
+
desc = this.definePropertyDesc(target, prop, desc);
|
|
564
|
+
|
|
565
|
+
if (!desc) return false;
|
|
566
|
+
|
|
567
|
+
let otherDesc = {__proto__: null};
|
|
568
|
+
let hasFunc = true;
|
|
569
|
+
let hasValue = true;
|
|
570
|
+
let hasBasic = true;
|
|
571
|
+
hasFunc &= otherFromThisIfAvailable(otherDesc, desc, 'get');
|
|
572
|
+
hasFunc &= otherFromThisIfAvailable(otherDesc, desc, 'set');
|
|
573
|
+
hasValue &= otherFromThisIfAvailable(otherDesc, desc, 'value');
|
|
574
|
+
hasValue &= otherFromThisIfAvailable(otherDesc, desc, 'writable');
|
|
575
|
+
hasBasic &= otherFromThisIfAvailable(otherDesc, desc, 'enumerable');
|
|
576
|
+
hasBasic &= otherFromThisIfAvailable(otherDesc, desc, 'configurable');
|
|
577
|
+
|
|
578
|
+
try {
|
|
579
|
+
if (!otherReflectDefineProperty(object, prop, otherDesc)) return false;
|
|
580
|
+
if (otherDesc.configurable !== true && (!hasBasic || !(hasFunc || hasValue))) {
|
|
581
|
+
otherDesc = otherSafeGetOwnPropertyDescriptor(object, prop);
|
|
582
|
+
}
|
|
583
|
+
} catch (e) { // @other(unsafe)
|
|
584
|
+
throw thisFromOtherForThrow(e);
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
if (!otherDesc.configurable) {
|
|
588
|
+
let thisDesc;
|
|
589
|
+
if (otherDesc.get || otherDesc.set) {
|
|
590
|
+
thisDesc = {
|
|
591
|
+
__proto__: null,
|
|
592
|
+
get: this.fromOtherWithContext(otherDesc.get),
|
|
593
|
+
set: this.fromOtherWithContext(otherDesc.set),
|
|
594
|
+
enumerable: otherDesc.enumerable,
|
|
595
|
+
configurable: otherDesc.configurable
|
|
596
|
+
};
|
|
597
|
+
} else {
|
|
598
|
+
thisDesc = {
|
|
599
|
+
__proto__: null,
|
|
600
|
+
value: this.fromOtherWithContext(otherDesc.value),
|
|
601
|
+
writable: otherDesc.writable,
|
|
602
|
+
enumerable: otherDesc.enumerable,
|
|
603
|
+
configurable: otherDesc.configurable
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
if (!thisReflectDefineProperty(target, prop, thisDesc)) throw thisUnexpected();
|
|
607
|
+
}
|
|
608
|
+
return true;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
deleteProperty(target, prop) {
|
|
612
|
+
// Note: target@this(unsafe) prop@prim throws@this(unsafe)
|
|
613
|
+
const object = this.getObject(); // @other(unsafe)
|
|
614
|
+
try {
|
|
615
|
+
return otherReflectDeleteProperty(object, prop) === true;
|
|
616
|
+
} catch (e) { // @other(unsafe)
|
|
617
|
+
throw thisFromOtherForThrow(e);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
has(target, key) {
|
|
622
|
+
// Note: target@this(unsafe) key@prim throws@this(unsafe)
|
|
623
|
+
const object = this.getObject(); // @other(unsafe)
|
|
624
|
+
try {
|
|
625
|
+
return otherReflectHas(object, key) === true;
|
|
626
|
+
} catch (e) { // @other(unsafe)
|
|
627
|
+
throw thisFromOtherForThrow(e);
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
isExtensible(target) {
|
|
632
|
+
// Note: target@this(unsafe) throws@this(unsafe)
|
|
633
|
+
const object = this.getObject(); // @other(unsafe)
|
|
634
|
+
try {
|
|
635
|
+
if (otherReflectIsExtensible(object)) return true;
|
|
636
|
+
} catch (e) { // @other(unsafe)
|
|
637
|
+
throw thisFromOtherForThrow(e);
|
|
638
|
+
}
|
|
639
|
+
if (thisReflectIsExtensible(target)) {
|
|
640
|
+
this.doPreventExtensions(target, object, this);
|
|
641
|
+
}
|
|
642
|
+
return false;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
ownKeys(target) {
|
|
646
|
+
// Note: target@this(unsafe) throws@this(unsafe)
|
|
647
|
+
const object = this.getObject(); // @other(unsafe)
|
|
648
|
+
let res; // @other(unsafe)
|
|
649
|
+
try {
|
|
650
|
+
res = otherReflectOwnKeys(object);
|
|
651
|
+
} catch (e) { // @other(unsafe)
|
|
652
|
+
throw thisFromOtherForThrow(e);
|
|
653
|
+
}
|
|
654
|
+
return thisFromOther(res);
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
preventExtensions(target) {
|
|
658
|
+
// Note: target@this(unsafe) throws@this(unsafe)
|
|
659
|
+
const object = this.getObject(); // @other(unsafe)
|
|
660
|
+
try {
|
|
661
|
+
if (!otherReflectPreventExtensions(object)) return false;
|
|
662
|
+
} catch (e) { // @other(unsafe)
|
|
663
|
+
throw thisFromOtherForThrow(e);
|
|
664
|
+
}
|
|
665
|
+
if (thisReflectIsExtensible(target)) {
|
|
666
|
+
this.doPreventExtensions(target, object, this);
|
|
667
|
+
}
|
|
668
|
+
return true;
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
enumerate(target) {
|
|
672
|
+
// Note: target@this(unsafe) throws@this(unsafe)
|
|
673
|
+
const object = this.getObject(); // @other(unsafe)
|
|
674
|
+
let res; // @other(unsafe)
|
|
675
|
+
try {
|
|
676
|
+
res = otherReflectEnumerate(object);
|
|
677
|
+
} catch (e) { // @other(unsafe)
|
|
678
|
+
throw thisFromOtherForThrow(e);
|
|
679
|
+
}
|
|
680
|
+
return this.fromOtherWithContext(res);
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
BaseHandler.prototype[thisSymbolNodeJSUtilInspectCustom] = undefined;
|
|
686
|
+
BaseHandler.prototype[thisSymbolToStringTag] = 'VM2 Wrapper';
|
|
687
|
+
BaseHandler.prototype[thisSymbolIterator] = undefined;
|
|
688
|
+
|
|
689
|
+
function defaultFactory(object) {
|
|
690
|
+
// Note: other@other(unsafe) returns@this(unsafe) throws@this(unsafe)
|
|
691
|
+
return new BaseHandler(object);
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
class ProtectedHandler extends BaseHandler {
|
|
695
|
+
|
|
696
|
+
getFactory() {
|
|
697
|
+
return protectedFactory;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
set(target, key, value, receiver) {
|
|
701
|
+
// Note: target@this(unsafe) key@prim value@this(unsafe) receiver@this(unsafe) throws@this(unsafe)
|
|
702
|
+
if (typeof value === 'function') {
|
|
703
|
+
return thisReflectDefineProperty(receiver, key, {
|
|
704
|
+
__proto__: null,
|
|
705
|
+
value: value,
|
|
706
|
+
writable: true,
|
|
707
|
+
enumerable: true,
|
|
708
|
+
configurable: true
|
|
709
|
+
}) === true;
|
|
710
|
+
}
|
|
711
|
+
return super.set(target, key, value, receiver);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
definePropertyDesc(target, prop, desc) {
|
|
715
|
+
// Note: target@this(unsafe) prop@prim desc@this(safe) throws@this(unsafe)
|
|
716
|
+
if (desc && (desc.set || desc.get || typeof desc.value === 'function')) return undefined;
|
|
717
|
+
return desc;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
function protectedFactory(object) {
|
|
723
|
+
// Note: other@other(unsafe) returns@this(unsafe) throws@this(unsafe)
|
|
724
|
+
return new ProtectedHandler(object);
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
class ReadOnlyHandler extends BaseHandler {
|
|
728
|
+
|
|
729
|
+
getFactory() {
|
|
730
|
+
return readonlyFactory;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
set(target, key, value, receiver) {
|
|
734
|
+
// Note: target@this(unsafe) key@prim value@this(unsafe) receiver@this(unsafe) throws@this(unsafe)
|
|
735
|
+
return thisReflectDefineProperty(receiver, key, {
|
|
736
|
+
__proto__: null,
|
|
737
|
+
value: value,
|
|
738
|
+
writable: true,
|
|
739
|
+
enumerable: true,
|
|
740
|
+
configurable: true
|
|
741
|
+
});
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
setPrototypeOf(target, value) {
|
|
745
|
+
// Note: target@this(unsafe) throws@this(unsafe)
|
|
746
|
+
return false;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
defineProperty(target, prop, desc) {
|
|
750
|
+
// Note: target@this(unsafe) prop@prim desc@this(unsafe) throws@this(unsafe)
|
|
751
|
+
return false;
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
deleteProperty(target, prop) {
|
|
755
|
+
// Note: target@this(unsafe) prop@prim throws@this(unsafe)
|
|
756
|
+
return false;
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
isExtensible(target) {
|
|
760
|
+
// Note: target@this(unsafe) throws@this(unsafe)
|
|
761
|
+
return false;
|
|
762
|
+
}
|
|
763
|
+
|
|
764
|
+
preventExtensions(target) {
|
|
765
|
+
// Note: target@this(unsafe) throws@this(unsafe)
|
|
766
|
+
return false;
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
function readonlyFactory(object) {
|
|
772
|
+
// Note: other@other(unsafe) returns@this(unsafe) throws@this(unsafe)
|
|
773
|
+
return new ReadOnlyHandler(object);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
class ReadOnlyMockHandler extends ReadOnlyHandler {
|
|
777
|
+
|
|
778
|
+
constructor(object, mock) {
|
|
779
|
+
// Note: object@other(unsafe) mock:this(unsafe) throws@this(unsafe)
|
|
780
|
+
super(object);
|
|
781
|
+
this.mock = mock;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
get(target, key, receiver) {
|
|
785
|
+
// Note: target@this(unsafe) key@prim receiver@this(unsafe) throws@this(unsafe)
|
|
786
|
+
const object = this.getObject(); // @other(unsafe)
|
|
787
|
+
const mock = this.mock;
|
|
788
|
+
if (thisReflectApply(thisObjectHasOwnProperty, mock, key) && !thisOtherHasOwnProperty(object, key)) {
|
|
789
|
+
return mock[key];
|
|
790
|
+
}
|
|
791
|
+
return super.get(target, key, receiver);
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
function thisFromOther(other) {
|
|
797
|
+
// Note: other@other(unsafe) returns@this(unsafe) throws@this(unsafe)
|
|
798
|
+
return thisFromOtherWithFactory(defaultFactory, other);
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
function thisProxyOther(factory, other, proto) {
|
|
802
|
+
const target = thisCreateTargetObject(other, proto);
|
|
803
|
+
const handler = factory(other);
|
|
804
|
+
const proxy = new ThisProxy(target, handler);
|
|
805
|
+
try {
|
|
806
|
+
otherReflectApply(otherWeakMapSet, mappingThisToOther, [proxy, other]);
|
|
807
|
+
registerProxy(proxy, handler);
|
|
808
|
+
} catch (e) {
|
|
809
|
+
throw new VMError('Unexpected error');
|
|
810
|
+
}
|
|
811
|
+
if (!isHost) {
|
|
812
|
+
thisReflectApply(thisWeakMapSet, mappingOtherToThis, [other, proxy]);
|
|
813
|
+
return proxy;
|
|
814
|
+
}
|
|
815
|
+
const proxy2 = new ThisProxy(proxy, emptyForzenObject);
|
|
816
|
+
try {
|
|
817
|
+
otherReflectApply(otherWeakMapSet, mappingThisToOther, [proxy2, other]);
|
|
818
|
+
registerProxy(proxy2, handler);
|
|
819
|
+
} catch (e) {
|
|
820
|
+
throw new VMError('Unexpected error');
|
|
821
|
+
}
|
|
822
|
+
thisReflectApply(thisWeakMapSet, mappingOtherToThis, [other, proxy2]);
|
|
823
|
+
return proxy2;
|
|
824
|
+
}
|
|
825
|
+
|
|
826
|
+
function thisEnsureThis(other) {
|
|
827
|
+
const type = typeof other;
|
|
828
|
+
switch (type) {
|
|
829
|
+
case 'object':
|
|
830
|
+
if (other === null) {
|
|
831
|
+
return null;
|
|
832
|
+
}
|
|
833
|
+
// fallthrough
|
|
834
|
+
case 'function':
|
|
835
|
+
let proto = thisReflectGetPrototypeOf(other);
|
|
836
|
+
if (!proto) {
|
|
837
|
+
return other;
|
|
838
|
+
}
|
|
839
|
+
while (proto) {
|
|
840
|
+
const mapping = thisReflectApply(thisMapGet, protoMappings, [proto]);
|
|
841
|
+
if (mapping) {
|
|
842
|
+
const mapped = thisReflectApply(thisWeakMapGet, mappingOtherToThis, [other]);
|
|
843
|
+
if (mapped) return mapped;
|
|
844
|
+
return mapping(defaultFactory, other);
|
|
845
|
+
}
|
|
846
|
+
proto = thisReflectGetPrototypeOf(proto);
|
|
847
|
+
}
|
|
848
|
+
return other;
|
|
849
|
+
case 'undefined':
|
|
850
|
+
case 'string':
|
|
851
|
+
case 'number':
|
|
852
|
+
case 'boolean':
|
|
853
|
+
case 'symbol':
|
|
854
|
+
case 'bigint':
|
|
855
|
+
return other;
|
|
856
|
+
|
|
857
|
+
default: // new, unknown types can be dangerous
|
|
858
|
+
throw new VMError(`Unknown type '${type}'`);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
function thisFromOtherForThrow(other) {
|
|
863
|
+
for (let loop = 0; loop < 10; loop++) {
|
|
864
|
+
const type = typeof other;
|
|
865
|
+
switch (type) {
|
|
866
|
+
case 'object':
|
|
867
|
+
if (other === null) {
|
|
868
|
+
return null;
|
|
869
|
+
}
|
|
870
|
+
// fallthrough
|
|
871
|
+
case 'function':
|
|
872
|
+
const mapped = thisReflectApply(thisWeakMapGet, mappingOtherToThis, [other]);
|
|
873
|
+
if (mapped) return mapped;
|
|
874
|
+
let proto;
|
|
875
|
+
try {
|
|
876
|
+
proto = otherReflectGetPrototypeOf(other);
|
|
877
|
+
} catch (e) { // @other(unsafe)
|
|
878
|
+
other = e;
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
if (!proto) {
|
|
882
|
+
return thisProxyOther(defaultFactory, other, null);
|
|
883
|
+
}
|
|
884
|
+
for (;;) {
|
|
885
|
+
const mapping = thisReflectApply(thisMapGet, protoMappings, [proto]);
|
|
886
|
+
if (mapping) return mapping(defaultFactory, other);
|
|
887
|
+
try {
|
|
888
|
+
proto = otherReflectGetPrototypeOf(proto);
|
|
889
|
+
} catch (e) { // @other(unsafe)
|
|
890
|
+
other = e;
|
|
891
|
+
break;
|
|
892
|
+
}
|
|
893
|
+
if (!proto) return thisProxyOther(defaultFactory, other, thisObjectPrototype);
|
|
894
|
+
}
|
|
895
|
+
break;
|
|
896
|
+
case 'undefined':
|
|
897
|
+
case 'string':
|
|
898
|
+
case 'number':
|
|
899
|
+
case 'boolean':
|
|
900
|
+
case 'symbol':
|
|
901
|
+
case 'bigint':
|
|
902
|
+
return other;
|
|
903
|
+
|
|
904
|
+
default: // new, unknown types can be dangerous
|
|
905
|
+
throw new VMError(`Unknown type '${type}'`);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
throw new VMError('Exception recursion depth');
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
function thisFromOtherWithFactory(factory, other, proto) {
|
|
912
|
+
const type = typeof other;
|
|
913
|
+
switch (type) {
|
|
914
|
+
case 'object':
|
|
915
|
+
if (other === null) {
|
|
916
|
+
return null;
|
|
917
|
+
}
|
|
918
|
+
// fallthrough
|
|
919
|
+
case 'function':
|
|
920
|
+
const mapped = thisReflectApply(thisWeakMapGet, mappingOtherToThis, [other]);
|
|
921
|
+
if (mapped) return mapped;
|
|
922
|
+
if (proto) {
|
|
923
|
+
return thisProxyOther(factory, other, proto);
|
|
924
|
+
}
|
|
925
|
+
try {
|
|
926
|
+
proto = otherReflectGetPrototypeOf(other);
|
|
927
|
+
} catch (e) { // @other(unsafe)
|
|
928
|
+
throw thisFromOtherForThrow(e);
|
|
929
|
+
}
|
|
930
|
+
if (!proto) {
|
|
931
|
+
return thisProxyOther(factory, other, null);
|
|
932
|
+
}
|
|
933
|
+
do {
|
|
934
|
+
const mapping = thisReflectApply(thisMapGet, protoMappings, [proto]);
|
|
935
|
+
if (mapping) return mapping(factory, other);
|
|
936
|
+
try {
|
|
937
|
+
proto = otherReflectGetPrototypeOf(proto);
|
|
938
|
+
} catch (e) { // @other(unsafe)
|
|
939
|
+
throw thisFromOtherForThrow(e);
|
|
940
|
+
}
|
|
941
|
+
} while (proto);
|
|
942
|
+
return thisProxyOther(factory, other, thisObjectPrototype);
|
|
943
|
+
case 'undefined':
|
|
944
|
+
case 'string':
|
|
945
|
+
case 'number':
|
|
946
|
+
case 'boolean':
|
|
947
|
+
case 'symbol':
|
|
948
|
+
case 'bigint':
|
|
949
|
+
return other;
|
|
950
|
+
|
|
951
|
+
default: // new, unknown types can be dangerous
|
|
952
|
+
throw new VMError(`Unknown type '${type}'`);
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
function thisFromOtherArguments(args) {
|
|
957
|
+
// Note: args@other(safe-array) returns@this(safe-array) throws@this(unsafe)
|
|
958
|
+
const arr = [];
|
|
959
|
+
for (let i = 0; i < args.length; i++) {
|
|
960
|
+
const value = thisFromOther(args[i]);
|
|
961
|
+
thisReflectDefineProperty(arr, i, {
|
|
962
|
+
__proto__: null,
|
|
963
|
+
value: value,
|
|
964
|
+
writable: true,
|
|
965
|
+
enumerable: true,
|
|
966
|
+
configurable: true
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
return arr;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
function thisConnect(obj, other) {
|
|
973
|
+
// Note: obj@this(unsafe) other@other(unsafe) throws@this(unsafe)
|
|
974
|
+
try {
|
|
975
|
+
otherReflectApply(otherWeakMapSet, mappingThisToOther, [obj, other]);
|
|
976
|
+
} catch (e) {
|
|
977
|
+
throw new VMError('Unexpected error');
|
|
978
|
+
}
|
|
979
|
+
thisReflectApply(thisWeakMapSet, mappingOtherToThis, [other, obj]);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
thisAddProtoMapping(thisGlobalPrototypes.Object, otherGlobalPrototypes.Object);
|
|
983
|
+
thisAddProtoMapping(thisGlobalPrototypes.Array, otherGlobalPrototypes.Array);
|
|
984
|
+
|
|
985
|
+
for (let i = 0; i < globalsList.length; i++) {
|
|
986
|
+
const key = globalsList[i];
|
|
987
|
+
const tp = thisGlobalPrototypes[key];
|
|
988
|
+
const op = otherGlobalPrototypes[key];
|
|
989
|
+
if (tp && op) thisAddProtoMapping(tp, op, key);
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
for (let i = 0; i < errorsList.length; i++) {
|
|
993
|
+
const key = errorsList[i];
|
|
994
|
+
const tp = thisGlobalPrototypes[key];
|
|
995
|
+
const op = otherGlobalPrototypes[key];
|
|
996
|
+
if (tp && op) thisAddProtoMapping(tp, op, 'Error');
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
thisAddProtoMapping(thisGlobalPrototypes.VMError, otherGlobalPrototypes.VMError, 'Error');
|
|
1000
|
+
|
|
1001
|
+
result.BaseHandler = BaseHandler;
|
|
1002
|
+
result.ProtectedHandler = ProtectedHandler;
|
|
1003
|
+
result.ReadOnlyHandler = ReadOnlyHandler;
|
|
1004
|
+
result.ReadOnlyMockHandler = ReadOnlyMockHandler;
|
|
1005
|
+
|
|
1006
|
+
return result;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
exports.createBridge = createBridge;
|
|
1010
|
+
exports.VMError = VMError;
|