presigned_post.d.ts 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. export class PresignedPost {
  2. /**
  3. * The URL that should be used as the action of the form.
  4. */
  5. url: string;
  6. /**
  7. * The fields that must be included as hidden inputs on the form.
  8. */
  9. fields: PresignedPost.Fields;
  10. }
  11. export namespace PresignedPost {
  12. export interface Params {
  13. /**
  14. * The S3 bucket to which the form should upload an attached file.
  15. */
  16. Bucket?: string;
  17. /**
  18. * An array of conditions that must be met for the form upload to be
  19. * accepted by S3.
  20. */
  21. Conditions?: Array<{[key: string]: any}|[string, any, any]>;
  22. /**
  23. * The number of seconds for which the POST form's signed policy should be
  24. * valid. Defaults to 3600 (one hour).
  25. */
  26. Expires?: number;
  27. /**
  28. * A hash of form fields to include in the presigned POST form. All fields
  29. * (except 'key') will be included as exact match conditions in the
  30. * presigned policy.
  31. */
  32. Fields?: {[key: string]: any};
  33. }
  34. export interface Fields {
  35. /**
  36. * A base64-encoded policy detailing what constitutes an acceptable POST
  37. * upload. Composed of the conditions and expiration provided to
  38. * s3.createPresignedPost
  39. */
  40. Policy: string;
  41. /**
  42. * A hex-encoded HMAC of the POST policy, signed with the credentials
  43. * provided to the S3 client.
  44. */
  45. 'X-Amz-Signature': string;
  46. /**
  47. * Additional keys that must be included in the form to be submitted. This
  48. * will include signature metadata as well as any fields provided to
  49. * s3.createPresignedPost
  50. */
  51. [key: string]: string;
  52. }
  53. }