UNPKG

@aws-amplify/storage

Version:

Storage category of aws-amplify

1 lines 2.54 kB
{"version":3,"file":"copy.mjs","sources":["../../../../src/internals/apis/copy.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getGlobalContext, isAmplifyContext, } from '@aws-amplify/core';\nimport { copy as copyInternal } from '../../providers/s3/apis/internal/copy';\nexport function copy(ctxOrInput, maybeInput) {\n // Resolve the optional leading context. The global context is resolved at\n // CALL time (never cached) so single-arg callers follow live configuration.\n const [ctx, input] = isAmplifyContext(ctxOrInput)\n ? [ctxOrInput, maybeInput]\n : [getGlobalContext(), ctxOrInput];\n return copyInternal(ctx, {\n source: {\n path: input.source.path,\n bucket: input.source.bucket,\n eTag: input.source.eTag,\n notModifiedSince: input.source.notModifiedSince,\n expectedBucketOwner: input.source.expectedBucketOwner,\n },\n destination: {\n path: input.destination.path,\n bucket: input.destination.bucket,\n expectedBucketOwner: input.destination.expectedBucketOwner,\n },\n options: {\n // Advanced options\n locationCredentialsProvider: input.options?.locationCredentialsProvider,\n customEndpoint: input?.options?.customEndpoint,\n },\n // Type casting is necessary because `copyInternal` supports both Gen1 and Gen2 signatures, but here\n // given in input can only be Gen2 signature, the return can only ben Gen2 signature.\n });\n}\n"],"names":["copyInternal"],"mappings":";;;AAAA;AACA;AAGO,SAAS,IAAI,CAAC,UAAU,EAAE,UAAU,EAAE;AAC7C;AACA;AACA,IAAI,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,gBAAgB,CAAC,UAAU;AACpD,UAAU,CAAC,UAAU,EAAE,UAAU;AACjC,UAAU,CAAC,gBAAgB,EAAE,EAAE,UAAU,CAAC;AAC1C,IAAI,OAAOA,MAAY,CAAC,GAAG,EAAE;AAC7B,QAAQ,MAAM,EAAE;AAChB,YAAY,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;AACnC,YAAY,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM;AACvC,YAAY,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;AACnC,YAAY,gBAAgB,EAAE,KAAK,CAAC,MAAM,CAAC,gBAAgB;AAC3D,YAAY,mBAAmB,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;AACjE,SAAS;AACT,QAAQ,WAAW,EAAE;AACrB,YAAY,IAAI,EAAE,KAAK,CAAC,WAAW,CAAC,IAAI;AACxC,YAAY,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,MAAM;AAC5C,YAAY,mBAAmB,EAAE,KAAK,CAAC,WAAW,CAAC,mBAAmB;AACtE,SAAS;AACT,QAAQ,OAAO,EAAE;AACjB;AACA,YAAY,2BAA2B,EAAE,KAAK,CAAC,OAAO,EAAE,2BAA2B;AACnF,YAAY,cAAc,EAAE,KAAK,EAAE,OAAO,EAAE,cAAc;AAC1D,SAAS;AACT;AACA;AACA,KAAK,CAAC;AACN;;;;"}