Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: notification.ts #1226

Merged
merged 28 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f07f5a8
refactor: notification.ts
trim21 Nov 3, 2023
89492cd
dep
trim21 Nov 3, 2023
39fe889
export
trim21 Nov 3, 2023
64b292f
Merge branch 'master' into notification
trim21 Nov 3, 2023
834f1fc
move to internal
trim21 Nov 3, 2023
87dd5fd
Merge remote-tracking branch 'upstream/master' into notification
trim21 Nov 5, 2023
072aae3
Update minio.d.ts
trim21 Nov 5, 2023
4ccb312
Update minio.d.ts
trim21 Nov 5, 2023
2105de1
Merge remote-tracking branch 'upstream/master' into notification
trim21 Nov 14, 2023
3bf4bd7
Refactor notification polling request.
trim21 Nov 14, 2023
0409394
Update NotificationConfig import and export in
trim21 Nov 14, 2023
6e70e86
Merge branch 'master' into notification
trim21 Nov 17, 2023
288b865
Merge branch 'master' into notification
trim21 Nov 18, 2023
f647374
Merge branch 'master' into notification
trim21 Nov 21, 2023
77d2e15
Merge branch 'master' into notification
trim21 Nov 22, 2023
2a98419
Merge branch 'master' into notification
trim21 Nov 22, 2023
fcfbc0e
Merge branch 'master' into notification
prakashsvmx Nov 27, 2023
8986b77
Merge branch 'master' into notification
trim21 Nov 28, 2023
5081e5a
Update src/minio.js
trim21 Nov 28, 2023
8f03c47
Update src/minio.js
trim21 Nov 28, 2023
7ee19f7
Update src/minio.js
trim21 Nov 28, 2023
210836e
Remove json-stream dependency
trim21 Nov 28, 2023
46a36d9
Merge branch 'master' into notification
trim21 Nov 29, 2023
1b452c8
Merge branch 'master' into notification
trim21 Nov 30, 2023
da081d8
Merge branch 'master' into notification
trim21 Dec 6, 2023
4ec4d9c
Merge branch 'master' into notification
trim21 Dec 8, 2023
43f86b3
Update src/minio.d.ts
trim21 Dec 8, 2023
b45c658
Update minio.d.ts
trim21 Dec 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 40 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,13 @@
"block-stream2": "^2.1.0",
"browser-or-node": "^2.1.1",
"buffer-crc32": "^0.2.13",
"eventemitter3": "^5.0.1",
"fast-xml-parser": "^4.2.2",
"ipaddr.js": "^2.0.1",
"json-stream": "^1.0.0",
"lodash": "^4.17.21",
"mime-types": "^2.1.35",
"query-string": "^7.1.3",
"stream-json": "^1.8.0",
"through2": "^4.0.2",
"web-encoding": "^1.1.5",
"xml2js": "^0.5.0"
Expand All @@ -110,6 +111,7 @@
"@types/lodash": "^4.14.194",
"@types/mime-types": "^2.1.1",
"@types/node": "^20.1.0",
"@types/stream-json": "^1.7.5",
"@types/through2": "^2.0.38",
"@types/xml2js": "^0.4.11",
"@typescript-eslint/eslint-plugin": "^5.59.2",
Expand Down
74 changes: 6 additions & 68 deletions src/minio.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// imported from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/93cfb0ec069731dcdfc31464788613f7cddb8192/types/minio/index.d.ts
/* eslint-disable @typescript-eslint/no-explicit-any */

import { EventEmitter } from 'node:events'
import type { Readable as ReadableStream } from 'node:stream'
trim21 marked this conversation as resolved.
Show resolved Hide resolved

