notification.d.mts 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { EventEmitter } from 'eventemitter3';
  2. import type { TypedClient } from "./internal/client.mjs";
  3. type Event = unknown;
  4. export declare class TargetConfig {
  5. private Filter?;
  6. private Event?;
  7. private Id;
  8. setId(id: unknown): void;
  9. addEvent(newevent: Event): void;
  10. addFilterSuffix(suffix: string): void;
  11. addFilterPrefix(prefix: string): void;
  12. }
  13. export declare class TopicConfig extends TargetConfig {
  14. private Topic;
  15. constructor(arn: string);
  16. }
  17. export declare class QueueConfig extends TargetConfig {
  18. private Queue;
  19. constructor(arn: string);
  20. }
  21. export declare class CloudFunctionConfig extends TargetConfig {
  22. private CloudFunction;
  23. constructor(arn: string);
  24. }
  25. export declare class NotificationConfig {
  26. private TopicConfiguration?;
  27. private CloudFunctionConfiguration?;
  28. private QueueConfiguration?;
  29. add(target: TargetConfig): void;
  30. }
  31. export declare const buildARN: (partition: string, service: string, region: string, accountId: string, resource: string) => string;
  32. export declare const ObjectCreatedAll = "s3:ObjectCreated:*";
  33. export declare const ObjectCreatedPut = "s3:ObjectCreated:Put";
  34. export declare const ObjectCreatedPost = "s3:ObjectCreated:Post";
  35. export declare const ObjectCreatedCopy = "s3:ObjectCreated:Copy";
  36. export declare const ObjectCreatedCompleteMultipartUpload = "s3:ObjectCreated:CompleteMultipartUpload";
  37. export declare const ObjectRemovedAll = "s3:ObjectRemoved:*";
  38. export declare const ObjectRemovedDelete = "s3:ObjectRemoved:Delete";
  39. export declare const ObjectRemovedDeleteMarkerCreated = "s3:ObjectRemoved:DeleteMarkerCreated";
  40. export declare const ObjectReducedRedundancyLostObject = "s3:ReducedRedundancyLostObject";
  41. 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;
  42. export type NotificationRecord = unknown;
  43. export declare class NotificationPoller extends EventEmitter<{
  44. notification: (event: NotificationRecord) => void;
  45. error: (error: unknown) => void;
  46. }> {
  47. private client;
  48. private bucketName;
  49. private prefix;
  50. private suffix;
  51. private events;
  52. private ending;
  53. constructor(client: TypedClient, bucketName: string, prefix: string, suffix: string, events: NotificationEvent[]);
  54. start(): void;
  55. stop(): void;
  56. checkForChanges(): void;
  57. }
  58. export {};