@aws-amplify/core 6.3.13 → 6.3.14-unstable.a363362.0

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.
@@ -3,5 +3,5 @@
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.version = void 0;
5
5
  // generated by genversion
6
- exports.version = '6.5.4';
6
+ exports.version = '6.5.5-unstable.a363362.0+a363362';
7
7
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.5.4';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;AACzB;AACA,OAAO,CAAC,OAAO,GAAG,OAAO;;"}
1
+ {"version":3,"file":"version.js","sources":["../../../src/Platform/version.ts"],"sourcesContent":["\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.version = void 0;\n// generated by genversion\nexports.version = '6.5.5-unstable.a363362.0+a363362';\n"],"names":[],"mappings":";;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;AACzB;AACA,OAAO,CAAC,OAAO,GAAG,kCAAkC;;"}
@@ -7,13 +7,27 @@ exports.base64Encoder = void 0;
7
7
  const globalHelpers_1 = require("../../globalHelpers");
8
8
  const bytesToString_1 = require("./bytesToString");
9
9
  exports.base64Encoder = {
10
- convert(input, { urlSafe } = { urlSafe: false }) {
10
+ /**
11
+ * Convert input to base64-encoded string
12
+ * @param input - string to convert to base64
13
+ * @param options - encoding options that can optionally produce a base64url string
14
+ * @returns base64-encoded string
15
+ */
16
+ convert(input, options = {
17
+ urlSafe: false,
18
+ skipPadding: false,
19
+ }) {
11
20
  const inputStr = typeof input === 'string' ? input : (0, bytesToString_1.bytesToString)(input);
12
- const encodedStr = (0, globalHelpers_1.getBtoa)()(inputStr);
13
- // see details about the char replacing at https://datatracker.ietf.org/doc/html/rfc4648#section-5
14
- return urlSafe
15
- ? encodedStr.replace(/\+/g, '-').replace(/\//g, '_')
16
- : encodedStr;
21
+ let encodedStr = (0, globalHelpers_1.getBtoa)()(inputStr);
22
+ // urlSafe char replacement and skipPadding options conform to the base64url spec
23
+ // https://datatracker.ietf.org/doc/html/rfc4648#section-5
24
+ if (options.urlSafe) {
25
+ encodedStr = encodedStr.replace(/\+/g, '-').replace(/\//g, '_');
26
+ }
27
+ if (options.skipPadding) {
28
+ encodedStr = encodedStr.replace(/=/g, '');
29
+ }
30
+ return encodedStr;
17
31
  },
18
32
  };
19
33
  //# sourceMappingURL=base64Encoder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"base64Encoder.js","sources":["../../../../../src/utils/convert/base64/base64Encoder.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.base64Encoder = void 0;\nconst globalHelpers_1 = require(\"../../globalHelpers\");\nconst bytesToString_1 = require(\"./bytesToString\");\nexports.base64Encoder = {\n convert(input, { urlSafe } = { urlSafe: false }) {\n const inputStr = typeof input === 'string' ? input : (0, bytesToString_1.bytesToString)(input);\n const encodedStr = (0, globalHelpers_1.getBtoa)()(inputStr);\n // see details about the char replacing at https://datatracker.ietf.org/doc/html/rfc4648#section-5\n return urlSafe\n ? encodedStr.replace(/\\+/g, '-').replace(/\\//g, '_')\n : encodedStr;\n },\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AAC/B,MAAM,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AACvD,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnD,OAAO,CAAC,aAAa,GAAG;AACxB,IAAI,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;AACrD,QAAQ,MAAM,QAAQ,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAG,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AACvG,QAAQ,MAAM,UAAU,GAAG,IAAI,eAAe,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;AACpE;AACA,QAAQ,OAAO,OAAO;AACtB,cAAc,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;AAChE,cAAc,UAAU,CAAC;AACzB,KAAK;AACL,CAAC;;"}
1
+ {"version":3,"file":"base64Encoder.js","sources":["../../../../../src/utils/convert/base64/base64Encoder.ts"],"sourcesContent":["\"use strict\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.base64Encoder = void 0;\nconst globalHelpers_1 = require(\"../../globalHelpers\");\nconst bytesToString_1 = require(\"./bytesToString\");\nexports.base64Encoder = {\n /**\n * Convert input to base64-encoded string\n * @param input - string to convert to base64\n * @param options - encoding options that can optionally produce a base64url string\n * @returns base64-encoded string\n */\n convert(input, options = {\n urlSafe: false,\n skipPadding: false,\n }) {\n const inputStr = typeof input === 'string' ? input : (0, bytesToString_1.bytesToString)(input);\n let encodedStr = (0, globalHelpers_1.getBtoa)()(inputStr);\n // urlSafe char replacement and skipPadding options conform to the base64url spec\n // https://datatracker.ietf.org/doc/html/rfc4648#section-5\n if (options.urlSafe) {\n encodedStr = encodedStr.replace(/\\+/g, '-').replace(/\\//g, '_');\n }\n if (options.skipPadding) {\n encodedStr = encodedStr.replace(/=/g, '');\n }\n return encodedStr;\n },\n};\n"],"names":[],"mappings":";;AACA;AACA;AACA,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAC9D,OAAO,CAAC,aAAa,GAAG,KAAK,CAAC,CAAC;AAC/B,MAAM,eAAe,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAC;AACvD,MAAM,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AACnD,OAAO,CAAC,aAAa,GAAG;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG;AAC7B,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,WAAW,EAAE,KAAK;AAC1B,KAAK,EAAE;AACP,QAAQ,MAAM,QAAQ,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAG,IAAI,eAAe,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AACvG,QAAQ,IAAI,UAAU,GAAG,IAAI,eAAe,CAAC,OAAO,GAAG,CAAC,QAAQ,CAAC,CAAC;AAClE;AACA;AACA,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE;AAC7B,YAAY,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC5E,SAAS;AACT,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE;AACjC,YAAY,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACtD,SAAS;AACT,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL,CAAC;;"}
@@ -1 +1 @@
1
- export declare const version = "6.5.4";
1
+ export declare const version = "6.5.5-unstable.a363362.0+a363362";
@@ -1,5 +1,5 @@
1
1
  // generated by genversion
2
- const version = '6.5.4';
2
+ const version = '6.5.5-unstable.a363362.0+a363362';
3
3
 
4
4
  export { version };
5
5
  //# sourceMappingURL=version.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.5.4';\n"],"names":[],"mappings":"AAAA;AACY,MAAC,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"version.mjs","sources":["../../../src/Platform/version.ts"],"sourcesContent":["// generated by genversion\nexport const version = '6.5.5-unstable.a363362.0+a363362';\n"],"names":[],"mappings":"AAAA;AACY,MAAC,OAAO,GAAG;;;;"}
@@ -1,2 +1,2 @@
1
- import { Base64Encoder } from '../types';
1
+ import type { Base64Encoder } from '../types';
2
2
  export declare const base64Encoder: Base64Encoder;
@@ -4,13 +4,27 @@ import { bytesToString } from './bytesToString.mjs';
4
4
  // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5
5
  // SPDX-License-Identifier: Apache-2.0
6
6
  const base64Encoder = {
7
- convert(input, { urlSafe } = { urlSafe: false }) {
7
+ /**
8
+ * Convert input to base64-encoded string
9
+ * @param input - string to convert to base64
10
+ * @param options - encoding options that can optionally produce a base64url string
11
+ * @returns base64-encoded string
12
+ */
13
+ convert(input, options = {
14
+ urlSafe: false,
15
+ skipPadding: false,
16
+ }) {
8
17
  const inputStr = typeof input === 'string' ? input : bytesToString(input);
9
- const encodedStr = getBtoa()(inputStr);
10
- // see details about the char replacing at https://datatracker.ietf.org/doc/html/rfc4648#section-5
11
- return urlSafe
12
- ? encodedStr.replace(/\+/g, '-').replace(/\//g, '_')
13
- : encodedStr;
18
+ let encodedStr = getBtoa()(inputStr);
19
+ // urlSafe char replacement and skipPadding options conform to the base64url spec
20
+ // https://datatracker.ietf.org/doc/html/rfc4648#section-5
21
+ if (options.urlSafe) {
22
+ encodedStr = encodedStr.replace(/\+/g, '-').replace(/\//g, '_');
23
+ }
24
+ if (options.skipPadding) {
25
+ encodedStr = encodedStr.replace(/=/g, '');
26
+ }
27
+ return encodedStr;
14
28
  },
15
29
  };
16
30
 
@@ -1 +1 @@
1
- {"version":3,"file":"base64Encoder.mjs","sources":["../../../../../src/utils/convert/base64/base64Encoder.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getBtoa } from '../../globalHelpers';\nimport { bytesToString } from './bytesToString';\nexport const base64Encoder = {\n convert(input, { urlSafe } = { urlSafe: false }) {\n const inputStr = typeof input === 'string' ? input : bytesToString(input);\n const encodedStr = getBtoa()(inputStr);\n // see details about the char replacing at https://datatracker.ietf.org/doc/html/rfc4648#section-5\n return urlSafe\n ? encodedStr.replace(/\\+/g, '-').replace(/\\//g, '_')\n : encodedStr;\n },\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,aAAa,GAAG;AAC7B,IAAI,OAAO,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;AACrD,QAAQ,MAAM,QAAQ,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;AAClF,QAAQ,MAAM,UAAU,GAAG,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC;AAC/C;AACA,QAAQ,OAAO,OAAO;AACtB,cAAc,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;AAChE,cAAc,UAAU,CAAC;AACzB,KAAK;AACL;;;;"}
1
+ {"version":3,"file":"base64Encoder.mjs","sources":["../../../../../src/utils/convert/base64/base64Encoder.ts"],"sourcesContent":["// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { getBtoa } from '../../globalHelpers';\nimport { bytesToString } from './bytesToString';\nexport const base64Encoder = {\n /**\n * Convert input to base64-encoded string\n * @param input - string to convert to base64\n * @param options - encoding options that can optionally produce a base64url string\n * @returns base64-encoded string\n */\n convert(input, options = {\n urlSafe: false,\n skipPadding: false,\n }) {\n const inputStr = typeof input === 'string' ? input : bytesToString(input);\n let encodedStr = getBtoa()(inputStr);\n // urlSafe char replacement and skipPadding options conform to the base64url spec\n // https://datatracker.ietf.org/doc/html/rfc4648#section-5\n if (options.urlSafe) {\n encodedStr = encodedStr.replace(/\\+/g, '-').replace(/\\//g, '_');\n }\n if (options.skipPadding) {\n encodedStr = encodedStr.replace(/=/g, '');\n }\n return encodedStr;\n },\n};\n"],"names":[],"mappings":";;;AAAA;AACA;AAGY,MAAC,aAAa,GAAG;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG;AAC7B,QAAQ,OAAO,EAAE,KAAK;AACtB,QAAQ,WAAW,EAAE,KAAK;AAC1B,KAAK,EAAE;AACP,QAAQ,MAAM,QAAQ,GAAG,OAAO,KAAK,KAAK,QAAQ,GAAG,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;AAClF,QAAQ,IAAI,UAAU,GAAG,OAAO,EAAE,CAAC,QAAQ,CAAC,CAAC;AAC7C;AACA;AACA,QAAQ,IAAI,OAAO,CAAC,OAAO,EAAE;AAC7B,YAAY,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AAC5E,SAAS;AACT,QAAQ,IAAI,OAAO,CAAC,WAAW,EAAE;AACjC,YAAY,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AACtD,SAAS;AACT,QAAQ,OAAO,UAAU,CAAC;AAC1B,KAAK;AACL;;;;"}
@@ -1,5 +1,6 @@
1
1
  export interface Base64EncoderConvertOptions {
2
2
  urlSafe: boolean;
3
+ skipPadding?: boolean;
3
4
  }
4
5
  export interface Base64Encoder {
5
6
  convert(input: Uint8Array | string, options?: Base64EncoderConvertOptions): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aws-amplify/core",
3
- "version": "6.3.13",
3
+ "version": "6.3.14-unstable.a363362.0+a363362",
4
4
  "description": "Core category of aws-amplify",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.mjs",
@@ -60,7 +60,7 @@
60
60
  "uuid": "^9.0.0"
61
61
  },
62
62
  "devDependencies": {
63
- "@aws-amplify/react-native": "1.1.4",
63
+ "@aws-amplify/react-native": "1.1.5-unstable.a363362.0+a363362",
64
64
  "@types/js-cookie": "3.0.2",
65
65
  "genversion": "^2.2.0",
66
66
  "typescript": "5.0.2"
@@ -192,5 +192,5 @@
192
192
  ]
193
193
  }
194
194
  },
195
- "gitHead": "eb86c26ff25c4385437a3d89b9f7be73e90d9c9d"
195
+ "gitHead": "a363362f443b10b035bb1e214adce9e6d0b1935e"
196
196
  }
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- export const version = '6.5.4';
2
+ export const version = '6.5.5-unstable.a363362.0+a363362';
@@ -2,18 +2,37 @@
2
2
  // SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  import { getBtoa } from '../../globalHelpers';
5
- import { Base64Encoder } from '../types';
5
+ import type { Base64Encoder, Base64EncoderConvertOptions } from '../types';
6
6
 
7
7
  import { bytesToString } from './bytesToString';
8
8
 
9
9
  export const base64Encoder: Base64Encoder = {
10
- convert(input, { urlSafe } = { urlSafe: false }) {
10
+ /**
11
+ * Convert input to base64-encoded string
12
+ * @param input - string to convert to base64
13
+ * @param options - encoding options that can optionally produce a base64url string
14
+ * @returns base64-encoded string
15
+ */
16
+ convert(
17
+ input,
18
+ options: Base64EncoderConvertOptions = {
19
+ urlSafe: false,
20
+ skipPadding: false,
21
+ },
22
+ ) {
11
23
  const inputStr = typeof input === 'string' ? input : bytesToString(input);
12
- const encodedStr = getBtoa()(inputStr);
24
+ let encodedStr = getBtoa()(inputStr);
13
25
 
14
- // see details about the char replacing at https://datatracker.ietf.org/doc/html/rfc4648#section-5
15
- return urlSafe
16
- ? encodedStr.replace(/\+/g, '-').replace(/\//g, '_')
17
- : encodedStr;
26
+ // urlSafe char replacement and skipPadding options conform to the base64url spec
27
+ // https://datatracker.ietf.org/doc/html/rfc4648#section-5
28
+ if (options.urlSafe) {
29
+ encodedStr = encodedStr.replace(/\+/g, '-').replace(/\//g, '_');
30
+ }
31
+
32
+ if (options.skipPadding) {
33
+ encodedStr = encodedStr.replace(/=/g, '');
34
+ }
35
+
36
+ return encodedStr;
18
37
  },
19
38
  };
@@ -3,6 +3,7 @@
3
3
 
4
4
  export interface Base64EncoderConvertOptions {
5
5
  urlSafe: boolean;
6
+ skipPadding?: boolean;
6
7
  }
7
8
 
8
9
  export interface Base64Encoder {