import type {
CopyDestinationOptions,
Expand All @@ -28,6 +28,7 @@ import type {
IsoDate,
ItemBucketMetadata,
ItemBucketMetadataList,
LegalHoldStatus,
MetadataItem,
ObjectLockInfo,
PutObjectLegalHoldOptions,
Expand All @@ -46,10 +47,13 @@ import type {
Tag,
VersionIdentificator,
} from './internal/type.ts'
import type { NotificationConfig, NotificationEvent, NotificationPoller } from './notification.ts'

export * from './errors.ts'
export * from './helpers.ts'
export type { Region } from './internal/s3-endpoints.ts'
export type * from './notification.ts'
export * from './notification.ts'
export { CopyConditions, PostPolicy }
export type { MakeBucketOpt } from './internal/client.ts'
export type {
Expand All @@ -67,6 +71,7 @@ export type {
IsoDate,
ItemBucketMetadata,
ItemBucketMetadataList,
LegalHoldStatus,
MetadataItem,
NoResultCallback,
ObjectLockInfo,
Expand All @@ -86,26 +91,6 @@ export type {
Tag,
}

// Exports only from typings
export type NotificationEvent =
| 's3:ObjectCreated:*'
| 's3:ObjectCreated:Put'
| 's3:ObjectCreated:Post'
| 's3:ObjectCreated:Copy'
| 's3:ObjectCreated:CompleteMultipartUpload'
| 's3:ObjectRemoved:*'
| 's3:ObjectRemoved:Delete'
| 's3:ObjectRemoved:DeleteMarkerCreated'
| 's3:ReducedRedundancyLostObject'
| 's3:TestEvent'
| 's3:ObjectRestore:Post'
| 's3:ObjectRestore:Completed'
| 's3:Replication:OperationFailedReplication'
| 's3:Replication:OperationMissedThreshold'
| 's3:Replication:OperationReplicatedAfterThreshold'
| 's3:Replication:OperationNotTracked'
| string

/**
* @deprecated keep for backward compatible, use `RETENTION_MODES` instead
*/
Expand All @@ -116,10 +101,6 @@ export type Mode = RETENTION_MODES
*/
export type LockUnit = RETENTION_VALIDITY_UNITS

/**
* @deprecated keep for backward compatible
*/
export type LegalHoldStatus = LEGAL_HOLD_STATUS
export type VersioningConfig = Record<string | number | symbol, unknown>
export type TagList = Record<string, string>
export type Lifecycle = LifecycleConfig | null | ''
Expand Down Expand Up @@ -404,46 +385,3 @@ export class Client extends TypedClient {
// Other
newPostPolicy(): PostPolicy
}

export declare class NotificationPoller extends EventEmitter {
stop(): void

start(): void

// must to be public?
checkForChanges(): void
}

export declare class NotificationConfig {
add(target: TopicConfig | QueueConfig | CloudFunctionConfig): void
}

export declare class TopicConfig extends TargetConfig {
constructor(arn: string)
}

export declare class QueueConfig extends TargetConfig {
constructor(arn: string)
}

export declare class CloudFunctionConfig extends TargetConfig {
constructor(arn: string)
}

export declare function buildARN(
partition: string,
service: string,
region: string,
accountId: string,
resource: string,
): string

export declare const ObjectCreatedAll: NotificationEvent // s3:ObjectCreated:*'
export declare const ObjectCreatedPut: NotificationEvent // s3:ObjectCreated:Put
export declare const ObjectCreatedPost: NotificationEvent // s3:ObjectCreated:Post
export declare const ObjectCreatedCopy: NotificationEvent // s3:ObjectCreated:Copy
export declare const ObjectCreatedCompleteMultipartUpload: NotificationEvent // s3:ObjectCreated:CompleteMultipartUpload
export declare const ObjectRemovedAll: NotificationEvent // s3:ObjectRemoved:*
export declare const ObjectRemovedDelete: NotificationEvent // s3:ObjectRemoved:Delete
export declare const ObjectRemovedDeleteMarkerCreated: NotificationEvent // s3:ObjectRemoved:DeleteMarkerCreated
export declare const ObjectReducedRedundancyLostObject: NotificationEvent // s3:ReducedRedundancyLostObject
4 changes: 2 additions & 2 deletions src/minio.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ import {
uriResourceEscape,
} from './internal/helper.ts'
import { PostPolicy } from './internal/post-policy.ts'
import { NotificationConfig, NotificationPoller } from './notification.js'
import { NotificationConfig, NotificationPoller } from './notification.ts'
import { promisify } from './promisify.js'
import { postPresignSignatureV4, presignSignatureV4 } from './signing.ts'
import * as transformers from './transformers.js'
import { parseSelectObjectContentResponse } from './xml-parsers.js'

export * from './errors.ts'
export * from './helpers.ts'
export * from './notification.js'
export * from './notification.ts'
export { CopyConditions, PostPolicy }

export class Client extends TypedClient {
Expand Down
Loading