plugin-file-preview-auth 1.3.3 → 1.3.6

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.
Files changed (105) hide show
  1. package/client-v2.d.ts +2 -0
  2. package/client-v2.js +1 -0
  3. package/dist/client/713.79a55458f5b67f39.js +30 -0
  4. package/dist/client/823.8b0ab22c181d4523.js +10 -0
  5. package/dist/client/828.ae8e47a2e7a3bc9e.js +49 -0
  6. package/dist/client/892.a568eb42fd6f0047.js +10 -0
  7. package/dist/client/index.js +1 -1
  8. package/dist/client-v2/index.js +10 -0
  9. package/dist/externalVersion.js +8 -7
  10. package/dist/node_modules/@aws-sdk/client-s3/dist-cjs/index.js +3086 -3725
  11. package/dist/node_modules/@aws-sdk/client-s3/node_modules/.bin/fxparser +16 -0
  12. package/dist/node_modules/@aws-sdk/client-s3/node_modules/.bin/fxparser.cmd +17 -0
  13. package/dist/node_modules/@aws-sdk/client-s3/node_modules/.bin/fxparser.ps1 +28 -0
  14. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-cjs/index.js +110 -0
  15. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/SignatureV4MultiRegion.js +66 -0
  16. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/index.js +2 -0
  17. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-es/signature-v4-crt-container.js +3 -0
  18. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-types/SignatureV4MultiRegion.d.ts +30 -0
  19. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-types/index.d.ts +5 -0
  20. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-types/signature-v4-crt-container.d.ts +28 -0
  21. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-types/ts3.4/SignatureV4MultiRegion.d.ts +40 -0
  22. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-types/ts3.4/index.d.ts +2 -0
  23. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/dist-types/ts3.4/signature-v4-crt-container.d.ts +20 -0
  24. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@aws-sdk/signature-v4-multi-region/package.json +57 -0
  25. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-cjs/AdaptiveRetryStrategy.js +1 -0
  26. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-cjs/ConfiguredRetryStrategy.js +1 -0
  27. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-cjs/DefaultRateLimiter.js +1 -0
  28. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-cjs/StandardRetryStrategy.js +1 -0
  29. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-cjs/config.js +1 -0
  30. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-cjs/constants.js +1 -0
  31. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-cjs/defaultRetryBackoffStrategy.js +1 -0
  32. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-cjs/defaultRetryToken.js +1 -0
  33. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-cjs/index.js +358 -0
  34. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-cjs/types.js +1 -0
  35. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-es/AdaptiveRetryStrategy.js +24 -0
  36. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-es/ConfiguredRetryStrategy.js +18 -0
  37. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-es/DefaultRateLimiter.js +100 -0
  38. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-es/StandardRetryStrategy.js +65 -0
  39. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-es/config.js +7 -0
  40. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-es/constants.js +9 -0
  41. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-es/defaultRetryBackoffStrategy.js +14 -0
  42. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-es/defaultRetryToken.js +11 -0
  43. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-es/index.js +7 -0
  44. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-es/types.js +1 -0
  45. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/AdaptiveRetryStrategy.d.ts +33 -0
  46. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/ConfiguredRetryStrategy.d.ts +32 -0
  47. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/DefaultRateLimiter.d.ts +49 -0
  48. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/StandardRetryStrategy.d.ts +26 -0
  49. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/config.d.ts +20 -0
  50. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/constants.d.ts +59 -0
  51. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/defaultRetryBackoffStrategy.d.ts +5 -0
  52. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/defaultRetryToken.d.ts +9 -0
  53. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/index.d.ts +7 -0
  54. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/ts3.4/AdaptiveRetryStrategy.d.ts +33 -0
  55. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/ts3.4/ConfiguredRetryStrategy.d.ts +32 -0
  56. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/ts3.4/DefaultRateLimiter.d.ts +49 -0
  57. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/ts3.4/StandardRetryStrategy.d.ts +26 -0
  58. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/ts3.4/config.d.ts +20 -0
  59. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/ts3.4/constants.d.ts +59 -0
  60. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/ts3.4/defaultRetryBackoffStrategy.d.ts +5 -0
  61. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/ts3.4/defaultRetryToken.d.ts +9 -0
  62. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/ts3.4/index.d.ts +7 -0
  63. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/ts3.4/types.d.ts +19 -0
  64. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/dist-types/types.d.ts +19 -0
  65. package/dist/node_modules/@aws-sdk/client-s3/node_modules/@smithy/util-retry/package.json +68 -0
  66. package/dist/node_modules/@aws-sdk/client-s3/package.json +1 -1
  67. package/dist/node_modules/xlsx/package.json +1 -1
  68. package/dist/server/ocr/tesseract-runner.js +3 -1
  69. package/dist/server/plugin.js +22 -4
  70. package/package.json +57 -45
  71. package/src/client/AIFilePreviewAction.tsx +282 -0
  72. package/src/client/__tests__/ocr-utils.test.ts +85 -0
  73. package/src/client/client.d.ts +258 -0
  74. package/src/client/index.tsx +1807 -0
  75. package/src/client/locale.ts +21 -0
  76. package/src/client-v2/index.tsx +1 -0
  77. package/src/client-v2/plugin.tsx +7 -0
  78. package/{dist/index.d.ts → src/index.ts} +11 -10
  79. package/src/locale/en-US.json +14 -0
  80. package/src/locale/vi-VN.json +14 -0
  81. package/src/locale/zh-CN.json +14 -0
  82. package/src/server/__tests__/smoke.test.ts +17 -0
  83. package/src/server/collections/attachment-ocr-results.ts +40 -0
  84. package/{dist/server/collections/file-preview-auth.d.ts → src/server/collections/file-preview-auth.ts} +15 -14
  85. package/src/server/excel-parser-handler.ts +128 -0
  86. package/{dist/server/index.d.ts → src/server/index.ts} +10 -9
  87. package/src/server/migrations/20260528000000-move-ocr-fields-out-of-attachments.ts +39 -0
  88. package/src/server/ocr/tesseract-runner.ts +389 -0
  89. package/src/server/ocr/tesseract-worker.ts +235 -0
  90. package/src/server/plugin.ts +1470 -0
  91. package/dist/client/166.17caa11c2ba40313.js +0 -10
  92. package/dist/client/351.0f0ce45c92425c8f.js +0 -10
  93. package/dist/client/374.96762d13b15e7467.js +0 -30
  94. package/dist/client/514.2a8b6aa0d2fcd4b2.js +0 -49
  95. package/dist/client/AIFilePreviewAction.d.ts +0 -42
  96. package/dist/client/index.d.ts +0 -14
  97. package/dist/client/locale.d.ts +0 -10
  98. package/dist/node_modules/xlsx/node_modules/.bin/crc32 +0 -15
  99. package/dist/node_modules/xlsx/node_modules/.bin/crc32.cmd +0 -7
  100. package/dist/server/collections/attachment-ocr-results.d.ts +0 -2
  101. package/dist/server/excel-parser-handler.d.ts +0 -60
  102. package/dist/server/migrations/20260528000000-move-ocr-fields-out-of-attachments.d.ts +0 -5
  103. package/dist/server/ocr/tesseract-runner.d.ts +0 -34
  104. package/dist/server/ocr/tesseract-worker.d.ts +0 -27
  105. package/dist/server/plugin.d.ts +0 -54
