@granite-js/pulumi-aws 0.1.34 → 1.0.1
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.
- package/CHANGELOG.md +4 -116
- package/dist/chunk-23MVQUOJ.js +1630 -0
- package/dist/chunk-24XYHOWM.js +171 -0
- package/dist/chunk-3AVBP57V.js +1598 -0
- package/dist/chunk-3JKQPIJ2.js +460 -0
- package/dist/{chunk-ITI6QA2Q.js → chunk-3OYGHA4S.js} +1 -1
- package/dist/{chunk-IEZY5C3G.js → chunk-46DIC54Q.js} +49 -37
- package/dist/chunk-57WYIP4I.js +808 -0
- package/dist/{chunk-WCHHWTND.js → chunk-63Q3RLAK.js} +93 -59
- package/dist/chunk-6KRYZP6R.js +28 -0
- package/dist/{chunk-QAE2S7MG.js → chunk-7NN7DVGK.js} +2050 -552
- package/dist/{chunk-5W7B34BN.js → chunk-ASGFIK4A.js} +2231 -464
- package/dist/chunk-BTBQTDRJ.js +174 -0
- package/dist/chunk-DDZTWBHZ.js +154 -0
- package/dist/chunk-G3FWLTNJ.js +10 -0
- package/dist/{chunk-TJ744C2T.js → chunk-GJFKL6XM.js} +43 -38
- package/dist/chunk-H4QJ5O4E.js +36 -0
- package/dist/{chunk-X6XO7USX.js → chunk-LCO5F3JB.js} +109 -56
- package/dist/chunk-NDDYFDCU.js +60 -0
- package/dist/chunk-OCHPLE5N.js +28 -0
- package/dist/chunk-OSJA4YYQ.js +846 -0
- package/dist/chunk-PIT3K3NC.js +464 -0
- package/dist/chunk-QCKAO4UT.js +476 -0
- package/dist/{chunk-64IS37V6.js → chunk-RYIGWCGK.js} +1 -6
- package/dist/chunk-S4LJWEXU.js +37 -0
- package/dist/chunk-SJ26Y3GW.js +472 -0
- package/dist/chunk-TDZTH7TL.js +60 -0
- package/dist/chunk-THUA35UY.js +35 -0
- package/dist/{chunk-IUKLHJNE.js → chunk-V7TRGEV6.js} +4 -7
- package/dist/{chunk-KGNTV362.js → chunk-WDFKVCPC.js} +66 -34
- package/dist/{chunk-B7OAPHPY.js → chunk-YWWEFWFD.js} +3 -3
- package/dist/chunk-Z4UYYQ4J.js +42 -0
- package/dist/chunk-ZBT5SDIQ.js +16528 -0
- package/dist/chunk-ZIHRRTTA.js +24 -0
- package/dist/{dist-es-CDFIYJVE.js → dist-es-3VZ2IGGJ.js} +18 -15
- package/dist/{dist-es-SUPEA6VE-3B5JSW5C.js → dist-es-BQW4ETQH-C7ZSD5EG.js} +8 -25
- package/dist/{dist-es-GHYMLBON.js → dist-es-HSWXMGNC.js} +21 -21
- package/dist/{dist-es-OCQVKISC-TNAJ62WG.js → dist-es-IDBNBAO5-H3TO63FG.js} +15 -18
- package/dist/{dist-es-S75EKWRJ.js → dist-es-KPJNIAPT.js} +9 -10
- package/dist/{dist-es-PRWCVZGQ-HTTVI42T.js → dist-es-LZDRG6RP-SP2FWWEO.js} +3 -4
- package/dist/{dist-es-OZGLUDWT.js → dist-es-PIWY5TOR.js} +49 -26
- package/dist/{dist-es-ADTONJUN-RVFWNZHO.js → dist-es-R4LD2OHZ-B5MB6BR2.js} +11 -13
- package/dist/dist-es-S2KJK4L2-5GDBXJIO.js +470 -0
- package/dist/{dist-es-XQME5F6W.js → dist-es-THYWPEKB.js} +12 -10
- package/dist/{dist-es-HJVOMDYC-PIAMWMAL.js → dist-es-TIYLKN6W-BAHZRZH5.js} +7 -13
- package/dist/{dist-es-IDBDK36G-Y6TQMRO5.js → dist-es-VORPMM2F-WOMP2FYQ.js} +37 -30
- package/dist/{dist-es-WQHDOVD7.js → dist-es-WESJCADT.js} +3 -4
- package/dist/dist-es-XMOG24OT.js +490 -0
- package/dist/event-streams-L7RH32OW-AFMBEYJJ.js +237 -0
- package/dist/event-streams-NGUY2RWE.js +237 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/dist/lambda/auto-cache-removal.cjs +28894 -16488
- package/dist/lambda/auto-cache-removal.js +11574 -2713
- package/dist/lambda/origin-request.cjs +22351 -17619
- package/dist/lambda/origin-request.js +21 -17
- package/dist/lambda/origin-response.cjs +22219 -17387
- package/dist/lambda/origin-response.js +17 -13
- package/dist/{loadSso-CZSSLFH6-SA5HOQAX.js → loadSso-F4PTCHDN-YR3RRUYW.js} +330 -227
- package/dist/{loadSso-T7GJVVO2.js → loadSso-LG7MFP7N.js} +344 -223
- package/dist/signin-P7DNG43W.js +658 -0
- package/dist/signin-XWTOVLF3-4ENWNEF7.js +630 -0
- package/dist/{sso-oidc-PKO5GYK5-LC65L46O.js → sso-oidc-FQQGUOJL.js} +293 -332
- package/dist/{sso-oidc-55SJ27II.js → sso-oidc-RRDYLOJY-FK3AUTOI.js} +263 -337
- package/dist/{sts-OPF4H3GL.js → sts-7FBOVTCN.js} +674 -601
- package/dist/{sts-P7Q3MYTS-BKGWHQE4.js → sts-TBWJ374A-DHXXCVJJ.js} +651 -608
- package/package.json +5 -5
- package/dist/chunk-AEOST5WF.js +0 -63
- package/dist/chunk-FO7L563E.js +0 -13695
- package/dist/chunk-FRWSD3YQ.js +0 -1722
- package/dist/chunk-JBVMOFGH.js +0 -152
- package/dist/chunk-JSBRDJBE.js +0 -30
- package/dist/chunk-KRJS4RAS.js +0 -1732
- package/dist/chunk-M5GUUX64.js +0 -63
- package/dist/chunk-SX6SVQKS.js +0 -67
- package/dist/chunk-UNXXS5FM.js +0 -120
- package/dist/chunk-UT2RMOJS.js +0 -2447
- package/dist/chunk-VOTRVWIB.js +0 -1965
- package/dist/chunk-W3VXP3A3.js +0 -119
- package/dist/chunk-XLUI7RQ4.js +0 -115
- package/dist/dist-es-2M7RLZ5O.js +0 -200
- package/dist/dist-es-Y7VN37H5-WQ3GYROF.js +0 -196
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
IniSectionType
|
|
3
|
-
} from "./chunk-M5GUUX64.js";
|
|
4
|
-
|
|
5
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0.3-4011fc1192-04129a5d8e.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js
|
|
1
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/getProfileName.js
|
|
6
2
|
var ENV_PROFILE = "AWS_PROFILE";
|
|
7
3
|
var DEFAULT_PROFILE = "default";
|
|
8
4
|
var getProfileName = (init) => init.profile || process.env[ENV_PROFILE] || DEFAULT_PROFILE;
|
|
9
5
|
|
|
10
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
6
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js
|
|
11
7
|
import { join } from "path";
|
|
12
8
|
|
|
13
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
9
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/getHomeDir.js
|
|
14
10
|
import { homedir } from "os";
|
|
15
11
|
import { sep } from "path";
|
|
16
12
|
var homeDirCache = {};
|
|
@@ -34,14 +30,25 @@ var getHomeDir = () => {
|
|
|
34
30
|
return homeDirCache[homeDirCacheKey];
|
|
35
31
|
};
|
|
36
32
|
|
|
37
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
33
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigFilepath.js
|
|
38
34
|
var ENV_CONFIG_PATH = "AWS_CONFIG_FILE";
|
|
39
35
|
var getConfigFilepath = () => process.env[ENV_CONFIG_PATH] || join(getHomeDir(), ".aws", "config");
|
|
40
36
|
|
|
41
|
-
// ../../.yarn/cache/@smithy-
|
|
37
|
+
// ../../.yarn/cache/@smithy-types-npm-4.9.0-93f68e10e2-7068428d2e.zip/node_modules/@smithy/types/dist-es/profile.js
|
|
38
|
+
var IniSectionType;
|
|
39
|
+
(function(IniSectionType2) {
|
|
40
|
+
IniSectionType2["PROFILE"] = "profile";
|
|
41
|
+
IniSectionType2["SSO_SESSION"] = "sso-session";
|
|
42
|
+
IniSectionType2["SERVICES"] = "services";
|
|
43
|
+
})(IniSectionType || (IniSectionType = {}));
|
|
44
|
+
|
|
45
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js
|
|
42
46
|
import { join as join3 } from "path";
|
|
43
47
|
|
|
44
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
48
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/constants.js
|
|
49
|
+
var CONFIG_PREFIX_SEPARATOR = ".";
|
|
50
|
+
|
|
51
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/getConfigData.js
|
|
45
52
|
var getConfigData = (data) => Object.entries(data).filter(([key]) => {
|
|
46
53
|
const indexOfSeparator = key.indexOf(CONFIG_PREFIX_SEPARATOR);
|
|
47
54
|
if (indexOfSeparator === -1) {
|
|
@@ -57,12 +64,12 @@ var getConfigData = (data) => Object.entries(data).filter(([key]) => {
|
|
|
57
64
|
...data.default && { default: data.default }
|
|
58
65
|
});
|
|
59
66
|
|
|
60
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
67
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/getCredentialsFilepath.js
|
|
61
68
|
import { join as join2 } from "path";
|
|
62
69
|
var ENV_CREDENTIALS_PATH = "AWS_SHARED_CREDENTIALS_FILE";
|
|
63
70
|
var getCredentialsFilepath = () => process.env[ENV_CREDENTIALS_PATH] || join2(getHomeDir(), ".aws", "credentials");
|
|
64
71
|
|
|
65
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
72
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/parseIni.js
|
|
66
73
|
var prefixKeyRegex = /^([\w-]+)\s(["'])?([\w-@\+\.%:/]+)\2$/;
|
|
67
74
|
var profileNameBlockList = ["__proto__", "profile __proto__"];
|
|
68
75
|
var parseIni = (iniData) => {
|
|
@@ -111,20 +118,22 @@ var parseIni = (iniData) => {
|
|
|
111
118
|
return map;
|
|
112
119
|
};
|
|
113
120
|
|
|
114
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
115
|
-
import {
|
|
116
|
-
var
|
|
117
|
-
var
|
|
118
|
-
var
|
|
119
|
-
if (
|
|
120
|
-
|
|
121
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/readFile.js
|
|
122
|
+
import { readFile as fsReadFile } from "fs/promises";
|
|
123
|
+
var filePromises = {};
|
|
124
|
+
var fileIntercept = {};
|
|
125
|
+
var readFile = (path, options) => {
|
|
126
|
+
if (fileIntercept[path] !== void 0) {
|
|
127
|
+
return fileIntercept[path];
|
|
128
|
+
}
|
|
129
|
+
if (!filePromises[path] || options?.ignoreCache) {
|
|
130
|
+
filePromises[path] = fsReadFile(path, "utf8");
|
|
121
131
|
}
|
|
122
|
-
return
|
|
132
|
+
return filePromises[path];
|
|
123
133
|
};
|
|
124
134
|
|
|
125
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
135
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSharedConfigFiles.js
|
|
126
136
|
var swallowError = () => ({});
|
|
127
|
-
var CONFIG_PREFIX_SEPARATOR = ".";
|
|
128
137
|
var loadSharedConfigFiles = async (init = {}) => {
|
|
129
138
|
const { filepath = getCredentialsFilepath(), configFilepath = getConfigFilepath() } = init;
|
|
130
139
|
const homeDir = getHomeDir();
|
|
@@ -138,10 +147,10 @@ var loadSharedConfigFiles = async (init = {}) => {
|
|
|
138
147
|
resolvedConfigFilepath = join3(homeDir, configFilepath.slice(2));
|
|
139
148
|
}
|
|
140
149
|
const parsedFiles = await Promise.all([
|
|
141
|
-
|
|
150
|
+
readFile(resolvedConfigFilepath, {
|
|
142
151
|
ignoreCache: init.ignoreCache
|
|
143
152
|
}).then(parseIni).then(getConfigData).catch(swallowError),
|
|
144
|
-
|
|
153
|
+
readFile(resolvedFilepath, {
|
|
145
154
|
ignoreCache: init.ignoreCache
|
|
146
155
|
}).then(parseIni).catch(swallowError)
|
|
147
156
|
]);
|
|
@@ -151,14 +160,14 @@ var loadSharedConfigFiles = async (init = {}) => {
|
|
|
151
160
|
};
|
|
152
161
|
};
|
|
153
162
|
|
|
154
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
163
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/getSsoSessionData.js
|
|
155
164
|
var getSsoSessionData = (data) => Object.entries(data).filter(([key]) => key.startsWith(IniSectionType.SSO_SESSION + CONFIG_PREFIX_SEPARATOR)).reduce((acc, [key, value]) => ({ ...acc, [key.substring(key.indexOf(CONFIG_PREFIX_SEPARATOR) + 1)]: value }), {});
|
|
156
165
|
|
|
157
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
166
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/loadSsoSessionData.js
|
|
158
167
|
var swallowError2 = () => ({});
|
|
159
|
-
var loadSsoSessionData = async (init = {}) =>
|
|
168
|
+
var loadSsoSessionData = async (init = {}) => readFile(init.configFilepath ?? getConfigFilepath()).then(parseIni).then(getSsoSessionData).catch(swallowError2);
|
|
160
169
|
|
|
161
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
170
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/mergeConfigFiles.js
|
|
162
171
|
var mergeConfigFiles = (...files) => {
|
|
163
172
|
const merged = {};
|
|
164
173
|
for (const file of files) {
|
|
@@ -173,13 +182,16 @@ var mergeConfigFiles = (...files) => {
|
|
|
173
182
|
return merged;
|
|
174
183
|
};
|
|
175
184
|
|
|
176
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
185
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/parseKnownFiles.js
|
|
177
186
|
var parseKnownFiles = async (init) => {
|
|
178
187
|
const parsedFiles = await loadSharedConfigFiles(init);
|
|
179
188
|
return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
|
|
180
189
|
};
|
|
181
190
|
|
|
182
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
191
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js
|
|
192
|
+
import { readFile as readFile2 } from "fs/promises";
|
|
193
|
+
|
|
194
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFilepath.js
|
|
183
195
|
import { createHash } from "crypto";
|
|
184
196
|
import { join as join4 } from "path";
|
|
185
197
|
var getSSOTokenFilepath = (id) => {
|
|
@@ -188,22 +200,42 @@ var getSSOTokenFilepath = (id) => {
|
|
|
188
200
|
return join4(getHomeDir(), ".aws", "sso", "cache", `${cacheName}.json`);
|
|
189
201
|
};
|
|
190
202
|
|
|
191
|
-
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.0
|
|
192
|
-
|
|
193
|
-
var { readFile: readFile2 } = fsPromises2;
|
|
203
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/getSSOTokenFromFile.js
|
|
204
|
+
var tokenIntercept = {};
|
|
194
205
|
var getSSOTokenFromFile = async (id) => {
|
|
206
|
+
if (tokenIntercept[id]) {
|
|
207
|
+
return tokenIntercept[id];
|
|
208
|
+
}
|
|
195
209
|
const ssoTokenFilepath = getSSOTokenFilepath(id);
|
|
196
210
|
const ssoTokenText = await readFile2(ssoTokenFilepath, "utf8");
|
|
197
211
|
return JSON.parse(ssoTokenText);
|
|
198
212
|
};
|
|
199
213
|
|
|
214
|
+
// ../../.yarn/cache/@smithy-shared-ini-file-loader-npm-4.4.0-7068a922f9-a674622375.zip/node_modules/@smithy/shared-ini-file-loader/dist-es/externalDataInterceptor.js
|
|
215
|
+
var externalDataInterceptor = {
|
|
216
|
+
getFileRecord() {
|
|
217
|
+
return fileIntercept;
|
|
218
|
+
},
|
|
219
|
+
interceptFile(path, contents) {
|
|
220
|
+
fileIntercept[path] = Promise.resolve(contents);
|
|
221
|
+
},
|
|
222
|
+
getTokenRecord() {
|
|
223
|
+
return tokenIntercept;
|
|
224
|
+
},
|
|
225
|
+
interceptToken(id, contents) {
|
|
226
|
+
tokenIntercept[id] = contents;
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
|
|
200
230
|
export {
|
|
201
231
|
ENV_PROFILE,
|
|
202
232
|
getProfileName,
|
|
203
233
|
getSSOTokenFilepath,
|
|
204
234
|
getSSOTokenFromFile,
|
|
205
235
|
CONFIG_PREFIX_SEPARATOR,
|
|
236
|
+
readFile,
|
|
206
237
|
loadSharedConfigFiles,
|
|
207
238
|
loadSsoSessionData,
|
|
208
|
-
parseKnownFiles
|
|
239
|
+
parseKnownFiles,
|
|
240
|
+
externalDataInterceptor
|
|
209
241
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
setCredentialFeature
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3OYGHA4S.js";
|
|
4
4
|
import {
|
|
5
5
|
CredentialsProviderError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-S4LJWEXU.js";
|
|
7
7
|
|
|
8
|
-
// ../../.yarn/cache/@aws-sdk-credential-provider-env-npm-3.
|
|
8
|
+
// ../../.yarn/cache/@aws-sdk-credential-provider-env-npm-3.940.0-e96f3be404-538ede72ad.zip/node_modules/@aws-sdk/credential-provider-env/dist-es/fromEnv.js
|
|
9
9
|
var ENV_KEY = "AWS_ACCESS_KEY_ID";
|
|
10
10
|
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
|
11
11
|
var ENV_SESSION = "AWS_SESSION_TOKEN";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// ../../.yarn/cache/@smithy-is-array-buffer-npm-4.2.0-16dfb7a864-8e3e21cff5.zip/node_modules/@smithy/is-array-buffer/dist-es/index.js
|
|
2
|
+
var isArrayBuffer = (arg) => typeof ArrayBuffer === "function" && arg instanceof ArrayBuffer || Object.prototype.toString.call(arg) === "[object ArrayBuffer]";
|
|
3
|
+
|
|
4
|
+
// ../../.yarn/cache/@smithy-util-buffer-from-npm-4.2.0-517a835222-4842d56072.zip/node_modules/@smithy/util-buffer-from/dist-es/index.js
|
|
5
|
+
import { Buffer } from "buffer";
|
|
6
|
+
var fromArrayBuffer = (input, offset = 0, length = input.byteLength - offset) => {
|
|
7
|
+
if (!isArrayBuffer(input)) {
|
|
8
|
+
throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof input} (${input})`);
|
|
9
|
+
}
|
|
10
|
+
return Buffer.from(input, offset, length);
|
|
11
|
+
};
|
|
12
|
+
var fromString = (input, encoding) => {
|
|
13
|
+
if (typeof input !== "string") {
|
|
14
|
+
throw new TypeError(`The "input" argument must be of type string. Received type ${typeof input} (${input})`);
|
|
15
|
+
}
|
|
16
|
+
return encoding ? Buffer.from(input, encoding) : Buffer.from(input);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// ../../.yarn/cache/@smithy-util-utf8-npm-4.2.0-129dbf931f-689a1f2295.zip/node_modules/@smithy/util-utf8/dist-es/fromUtf8.js
|
|
20
|
+
var fromUtf8 = (input) => {
|
|
21
|
+
const buf = fromString(input, "utf8");
|
|
22
|
+
return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength / Uint8Array.BYTES_PER_ELEMENT);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
// ../../.yarn/cache/@smithy-util-utf8-npm-4.2.0-129dbf931f-689a1f2295.zip/node_modules/@smithy/util-utf8/dist-es/toUtf8.js
|
|
26
|
+
var toUtf8 = (input) => {
|
|
27
|
+
if (typeof input === "string") {
|
|
28
|
+
return input;
|
|
29
|
+
}
|
|
30
|
+
if (typeof input !== "object" || typeof input.byteOffset !== "number" || typeof input.byteLength !== "number") {
|
|
31
|
+
throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");
|
|
32
|
+
}
|
|
33
|
+
return fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString("utf8");
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export {
|
|
37
|
+
isArrayBuffer,
|
|
38
|
+
fromArrayBuffer,
|
|
39
|
+
fromString,
|
|
40
|
+
fromUtf8,
|
|
41
|
+
toUtf8
|
|
42
|
+
};
|