@@ -0,0 +1,16 @@
1
+ #!/bin/sh
2
+ basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
3
+
4
+ case `uname` in
5
+ *CYGWIN*|*MINGW*|*MSYS*)
6
+ if command -v cygpath > /dev/null 2>&1; then
7
+ basedir=`cygpath -w "$basedir"`
8
+ fi
9
+ ;;
10
+ esac
11
+
12
+ if [ -x "$basedir/node" ]; then
13
+ exec "$basedir/node" "$basedir/../fast-xml-parser/src/cli/cli.js" "$@"
14
+ else
15
+ exec node "$basedir/../fast-xml-parser/src/cli/cli.js" "$@"
16
+ fi
@@ -0,0 +1,17 @@
1
+ @ECHO off
2
+ GOTO start
3
+ :find_dp0
4
+ SET dp0=%~dp0
5
+ EXIT /b
6
+ :start
7
+ SETLOCAL
8
+ CALL :find_dp0
9
+
10
+ IF EXIST "%dp0%\node.exe" (
11
+ SET "_prog=%dp0%\node.exe"
12
+ ) ELSE (
13
+ SET "_prog=node"
14
+ SET PATHEXT=%PATHEXT:;.JS;=;%
15
+ )
16
+
17
+ endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\fast-xml-parser\src\cli\cli.js" %*
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env pwsh
2
+ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
3
+
4
+ $exe=""
5
+ if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
6
+ # Fix case when both the Windows and Linux builds of Node
7
+ # are installed in the same directory
8
+ $exe=".exe"
9
+ }
10
+ $ret=0
11
+ if (Test-Path "$basedir/node$exe") {
12
+ # Support pipeline input
13
+ if ($MyInvocation.ExpectingInput) {
14
+ $input | & "$basedir/node$exe" "$basedir/../fast-xml-parser/src/cli/cli.js" $args
15
+ } else {
16
+ & "$basedir/node$exe" "$basedir/../fast-xml-parser/src/cli/cli.js" $args
17
+ }
18
+ $ret=$LASTEXITCODE
19
+ } else {
20
+ # Support pipeline input
21
+ if ($MyInvocation.ExpectingInput) {
22
+ $input | & "node$exe" "$basedir/../fast-xml-parser/src/cli/cli.js" $args
23
+ } else {
24
+ & "node$exe" "$basedir/../fast-xml-parser/src/cli/cli.js" $args
25
+ }
26
+ $ret=$LASTEXITCODE
27
+ }
28
+ exit $ret
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ SignatureV4MultiRegion: () => SignatureV4MultiRegion,
25
+ signatureV4CrtContainer: () => signatureV4CrtContainer
26
+ });
27
+ module.exports = __toCommonJS(src_exports);
28
+
29
+ // src/SignatureV4MultiRegion.ts
30
+ var import_middleware_sdk_s3 = require("@aws-sdk/middleware-sdk-s3");
31
+
32
+ // src/signature-v4-crt-container.ts
33
+ var signatureV4CrtContainer = {
34
+ CrtSignerV4: null
35
+ };
36
+
37
+ // src/SignatureV4MultiRegion.ts
38
+ var SignatureV4MultiRegion = class {
39
+ static {
40
+ __name(this, "SignatureV4MultiRegion");
41
+ }
42
+ sigv4aSigner;
43
+ sigv4Signer;
44
+ signerOptions;
45
+ constructor(options) {
46
+ this.sigv4Signer = new import_middleware_sdk_s3.SignatureV4S3Express(options);
47
+ this.signerOptions = options;
48
+ }
49
+ async sign(requestToSign, options = {}) {
50
+ if (options.signingRegion === "*") {
51
+ if (this.signerOptions.runtime !== "node")
52
+ throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
53
+ return this.getSigv4aSigner().sign(requestToSign, options);
54
+ }
55
+ return this.sigv4Signer.sign(requestToSign, options);
56
+ }
57
+ /**
58
+ * Sign with alternate credentials to the ones provided in the constructor.
59
+ */
60
+ async signWithCredentials(requestToSign, credentials, options = {}) {
61
+ if (options.signingRegion === "*") {
62
+ if (this.signerOptions.runtime !== "node")
63
+ throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
64
+ return this.getSigv4aSigner().signWithCredentials(requestToSign, credentials, options);
65
+ }
66
+ return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options);
67
+ }
68
+ async presign(originalRequest, options = {}) {
69
+ if (options.signingRegion === "*") {
70
+ if (this.signerOptions.runtime !== "node")
71
+ throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
72
+ return this.getSigv4aSigner().presign(originalRequest, options);
73
+ }
74
+ return this.sigv4Signer.presign(originalRequest, options);
75
+ }
76
+ async presignWithCredentials(originalRequest, credentials, options = {}) {
77
+ if (options.signingRegion === "*") {
78
+ throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");
79
+ }
80
+ return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options);
81
+ }
82
+ getSigv4aSigner() {
83
+ if (!this.sigv4aSigner) {
84
+ let CrtSignerV4 = null;
85
+ try {
86
+ CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
87
+ if (typeof CrtSignerV4 !== "function")
88
+ throw new Error();
89
+ } catch (e) {
90
+ e.message = `${e.message}
91
+ Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly.
92
+ You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";].
93
+ For more information please go to https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt`;
94
+ throw e;
95
+ }
96
+ this.sigv4aSigner = new CrtSignerV4({
97
+ ...this.signerOptions,
98
+ signingAlgorithm: 1
99
+ });
100
+ }
101
+ return this.sigv4aSigner;
102
+ }
103
+ };
104
+ // Annotate the CommonJS export names for ESM import in node:
105
+
106
+ 0 && (module.exports = {
107
+ SignatureV4MultiRegion,
108
+ signatureV4CrtContainer
109
+ });
110
+
@@ -0,0 +1,66 @@
1
+ import { SignatureV4S3Express } from "@aws-sdk/middleware-sdk-s3";
2
+ import { signatureV4CrtContainer } from "./signature-v4-crt-container";
3
+ export class SignatureV4MultiRegion {
4
+ sigv4aSigner;
5
+ sigv4Signer;
6
+ signerOptions;
7
+ constructor(options) {
8
+ this.sigv4Signer = new SignatureV4S3Express(options);
9
+ this.signerOptions = options;
10
+ }
11
+ async sign(requestToSign, options = {}) {
12
+ if (options.signingRegion === "*") {
13
+ if (this.signerOptions.runtime !== "node")
14
+ throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
15
+ return this.getSigv4aSigner().sign(requestToSign, options);
16
+ }
17
+ return this.sigv4Signer.sign(requestToSign, options);
18
+ }
19
+ async signWithCredentials(requestToSign, credentials, options = {}) {
20
+ if (options.signingRegion === "*") {
21
+ if (this.signerOptions.runtime !== "node")
22
+ throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
23
+ return this.getSigv4aSigner().signWithCredentials(requestToSign, credentials, options);
24
+ }
25
+ return this.sigv4Signer.signWithCredentials(requestToSign, credentials, options);
26
+ }
27
+ async presign(originalRequest, options = {}) {
28
+ if (options.signingRegion === "*") {
29
+ if (this.signerOptions.runtime !== "node")
30
+ throw new Error("This request requires signing with SigV4Asymmetric algorithm. It's only available in Node.js");
31
+ return this.getSigv4aSigner().presign(originalRequest, options);
32
+ }
33
+ return this.sigv4Signer.presign(originalRequest, options);
34
+ }
35
+ async presignWithCredentials(originalRequest, credentials, options = {}) {
36
+ if (options.signingRegion === "*") {
37
+ throw new Error("Method presignWithCredentials is not supported for [signingRegion=*].");
38
+ }
39
+ return this.sigv4Signer.presignWithCredentials(originalRequest, credentials, options);
40
+ }
41
+ getSigv4aSigner() {
42
+ if (!this.sigv4aSigner) {
43
+ let CrtSignerV4 = null;
44
+ try {
45
+ CrtSignerV4 = signatureV4CrtContainer.CrtSignerV4;
46
+ if (typeof CrtSignerV4 !== "function")
47
+ throw new Error();
48
+ }
49
+ catch (e) {
50
+ e.message =
51
+ `${e.message}\n` +
52
+ `Please check whether you have installed the "@aws-sdk/signature-v4-crt" package explicitly. \n` +
53
+ `You must also register the package by calling [require("@aws-sdk/signature-v4-crt");] ` +
54
+ `or an ESM equivalent such as [import "@aws-sdk/signature-v4-crt";]. \n` +
55
+ "For more information please go to " +
56
+ "https://github.com/aws/aws-sdk-js-v3#functionality-requiring-aws-common-runtime-crt";
57
+ throw e;
58
+ }
59
+ this.sigv4aSigner = new CrtSignerV4({
60
+ ...this.signerOptions,
61
+ signingAlgorithm: 1,
62
+ });
63
+ }
64
+ return this.sigv4aSigner;
65
+ }
66
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./SignatureV4MultiRegion";
2
+ export * from "./signature-v4-crt-container";
@@ -0,0 +1,3 @@
1
+ export const signatureV4CrtContainer = {
2
+ CrtSignerV4: null,
3
+ };
@@ -0,0 +1,30 @@
1
+ import { SignatureV4CryptoInit, SignatureV4Init } from "@smithy/signature-v4";
2
+ import { AwsCredentialIdentity, HttpRequest, RequestPresigner, RequestPresigningArguments, RequestSigner, RequestSigningArguments } from "@smithy/types";
3
+ /**
4
+ * @internal
5
+ */
6
+ export type SignatureV4MultiRegionInit = SignatureV4Init & SignatureV4CryptoInit & {
7
+ runtime?: string;
8
+ };
9
+ /**
10
+ * A SigV4-compatible signer for S3 service. In order to support SigV4a algorithm according to the operation input
11
+ * dynamically, the signer wraps native module SigV4a signer and JS SigV4 signer. It signs the request with SigV4a
12
+ * algorithm if the request needs to be signed with `*` region. Otherwise, it signs the request with normal SigV4
13
+ * signer.
14
+ * Note that SigV4a signer is only supported in Node.js now because it depends on a native dependency.
15
+ * @internal
16
+ */
17
+ export declare class SignatureV4MultiRegion implements RequestPresigner, RequestSigner {
18
+ private sigv4aSigner?;
19
+ private readonly sigv4Signer;
20
+ private readonly signerOptions;
21
+ constructor(options: SignatureV4MultiRegionInit);
22
+ sign(requestToSign: HttpRequest, options?: RequestSigningArguments): Promise<HttpRequest>;
23
+ /**
24
+ * Sign with alternate credentials to the ones provided in the constructor.
25
+ */
26
+ signWithCredentials(requestToSign: HttpRequest, credentials: AwsCredentialIdentity, options?: RequestSigningArguments): Promise<HttpRequest>;
27
+ presign(originalRequest: HttpRequest, options?: RequestPresigningArguments): Promise<HttpRequest>;
28
+ presignWithCredentials(originalRequest: HttpRequest, credentials: AwsCredentialIdentity, options?: RequestPresigningArguments): Promise<HttpRequest>;
29
+ private getSigv4aSigner;
30
+ }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export * from "./SignatureV4MultiRegion";
5
+ export * from "./signature-v4-crt-container";
@@ -0,0 +1,28 @@
1
+ import type { AwsCredentialIdentity } from "@aws-sdk/types";
2
+ import type { HttpRequest, RequestPresigner, RequestSigner, RequestSigningArguments } from "@smithy/types";
3
+ /**
4
+ * @public
5
+ */
6
+ export type OptionalCrtSignerV4 = {
7
+ /**
8
+ * This constructor is not typed so as not to require a type import
9
+ * from the signature-v4-crt package.
10
+ *
11
+ * The true type is CrtSignerV4 from \@aws-sdk/signature-v4-crt.
12
+ */
13
+ new (options: any): RequestPresigner & RequestSigner & {
14
+ signWithCredentials(requestToSign: HttpRequest, credentials: AwsCredentialIdentity, options: RequestSigningArguments): Promise<HttpRequest>;
15
+ };
16
+ };
17
+ /**
18
+ * @public
19
+ *
20
+ * \@aws-sdk/signature-v4-crt will install the constructor in this
21
+ * container if it is installed.
22
+ *
23
+ * This avoids a runtime-require being interpreted statically by bundlers.
24
+ *
25
+ */
26
+ export declare const signatureV4CrtContainer: {
27
+ CrtSignerV4: null | OptionalCrtSignerV4;
28
+ };
@@ -0,0 +1,40 @@
1
+ import { SignatureV4CryptoInit, SignatureV4Init } from "@smithy/signature-v4";
2
+ import {
3
+ AwsCredentialIdentity,
4
+ HttpRequest,
5
+ RequestPresigner,
6
+ RequestPresigningArguments,
7
+ RequestSigner,
8
+ RequestSigningArguments,
9
+ } from "@smithy/types";
10
+ export type SignatureV4MultiRegionInit = SignatureV4Init &
11
+ SignatureV4CryptoInit & {
12
+ runtime?: string;
13
+ };
14
+ export declare class SignatureV4MultiRegion
15
+ implements RequestPresigner, RequestSigner
16
+ {
17
+ private sigv4aSigner?;
18
+ private readonly sigv4Signer;
19
+ private readonly signerOptions;
20
+ constructor(options: SignatureV4MultiRegionInit);
21
+ sign(
22
+ requestToSign: HttpRequest,
23
+ options?: RequestSigningArguments
24
+ ): Promise<HttpRequest>;
25
+ signWithCredentials(
26
+ requestToSign: HttpRequest,
27
+ credentials: AwsCredentialIdentity,
28
+ options?: RequestSigningArguments
29
+ ): Promise<HttpRequest>;
30
+ presign(
31
+ originalRequest: HttpRequest,
32
+ options?: RequestPresigningArguments
33
+ ): Promise<HttpRequest>;
34
+ presignWithCredentials(
35
+ originalRequest: HttpRequest,
36
+ credentials: AwsCredentialIdentity,
37
+ options?: RequestPresigningArguments
38
+ ): Promise<HttpRequest>;
39
+ private getSigv4aSigner;
40
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./SignatureV4MultiRegion";
2
+ export * from "./signature-v4-crt-container";
@@ -0,0 +1,20 @@
1
+ import { AwsCredentialIdentity } from "@aws-sdk/types";
2
+ import {
3
+ HttpRequest,
4
+ RequestPresigner,
5
+ RequestSigner,
6
+ RequestSigningArguments,
7
+ } from "@smithy/types";
8
+ export type OptionalCrtSignerV4 = {
9
+ new (options: any): RequestPresigner &
10
+ RequestSigner & {
11
+ signWithCredentials(
12
+ requestToSign: HttpRequest,
13
+ credentials: AwsCredentialIdentity,
14
+ options: RequestSigningArguments
15
+ ): Promise<HttpRequest>;
16
+ };
17
+ };
18
+ export declare const signatureV4CrtContainer: {
19
+ CrtSignerV4: null | OptionalCrtSignerV4;
20
+ };
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@aws-sdk/signature-v4-multi-region",
3
+ "version": "3.750.0",
4
+ "scripts": {
5
+ "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
6
+ "build:cjs": "node ../../scripts/compilation/inline signature-v4-multi-region",
7
+ "build:es": "tsc -p tsconfig.es.json",
8
+ "build:include:deps": "lerna run --scope $npm_package_name --include-dependencies build",
9
+ "build:types": "tsc -p tsconfig.types.json",
10
+ "build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
11
+ "clean": "rimraf ./dist-* && rimraf *.tsbuildinfo",
12
+ "test": "yarn g:vitest run",
13
+ "test:watch": "yarn g:vitest watch"
14
+ },
15
+ "main": "./dist-cjs/index.js",
16
+ "module": "./dist-es/index.js",
17
+ "types": "./dist-types/index.d.ts",
18
+ "author": {
19
+ "name": "AWS SDK for JavaScript Team",
20
+ "url": "https://aws.amazon.com/javascript/"
21
+ },
22
+ "license": "Apache-2.0",
23
+ "dependencies": {
24
+ "@aws-sdk/middleware-sdk-s3": "3.750.0",
25
+ "@aws-sdk/types": "3.734.0",
26
+ "@smithy/protocol-http": "^5.0.1",
27
+ "@smithy/signature-v4": "^5.0.1",
28
+ "@smithy/types": "^4.1.0",
29
+ "tslib": "^2.6.2"
30
+ },
31
+ "devDependencies": {
32
+ "@tsconfig/recommended": "1.0.1",
33
+ "concurrently": "7.0.0",
34
+ "downlevel-dts": "0.10.1",
35
+ "rimraf": "3.0.2",
36
+ "typescript": "~5.2.2"
37
+ },
38
+ "engines": {
39
+ "node": ">=18.0.0"
40
+ },
41
+ "typesVersions": {
42
+ "<4.0": {
43
+ "dist-types/*": [
44
+ "dist-types/ts3.4/*"
45
+ ]
46
+ }
47
+ },
48
+ "files": [
49
+ "dist-*/**"
50
+ ],
51
+ "homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages/signature-v4-multi-region",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "https://github.com/aws/aws-sdk-js-v3.git",
55
+ "directory": "packages/signature-v4-multi-region"
56
+ }
57
+ }
@@ -0,0 +1 @@
1
+ module.exports = require("./index.js");
@@ -0,0 +1 @@
1
+ module.exports = require("./index.js");