dynamic-mui 2.2.0 → 2.3.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.
- package/README.md +142 -5
- package/dist/accordion-DqBdGRim.mjs +23 -0
- package/dist/accordion-lvbD_BpX.js +1 -0
- package/dist/addressfield-CGX3UppE.mjs +152 -0
- package/dist/addressfield-DDG15fqJ.js +1 -0
- package/dist/asyncautocomplete-BAfBR9P7.mjs +89 -0
- package/dist/asyncautocomplete-w9q_1DWt.js +1 -0
- package/dist/bar-BzO7tvYJ.mjs +20 -0
- package/dist/bar-DEVxyUVS.js +1 -0
- package/dist/cascadeselect-C3QVfoig.mjs +64 -0
- package/dist/cascadeselect-DzbhK9en.js +1 -0
- package/dist/colorpicker-5qmEq7ZI.js +1 -0
- package/dist/colorpicker-DhNZulJY.mjs +98 -0
- package/dist/components/DynamicComponent.d.ts +2 -0
- package/dist/components/FormGenerator.d.ts +99 -10
- package/dist/components/controls/index.d.ts +45 -79
- package/dist/consentfield-B7Rm8d3U.js +1 -0
- package/dist/consentfield-CBQUR4J5.mjs +78 -0
- package/dist/datatable-BIQznwQe.mjs +20 -0
- package/dist/datatable-BWlcUP0M.js +1 -0
- package/dist/dynamic-mui.cjs +1 -0
- package/dist/dynamic-mui.mjs +32 -0
- package/dist/editabletable-DCoRmsEO.js +1 -0
- package/dist/editabletable-DRlBV8lk.mjs +126 -0
- package/dist/fileupload-ByBv1UjT.mjs +172 -0
- package/dist/fileupload-Cze3Oc_2.js +1 -0
- package/dist/formrepeater-BBkKGLFJ.mjs +71 -0
- package/dist/formrepeater-BxJzXoHx.js +1 -0
- package/dist/formwizard-BDZE1UDD.js +1 -0
- package/dist/formwizard-D2u1bMvK.mjs +83 -0
- package/dist/geofield-8WTeZk0Z.mjs +104 -0
- package/dist/geofield-Bw3p4NLJ.js +1 -0
- package/dist/group-B2mSylHd.mjs +23 -0
- package/dist/group-BlfO3ZZf.js +1 -0
- package/dist/imagelist-Bn9QhIv7.js +1 -0
- package/dist/imagelist-rqmJajHt.mjs +18 -0
- package/dist/index-CddjLTWF.mjs +12499 -0
- package/dist/index-D08GIfqF.js +43 -0
- package/dist/index.d.ts +9 -1
- package/dist/intlphone-B_Xn98pU.js +1 -0
- package/dist/intlphone-DtQZ12xk.mjs +140 -0
- package/dist/keyvaluefield-B_1NeGuP.mjs +125 -0
- package/dist/keyvaluefield-DyKCGd32.js +1 -0
- package/dist/line-B-DwR1hm.mjs +20 -0
- package/dist/line-BkymZu31.js +1 -0
- package/dist/lineitemlist-DGo8UOZC.js +1 -0
- package/dist/lineitemlist-vGKzJlQx.mjs +166 -0
- package/dist/list-7uNWrepS.mjs +20 -0
- package/dist/list-C0FgmtQw.js +1 -0
- package/dist/locationfield-CeUgxLkQ.mjs +119 -0
- package/dist/locationfield-Duyw1ZEz.js +1 -0
- package/dist/markdowneditor-B1y-hfny.mjs +90 -0
- package/dist/markdowneditor-Db0Un1_Z.js +2 -0
- package/dist/matrixfield-C7Sc-YpI.mjs +117 -0
- package/dist/matrixfield-CckODuPn.js +1 -0
- package/dist/mixChart-C3o184UT.js +1 -0
- package/dist/mixChart-ISf3Kbr-.mjs +75 -0
- package/dist/multitextbox-BYazIAeG.js +1 -0
- package/dist/multitextbox-ide2lvJ6.mjs +78 -0
- package/dist/npsscale-C2e88qk_.js +1 -0
- package/dist/npsscale-lndz7GEq.mjs +87 -0
- package/dist/numberstepper-DitbcvV9.mjs +128 -0
- package/dist/numberstepper-DyRjQM_K.js +1 -0
- package/dist/pie-CJSL8Sv5.js +1 -0
- package/dist/pie-CL29dlh5.mjs +20 -0
- package/dist/richtexteditor-CVg-MnKp.js +1 -0
- package/dist/richtexteditor-DsC1XC7h.mjs +141 -0
- package/dist/s3Upload-B0JeoLkS.js +1 -0
- package/dist/s3Upload-dpioZ2c8.mjs +51 -0
- package/dist/signature-14OrZriO.mjs +1225 -0
- package/dist/signature-D582X6tB.js +2 -0
- package/dist/stepper-B-FpcZvT.js +1 -0
- package/dist/stepper-CDfEy_C6.mjs +140 -0
- package/dist/summaryfield-B08ZmVHh.js +1 -0
- package/dist/summaryfield-CTpPlZBG.mjs +96 -0
- package/dist/tabs-BIliqFOs.js +1 -0
- package/dist/tabs-DDeJCFt8.mjs +39 -0
- package/dist/tagsinput-D-q6rRZS.mjs +58 -0
- package/dist/tagsinput-qh_lhdFb.js +1 -0
- package/dist/util/registry.d.ts +29 -0
- package/dist/util/resolvers.d.ts +45 -0
- package/dist/util/useFormEngine.d.ts +74 -0
- package/dist/util/validateSchema.d.ts +23 -0
- package/dist/v4-BysszJq8.mjs +30 -0
- package/dist/v4-CqdK_b8Y.js +1 -0
- package/package.json +36 -11
- package/dist/AxisSharedComponents-BbsKw1BT.js +0 -3
- package/dist/AxisSharedComponents-xLtpOLH_.mjs +0 -605
- package/dist/ChartsAxis-CANvBdY9.mjs +0 -47
- package/dist/ChartsAxis-EZ7m_KrU.js +0 -1
- package/dist/ChartsGrid-BCRTvNTr.js +0 -3
- package/dist/ChartsGrid-C_HT7qpL.mjs +0 -381
- package/dist/ChartsWrapper-CM7EDyAK.js +0 -5
- package/dist/ChartsWrapper-CO5_Z6BD.mjs +0 -1878
- package/dist/ChartsXAxis-CPmuCRhq.mjs +0 -487
- package/dist/ChartsXAxis-DFFY1sPg.js +0 -3
- package/dist/ChartsYAxis-DLUMr9vG.mjs +0 -392
- package/dist/ChartsYAxis-fpevi1sP.js +0 -1
- package/dist/XmlShapeDeserializer-3yQdm0b0.mjs +0 -237
- package/dist/XmlShapeDeserializer-XKJAoqLc.js +0 -1
- package/dist/clampAngle-BvZjnf53.mjs +0 -11
- package/dist/clampAngle-DpAsDoeT.js +0 -1
- package/dist/createSelector-B-9FwV16.mjs +0 -430
- package/dist/createSelector-f0oqn8Lr.js +0 -7
- package/dist/date-utils-CFUUt6NL.js +0 -4
- package/dist/date-utils-pGzaKb0p.mjs +0 -477
- package/dist/dynamic-mui.cjs.js +0 -1
- package/dist/dynamic-mui.es.js +0 -22
- package/dist/index--8Zky9Oh.js +0 -299
- package/dist/index-6WTs1Xy_.js +0 -1
- package/dist/index-B1R1akM2.js +0 -1
- package/dist/index-BW8_rRff.js +0 -7
- package/dist/index-BXFVK_GX.js +0 -1
- package/dist/index-B_KNUTjy.js +0 -1
- package/dist/index-BhaKvHkU.mjs +0 -62051
- package/dist/index-Bif92ima.js +0 -1
- package/dist/index-BnZOu8CL.js +0 -1
- package/dist/index-CDxpgRlR.mjs +0 -7
- package/dist/index-CThMfvtJ.mjs +0 -2555
- package/dist/index-CVqLvm8B.js +0 -1
- package/dist/index-CodJBIn6.mjs +0 -1665
- package/dist/index-Cr6Wp_S-.mjs +0 -3141
- package/dist/index-CslPwsrf.mjs +0 -4
- package/dist/index-CuV0MQzZ.mjs +0 -1173
- package/dist/index-DA0XouZs.mjs +0 -153
- package/dist/index-DKS5Sz9e.js +0 -14
- package/dist/index-DSkYYZuW.mjs +0 -4
- package/dist/index-DU78_FiA.js +0 -1
- package/dist/index-D_mYhgJ0.js +0 -10
- package/dist/index-DcWfyXJp.mjs +0 -92
- package/dist/index-Dlimbnxj.mjs +0 -2965
- package/dist/index-MllWgTJ5.mjs +0 -9372
- package/dist/index-in5z9hUb.js +0 -133
- package/dist/index-qUW7FnZ-.mjs +0 -20540
- package/dist/index.browser-BSu11T_q.mjs +0 -363
- package/dist/index.browser-By7-GABP.js +0 -4
- package/dist/isDeepEqual-BHfPvf9U.mjs +0 -393
- package/dist/isDeepEqual-CqxZGVRk.js +0 -1
- package/dist/loadCognitoIdentity-DtYTy-DW.js +0 -1
- package/dist/loadCognitoIdentity-DzdR91GB.mjs +0 -872
- package/dist/loadSts-Cic6UToN.mjs +0 -593
- package/dist/loadSts-csbFP6zX.js +0 -1
- package/dist/main.d.ts +0 -1
- package/dist/noAuth-B8ui2kBg.mjs +0 -71
- package/dist/noAuth-JPA2o4dt.js +0 -1
- package/dist/playground/AIContext.d.ts +0 -18
- package/dist/playground/AIPanel.d.ts +0 -10
- package/dist/playground/Builder.d.ts +0 -1
- package/dist/playground/Canvas.d.ts +0 -9
- package/dist/playground/DemoGallery.d.ts +0 -6
- package/dist/playground/PropertiesEditor.d.ts +0 -10
- package/dist/playground/Sidebar.d.ts +0 -9
- package/dist/playground/demoForms.d.ts +0 -3
- package/dist/playground/demoRecipes.d.ts +0 -15
- package/dist/playground/demoVariants.d.ts +0 -11
- package/dist/playground/documentation.d.ts +0 -6
- package/dist/playground/templates.d.ts +0 -7
- package/dist/playground/testData.d.ts +0 -2
- package/dist/test/setup.d.ts +0 -0
- package/dist/theme/theme.d.ts +0 -6
- package/dist/useAxis-DSbfEtO7.js +0 -3
- package/dist/useAxis-SiNBMMWq.mjs +0 -3010
- package/dist/useChartContainerProps-Bl3hO-r1.mjs +0 -5418
- package/dist/useChartContainerProps-C_C_PZoi.js +0 -12
- package/dist/useItemHighlightedGetter-9CIwqsGj.js +0 -1
- package/dist/useItemHighlightedGetter-CTISrNdV.mjs +0 -88
|
@@ -1,363 +0,0 @@
|
|
|
1
|
-
import { H as v, s as O, p as P, F as R, n as N } from "./date-utils-pGzaKb0p.mjs";
|
|
2
|
-
class A extends Error {
|
|
3
|
-
name = "ProviderError";
|
|
4
|
-
tryNextLink;
|
|
5
|
-
constructor(t, o = !0) {
|
|
6
|
-
let n, r = !0;
|
|
7
|
-
typeof o == "boolean" ? (n = void 0, r = o) : o != null && typeof o == "object" && (n = o.logger, r = o.tryNextLink ?? !0), super(t), this.tryNextLink = r, Object.setPrototypeOf(this, A.prototype), n?.debug?.(`@smithy/property-provider ${r ? "->" : "(!)"} ${t}`);
|
|
8
|
-
}
|
|
9
|
-
static from(t, o = !0) {
|
|
10
|
-
return Object.assign(new this(t.message, o), t);
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
class c extends A {
|
|
14
|
-
name = "CredentialsProviderError";
|
|
15
|
-
constructor(t, o = !0) {
|
|
16
|
-
super(t, o), Object.setPrototypeOf(this, c.prototype);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
function T(e) {
|
|
20
|
-
return Promise.all(Object.keys(e).reduce((t, o) => {
|
|
21
|
-
const n = e[o];
|
|
22
|
-
return typeof n == "string" ? t.push([o, n]) : t.push(n().then((r) => [o, r])), t;
|
|
23
|
-
}, [])).then((t) => t.reduce((o, [n, r]) => (o[n] = r, o), {}));
|
|
24
|
-
}
|
|
25
|
-
function k(e) {
|
|
26
|
-
return async (t) => {
|
|
27
|
-
e.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
|
|
28
|
-
const { GetCredentialsForIdentityCommand: o, CognitoIdentityClient: n } = await import("./loadCognitoIdentity-DzdR91GB.mjs"), r = (u) => e.clientConfig?.[u] ?? e.parentClientConfig?.[u] ?? t?.callerClientConfig?.[u], { Credentials: { AccessKeyId: s = E(e.logger), Expiration: i, SecretKey: a = x(e.logger), SessionToken: d } = K(e.logger) } = await (e.client ?? new n(Object.assign({}, e.clientConfig ?? {}, {
|
|
29
|
-
region: r("region"),
|
|
30
|
-
profile: r("profile"),
|
|
31
|
-
userAgentAppId: r("userAgentAppId")
|
|
32
|
-
}))).send(new o({
|
|
33
|
-
CustomRoleArn: e.customRoleArn,
|
|
34
|
-
IdentityId: e.identityId,
|
|
35
|
-
Logins: e.logins ? await T(e.logins) : void 0
|
|
36
|
-
}));
|
|
37
|
-
return {
|
|
38
|
-
identityId: e.identityId,
|
|
39
|
-
accessKeyId: s,
|
|
40
|
-
secretAccessKey: a,
|
|
41
|
-
sessionToken: d,
|
|
42
|
-
expiration: i
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
function E(e) {
|
|
47
|
-
throw new c("Response from Amazon Cognito contained no access key ID", { logger: e });
|
|
48
|
-
}
|
|
49
|
-
function K(e) {
|
|
50
|
-
throw new c("Response from Amazon Cognito contained no credentials", { logger: e });
|
|
51
|
-
}
|
|
52
|
-
function x(e) {
|
|
53
|
-
throw new c("Response from Amazon Cognito contained no secret key", { logger: e });
|
|
54
|
-
}
|
|
55
|
-
const I = "IdentityIds";
|
|
56
|
-
class H {
|
|
57
|
-
dbName;
|
|
58
|
-
constructor(t = "aws:cognito-identity-ids") {
|
|
59
|
-
this.dbName = t;
|
|
60
|
-
}
|
|
61
|
-
getItem(t) {
|
|
62
|
-
return this.withObjectStore("readonly", (o) => {
|
|
63
|
-
const n = o.get(t);
|
|
64
|
-
return new Promise((r) => {
|
|
65
|
-
n.onerror = () => r(null), n.onsuccess = () => r(n.result ? n.result.value : null);
|
|
66
|
-
});
|
|
67
|
-
}).catch(() => null);
|
|
68
|
-
}
|
|
69
|
-
removeItem(t) {
|
|
70
|
-
return this.withObjectStore("readwrite", (o) => {
|
|
71
|
-
const n = o.delete(t);
|
|
72
|
-
return new Promise((r, s) => {
|
|
73
|
-
n.onerror = () => s(n.error), n.onsuccess = () => r();
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
setItem(t, o) {
|
|
78
|
-
return this.withObjectStore("readwrite", (n) => {
|
|
79
|
-
const r = n.put({ id: t, value: o });
|
|
80
|
-
return new Promise((s, i) => {
|
|
81
|
-
r.onerror = () => i(r.error), r.onsuccess = () => s();
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
getDb() {
|
|
86
|
-
const t = self.indexedDB.open(this.dbName, 1);
|
|
87
|
-
return new Promise((o, n) => {
|
|
88
|
-
t.onsuccess = () => {
|
|
89
|
-
o(t.result);
|
|
90
|
-
}, t.onerror = () => {
|
|
91
|
-
n(t.error);
|
|
92
|
-
}, t.onblocked = () => {
|
|
93
|
-
n(new Error("Unable to access DB"));
|
|
94
|
-
}, t.onupgradeneeded = () => {
|
|
95
|
-
const r = t.result;
|
|
96
|
-
r.onerror = () => {
|
|
97
|
-
n(new Error("Failed to create object store"));
|
|
98
|
-
}, r.createObjectStore(I, { keyPath: "id" });
|
|
99
|
-
};
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
withObjectStore(t, o) {
|
|
103
|
-
return this.getDb().then((n) => {
|
|
104
|
-
const r = n.transaction(I, t);
|
|
105
|
-
return r.oncomplete = () => n.close(), new Promise((s, i) => {
|
|
106
|
-
r.onerror = () => i(r.error), s(o(r.objectStore(I)));
|
|
107
|
-
}).catch((s) => {
|
|
108
|
-
throw n.close(), s;
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
class j {
|
|
114
|
-
store;
|
|
115
|
-
constructor(t = {}) {
|
|
116
|
-
this.store = t;
|
|
117
|
-
}
|
|
118
|
-
getItem(t) {
|
|
119
|
-
return t in this.store ? this.store[t] : null;
|
|
120
|
-
}
|
|
121
|
-
removeItem(t) {
|
|
122
|
-
delete this.store[t];
|
|
123
|
-
}
|
|
124
|
-
setItem(t, o) {
|
|
125
|
-
this.store[t] = o;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
const q = new j();
|
|
129
|
-
function D() {
|
|
130
|
-
return typeof self == "object" && self.indexedDB ? new H() : typeof window == "object" && window.localStorage ? window.localStorage : q;
|
|
131
|
-
}
|
|
132
|
-
function $({ accountId: e, cache: t = D(), client: o, clientConfig: n, customRoleArn: r, identityPoolId: s, logins: i, userIdentifier: a = !i || Object.keys(i).length === 0 ? "ANONYMOUS" : void 0, logger: d, parentClientConfig: u }) {
|
|
133
|
-
d?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");
|
|
134
|
-
const f = a ? `aws:cognito-identity-credentials:${s}:${a}` : void 0;
|
|
135
|
-
let l = async (g) => {
|
|
136
|
-
const { GetIdCommand: m, CognitoIdentityClient: y } = await import("./loadCognitoIdentity-DzdR91GB.mjs"), w = (h) => n?.[h] ?? u?.[h] ?? g?.callerClientConfig?.[h], C = o ?? new y(Object.assign({}, n ?? {}, {
|
|
137
|
-
region: w("region"),
|
|
138
|
-
profile: w("profile"),
|
|
139
|
-
userAgentAppId: w("userAgentAppId")
|
|
140
|
-
}));
|
|
141
|
-
let p = f && await t.getItem(f);
|
|
142
|
-
if (!p) {
|
|
143
|
-
const { IdentityId: h = L(d) } = await C.send(new m({
|
|
144
|
-
AccountId: e,
|
|
145
|
-
IdentityPoolId: s,
|
|
146
|
-
Logins: i ? await T(i) : void 0
|
|
147
|
-
}));
|
|
148
|
-
p = h, f && Promise.resolve(t.setItem(f, p)).catch(() => {
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
return l = k({
|
|
152
|
-
client: C,
|
|
153
|
-
customRoleArn: r,
|
|
154
|
-
logins: i,
|
|
155
|
-
identityId: p
|
|
156
|
-
}), l(g);
|
|
157
|
-
};
|
|
158
|
-
return (g) => l(g).catch(async (m) => {
|
|
159
|
-
throw f && Promise.resolve(t.removeItem(f)).catch(() => {
|
|
160
|
-
}), m;
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
function L(e) {
|
|
164
|
-
throw new c("Response from Amazon Cognito contained no identity ID", { logger: e });
|
|
165
|
-
}
|
|
166
|
-
const Q = (e) => k({
|
|
167
|
-
...e
|
|
168
|
-
}), V = (e) => $({
|
|
169
|
-
...e
|
|
170
|
-
}), M = "169.254.170.2", _ = "169.254.170.23", W = "[fd00:ec2::23]", z = (e, t) => {
|
|
171
|
-
if (e.protocol !== "https:" && !(e.hostname === M || e.hostname === _ || e.hostname === W)) {
|
|
172
|
-
if (e.hostname.includes("[")) {
|
|
173
|
-
if (e.hostname === "[::1]" || e.hostname === "[0000:0000:0000:0000:0000:0000:0000:0001]")
|
|
174
|
-
return;
|
|
175
|
-
} else {
|
|
176
|
-
if (e.hostname === "localhost")
|
|
177
|
-
return;
|
|
178
|
-
const o = e.hostname.split("."), n = (r) => {
|
|
179
|
-
const s = parseInt(r, 10);
|
|
180
|
-
return 0 <= s && s <= 255;
|
|
181
|
-
};
|
|
182
|
-
if (o[0] === "127" && n(o[1]) && n(o[2]) && n(o[3]) && o.length === 4)
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
throw new c(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
186
|
-
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
187
|
-
- ECS container host 169.254.170.2
|
|
188
|
-
- EKS container host 169.254.170.23 or [fd00:ec2::23]`, { logger: t });
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
function U(e) {
|
|
192
|
-
return new v({
|
|
193
|
-
protocol: e.protocol,
|
|
194
|
-
hostname: e.hostname,
|
|
195
|
-
port: Number(e.port),
|
|
196
|
-
path: e.pathname,
|
|
197
|
-
query: Array.from(e.searchParams.entries()).reduce((t, [o, n]) => (t[o] = n, t), {}),
|
|
198
|
-
fragment: e.hash
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
async function F(e, t) {
|
|
202
|
-
const n = await O(e.body).transformToString();
|
|
203
|
-
if (e.statusCode === 200) {
|
|
204
|
-
const r = JSON.parse(n);
|
|
205
|
-
if (typeof r.AccessKeyId != "string" || typeof r.SecretAccessKey != "string" || typeof r.Token != "string" || typeof r.Expiration != "string")
|
|
206
|
-
throw new c("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }", { logger: t });
|
|
207
|
-
return {
|
|
208
|
-
accessKeyId: r.AccessKeyId,
|
|
209
|
-
secretAccessKey: r.SecretAccessKey,
|
|
210
|
-
sessionToken: r.Token,
|
|
211
|
-
expiration: P(r.Expiration)
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
if (e.statusCode >= 400 && e.statusCode < 500) {
|
|
215
|
-
let r = {};
|
|
216
|
-
try {
|
|
217
|
-
r = JSON.parse(n);
|
|
218
|
-
} catch {
|
|
219
|
-
}
|
|
220
|
-
throw Object.assign(new c(`Server responded with status: ${e.statusCode}`, { logger: t }), {
|
|
221
|
-
Code: r.Code,
|
|
222
|
-
Message: r.Message
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
throw new c(`Server responded with status: ${e.statusCode}`, { logger: t });
|
|
226
|
-
}
|
|
227
|
-
const B = (e, t, o) => async () => {
|
|
228
|
-
for (let n = 0; n < t; ++n)
|
|
229
|
-
try {
|
|
230
|
-
return await e();
|
|
231
|
-
} catch {
|
|
232
|
-
await new Promise((s) => setTimeout(s, o));
|
|
233
|
-
}
|
|
234
|
-
return await e();
|
|
235
|
-
}, X = (e = {}) => {
|
|
236
|
-
e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");
|
|
237
|
-
let t;
|
|
238
|
-
const o = e.credentialsFullUri;
|
|
239
|
-
if (o)
|
|
240
|
-
t = o;
|
|
241
|
-
else
|
|
242
|
-
throw new c("No HTTP credential provider host provided.", { logger: e.logger });
|
|
243
|
-
const n = new URL(t);
|
|
244
|
-
z(n, e.logger);
|
|
245
|
-
const r = new R();
|
|
246
|
-
return B(async () => {
|
|
247
|
-
const s = U(n);
|
|
248
|
-
e.authorizationToken && (s.headers.Authorization = e.authorizationToken);
|
|
249
|
-
const i = await r.handle(s);
|
|
250
|
-
return F(i.response);
|
|
251
|
-
}, e.maxRetries ?? 3, e.timeout ?? 1e3);
|
|
252
|
-
}, G = "us-east-1", Z = (e, t, o) => {
|
|
253
|
-
let n;
|
|
254
|
-
return async (r = {}) => {
|
|
255
|
-
const { callerClientConfig: s } = r, i = e.clientConfig?.profile ?? s?.profile, a = e.logger ?? s?.logger;
|
|
256
|
-
a?.debug("@aws-sdk/credential-providers - fromTemporaryCredentials (STS)");
|
|
257
|
-
const d = { ...e.params, RoleSessionName: e.params.RoleSessionName ?? "aws-sdk-js-" + Date.now() };
|
|
258
|
-
if (d?.SerialNumber) {
|
|
259
|
-
if (!e.mfaCodeProvider)
|
|
260
|
-
throw new c("Temporary credential requires multi-factor authentication, but no MFA code callback was provided.", {
|
|
261
|
-
tryNextLink: !1,
|
|
262
|
-
logger: a
|
|
263
|
-
});
|
|
264
|
-
d.TokenCode = await e.mfaCodeProvider(d?.SerialNumber);
|
|
265
|
-
}
|
|
266
|
-
const { AssumeRoleCommand: u, STSClient: f } = await import("./loadSts-Cic6UToN.mjs").then((g) => g.w);
|
|
267
|
-
if (!n) {
|
|
268
|
-
const g = typeof t == "function" ? t() : void 0, m = [
|
|
269
|
-
e.masterCredentials,
|
|
270
|
-
e.clientConfig?.credentials,
|
|
271
|
-
void s?.credentials,
|
|
272
|
-
s?.credentialDefaultProvider?.(),
|
|
273
|
-
g
|
|
274
|
-
];
|
|
275
|
-
let y = "STS client default credentials";
|
|
276
|
-
if (m[0])
|
|
277
|
-
y = "options.masterCredentials";
|
|
278
|
-
else if (m[1])
|
|
279
|
-
y = "options.clientConfig.credentials";
|
|
280
|
-
else {
|
|
281
|
-
if (m[2])
|
|
282
|
-
throw y = "caller client's credentials", new Error("fromTemporaryCredentials recursion in callerClientConfig.credentials");
|
|
283
|
-
m[3] ? y = "caller client's credentialDefaultProvider" : m[4] && (y = "AWS SDK default credentials");
|
|
284
|
-
}
|
|
285
|
-
const w = [
|
|
286
|
-
e.clientConfig?.region,
|
|
287
|
-
s?.region,
|
|
288
|
-
await o?.({
|
|
289
|
-
profile: i
|
|
290
|
-
}),
|
|
291
|
-
G
|
|
292
|
-
];
|
|
293
|
-
let C = "default partition's default region";
|
|
294
|
-
w[0] ? C = "options.clientConfig.region" : w[1] ? C = "caller client's region" : w[2] && (C = "file or env region");
|
|
295
|
-
const p = [
|
|
296
|
-
b(e.clientConfig?.requestHandler),
|
|
297
|
-
b(s?.requestHandler)
|
|
298
|
-
];
|
|
299
|
-
let h = "STS default requestHandler";
|
|
300
|
-
p[0] ? h = "options.clientConfig.requestHandler" : p[1] && (h = "caller client's requestHandler"), a?.debug?.(`@aws-sdk/credential-providers - fromTemporaryCredentials STS client init with ${C}=${await N(S(w))()}, ${y}, ${h}.`), n = new f({
|
|
301
|
-
userAgentAppId: s?.userAgentAppId,
|
|
302
|
-
...e.clientConfig,
|
|
303
|
-
credentials: S(m),
|
|
304
|
-
logger: a,
|
|
305
|
-
profile: i,
|
|
306
|
-
region: S(w),
|
|
307
|
-
requestHandler: S(p)
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
if (e.clientPlugins)
|
|
311
|
-
for (const g of e.clientPlugins)
|
|
312
|
-
n.middlewareStack.use(g);
|
|
313
|
-
const { Credentials: l } = await n.send(new u(d));
|
|
314
|
-
if (!l || !l.AccessKeyId || !l.SecretAccessKey)
|
|
315
|
-
throw new c(`Invalid response from STS.assumeRole call with role ${d.RoleArn}`, {
|
|
316
|
-
logger: a
|
|
317
|
-
});
|
|
318
|
-
return {
|
|
319
|
-
accessKeyId: l.AccessKeyId,
|
|
320
|
-
secretAccessKey: l.SecretAccessKey,
|
|
321
|
-
sessionToken: l.SessionToken,
|
|
322
|
-
expiration: l.Expiration,
|
|
323
|
-
credentialScope: l.CredentialScope
|
|
324
|
-
};
|
|
325
|
-
};
|
|
326
|
-
}, b = (e) => e?.metadata?.handlerProtocol === "h2" ? void 0 : e, S = (e) => {
|
|
327
|
-
for (const t of e)
|
|
328
|
-
if (t !== void 0)
|
|
329
|
-
return t;
|
|
330
|
-
}, J = (e) => async (t) => {
|
|
331
|
-
e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");
|
|
332
|
-
const { roleArn: o, roleSessionName: n, webIdentityToken: r, providerId: s, policyArns: i, policy: a, durationSeconds: d } = e;
|
|
333
|
-
let { roleAssumerWithWebIdentity: u } = e;
|
|
334
|
-
if (!u) {
|
|
335
|
-
const { getDefaultRoleAssumerWithWebIdentity: f } = await import("./index-DcWfyXJp.mjs");
|
|
336
|
-
u = f({
|
|
337
|
-
...e.clientConfig,
|
|
338
|
-
credentialProviderLogger: e.logger,
|
|
339
|
-
parentClientConfig: {
|
|
340
|
-
...t?.callerClientConfig,
|
|
341
|
-
...e.parentClientConfig
|
|
342
|
-
}
|
|
343
|
-
}, e.clientPlugins);
|
|
344
|
-
}
|
|
345
|
-
return u({
|
|
346
|
-
RoleArn: o,
|
|
347
|
-
RoleSessionName: n ?? `aws-sdk-js-session-${Date.now()}`,
|
|
348
|
-
WebIdentityToken: r,
|
|
349
|
-
ProviderId: s,
|
|
350
|
-
PolicyArns: i,
|
|
351
|
-
Policy: a,
|
|
352
|
-
DurationSeconds: d
|
|
353
|
-
});
|
|
354
|
-
}, ee = (e) => J({
|
|
355
|
-
...e
|
|
356
|
-
});
|
|
357
|
-
export {
|
|
358
|
-
Q as fromCognitoIdentity,
|
|
359
|
-
V as fromCognitoIdentityPool,
|
|
360
|
-
X as fromHttp,
|
|
361
|
-
Z as fromTemporaryCredentials,
|
|
362
|
-
ee as fromWebToken
|
|
363
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const S=require("./date-utils-CFUUt6NL.js");class A extends Error{name="ProviderError";tryNextLink;constructor(t,o=!0){let n,r=!0;typeof o=="boolean"?(n=void 0,r=o):o!=null&&typeof o=="object"&&(n=o.logger,r=o.tryNextLink??!0),super(t),this.tryNextLink=r,Object.setPrototypeOf(this,A.prototype),n?.debug?.(`@smithy/property-provider ${r?"->":"(!)"} ${t}`)}static from(t,o=!0){return Object.assign(new this(t.message,o),t)}}class c extends A{name="CredentialsProviderError";constructor(t,o=!0){super(t,o),Object.setPrototypeOf(this,c.prototype)}}function k(e){return Promise.all(Object.keys(e).reduce((t,o)=>{const n=e[o];return typeof n=="string"?t.push([o,n]):t.push(n().then(r=>[o,r])),t},[])).then(t=>t.reduce((o,[n,r])=>(o[n]=r,o),{}))}function v(e){return async t=>{e.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const{GetCredentialsForIdentityCommand:o,CognitoIdentityClient:n}=await Promise.resolve().then(()=>require("./loadCognitoIdentity-DtYTy-DW.js")),r=u=>e.clientConfig?.[u]??e.parentClientConfig?.[u]??t?.callerClientConfig?.[u],{Credentials:{AccessKeyId:s=P(e.logger),Expiration:i,SecretKey:a=R(e.logger),SessionToken:l}=O(e.logger)}=await(e.client??new n(Object.assign({},e.clientConfig??{},{region:r("region"),profile:r("profile"),userAgentAppId:r("userAgentAppId")}))).send(new o({CustomRoleArn:e.customRoleArn,IdentityId:e.identityId,Logins:e.logins?await k(e.logins):void 0}));return{identityId:e.identityId,accessKeyId:s,secretAccessKey:a,sessionToken:l,expiration:i}}}function P(e){throw new c("Response from Amazon Cognito contained no access key ID",{logger:e})}function O(e){throw new c("Response from Amazon Cognito contained no credentials",{logger:e})}function R(e){throw new c("Response from Amazon Cognito contained no secret key",{logger:e})}const b="IdentityIds";class N{dbName;constructor(t="aws:cognito-identity-ids"){this.dbName=t}getItem(t){return this.withObjectStore("readonly",o=>{const n=o.get(t);return new Promise(r=>{n.onerror=()=>r(null),n.onsuccess=()=>r(n.result?n.result.value:null)})}).catch(()=>null)}removeItem(t){return this.withObjectStore("readwrite",o=>{const n=o.delete(t);return new Promise((r,s)=>{n.onerror=()=>s(n.error),n.onsuccess=()=>r()})})}setItem(t,o){return this.withObjectStore("readwrite",n=>{const r=n.put({id:t,value:o});return new Promise((s,i)=>{r.onerror=()=>i(r.error),r.onsuccess=()=>s()})})}getDb(){const t=self.indexedDB.open(this.dbName,1);return new Promise((o,n)=>{t.onsuccess=()=>{o(t.result)},t.onerror=()=>{n(t.error)},t.onblocked=()=>{n(new Error("Unable to access DB"))},t.onupgradeneeded=()=>{const r=t.result;r.onerror=()=>{n(new Error("Failed to create object store"))},r.createObjectStore(b,{keyPath:"id"})}})}withObjectStore(t,o){return this.getDb().then(n=>{const r=n.transaction(b,t);return r.oncomplete=()=>n.close(),new Promise((s,i)=>{r.onerror=()=>i(r.error),s(o(r.objectStore(b)))}).catch(s=>{throw n.close(),s})})}}class E{store;constructor(t={}){this.store=t}getItem(t){return t in this.store?this.store[t]:null}removeItem(t){delete this.store[t]}setItem(t,o){this.store[t]=o}}const K=new E;function q(){return typeof self=="object"&&self.indexedDB?new N:typeof window=="object"&&window.localStorage?window.localStorage:K}function x({accountId:e,cache:t=q(),client:o,clientConfig:n,customRoleArn:r,identityPoolId:s,logins:i,userIdentifier:a=!i||Object.keys(i).length===0?"ANONYMOUS":void 0,logger:l,parentClientConfig:u}){l?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");const f=a?`aws:cognito-identity-credentials:${s}:${a}`:void 0;let d=async g=>{const{GetIdCommand:m,CognitoIdentityClient:y}=await Promise.resolve().then(()=>require("./loadCognitoIdentity-DtYTy-DW.js")),h=w=>n?.[w]??u?.[w]??g?.callerClientConfig?.[w],p=o??new y(Object.assign({},n??{},{region:h("region"),profile:h("profile"),userAgentAppId:h("userAgentAppId")}));let C=f&&await t.getItem(f);if(!C){const{IdentityId:w=H(l)}=await p.send(new m({AccountId:e,IdentityPoolId:s,Logins:i?await k(i):void 0}));C=w,f&&Promise.resolve(t.setItem(f,C)).catch(()=>{})}return d=v({client:p,customRoleArn:r,logins:i,identityId:C}),d(g)};return g=>d(g).catch(async m=>{throw f&&Promise.resolve(t.removeItem(f)).catch(()=>{}),m})}function H(e){throw new c("Response from Amazon Cognito contained no identity ID",{logger:e})}const j=e=>v({...e}),D=e=>x({...e}),$="169.254.170.2",M="169.254.170.23",L="[fd00:ec2::23]",W=(e,t)=>{if(e.protocol!=="https:"&&!(e.hostname===$||e.hostname===M||e.hostname===L)){if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;const o=e.hostname.split("."),n=r=>{const s=parseInt(r,10);return 0<=s&&s<=255};if(o[0]==="127"&&n(o[1])&&n(o[2])&&n(o[3])&&o.length===4)return}throw new c(`URL not accepted. It must either be HTTPS or match one of the following:
|
|
2
|
-
- loopback CIDR 127.0.0.0/8 or [::1/128]
|
|
3
|
-
- ECS container host 169.254.170.2
|
|
4
|
-
- EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:t})}};function _(e){return new S.HttpRequest({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((t,[o,n])=>(t[o]=n,t),{}),fragment:e.hash})}async function U(e,t){const n=await S.sdkStreamMixin(e.body).transformToString();if(e.statusCode===200){const r=JSON.parse(n);if(typeof r.AccessKeyId!="string"||typeof r.SecretAccessKey!="string"||typeof r.Token!="string"||typeof r.Expiration!="string")throw new c("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:t});return{accessKeyId:r.AccessKeyId,secretAccessKey:r.SecretAccessKey,sessionToken:r.Token,expiration:S.parseRfc3339DateTime(r.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let r={};try{r=JSON.parse(n)}catch{}throw Object.assign(new c(`Server responded with status: ${e.statusCode}`,{logger:t}),{Code:r.Code,Message:r.Message})}throw new c(`Server responded with status: ${e.statusCode}`,{logger:t})}const z=(e,t,o)=>async()=>{for(let n=0;n<t;++n)try{return await e()}catch{await new Promise(s=>setTimeout(s,o))}return await e()},F=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let t;const o=e.credentialsFullUri;if(o)t=o;else throw new c("No HTTP credential provider host provided.",{logger:e.logger});const n=new URL(t);W(n,e.logger);const r=new S.FetchHttpHandler;return z(async()=>{const s=_(n);e.authorizationToken&&(s.headers.Authorization=e.authorizationToken);const i=await r.handle(s);return U(i.response)},e.maxRetries??3,e.timeout??1e3)},B="us-east-1",G=(e,t,o)=>{let n;return async(r={})=>{const{callerClientConfig:s}=r,i=e.clientConfig?.profile??s?.profile,a=e.logger??s?.logger;a?.debug("@aws-sdk/credential-providers - fromTemporaryCredentials (STS)");const l={...e.params,RoleSessionName:e.params.RoleSessionName??"aws-sdk-js-"+Date.now()};if(l?.SerialNumber){if(!e.mfaCodeProvider)throw new c("Temporary credential requires multi-factor authentication, but no MFA code callback was provided.",{tryNextLink:!1,logger:a});l.TokenCode=await e.mfaCodeProvider(l?.SerialNumber)}const{AssumeRoleCommand:u,STSClient:f}=await Promise.resolve().then(()=>require("./loadSts-csbFP6zX.js")).then(g=>g.loadSts);if(!n){const g=typeof t=="function"?t():void 0,m=[e.masterCredentials,e.clientConfig?.credentials,void s?.credentials,s?.credentialDefaultProvider?.(),g];let y="STS client default credentials";if(m[0])y="options.masterCredentials";else if(m[1])y="options.clientConfig.credentials";else{if(m[2])throw y="caller client's credentials",new Error("fromTemporaryCredentials recursion in callerClientConfig.credentials");m[3]?y="caller client's credentialDefaultProvider":m[4]&&(y="AWS SDK default credentials")}const h=[e.clientConfig?.region,s?.region,await o?.({profile:i}),B];let p="default partition's default region";h[0]?p="options.clientConfig.region":h[1]?p="caller client's region":h[2]&&(p="file or env region");const C=[T(e.clientConfig?.requestHandler),T(s?.requestHandler)];let w="STS default requestHandler";C[0]?w="options.clientConfig.requestHandler":C[1]&&(w="caller client's requestHandler"),a?.debug?.(`@aws-sdk/credential-providers - fromTemporaryCredentials STS client init with ${p}=${await S.normalizeProvider(I(h))()}, ${y}, ${w}.`),n=new f({userAgentAppId:s?.userAgentAppId,...e.clientConfig,credentials:I(m),logger:a,profile:i,region:I(h),requestHandler:I(C)})}if(e.clientPlugins)for(const g of e.clientPlugins)n.middlewareStack.use(g);const{Credentials:d}=await n.send(new u(l));if(!d||!d.AccessKeyId||!d.SecretAccessKey)throw new c(`Invalid response from STS.assumeRole call with role ${l.RoleArn}`,{logger:a});return{accessKeyId:d.AccessKeyId,secretAccessKey:d.SecretAccessKey,sessionToken:d.SessionToken,expiration:d.Expiration,credentialScope:d.CredentialScope}}},T=e=>e?.metadata?.handlerProtocol==="h2"?void 0:e,I=e=>{for(const t of e)if(t!==void 0)return t},J=e=>async t=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:o,roleSessionName:n,webIdentityToken:r,providerId:s,policyArns:i,policy:a,durationSeconds:l}=e;let{roleAssumerWithWebIdentity:u}=e;if(!u){const{getDefaultRoleAssumerWithWebIdentity:f}=await Promise.resolve().then(()=>require("./index-CVqLvm8B.js"));u=f({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:{...t?.callerClientConfig,...e.parentClientConfig}},e.clientPlugins)}return u({RoleArn:o,RoleSessionName:n??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:r,ProviderId:s,PolicyArns:i,Policy:a,DurationSeconds:l})},Y=e=>J({...e});exports.fromCognitoIdentity=j;exports.fromCognitoIdentityPool=D;exports.fromHttp=F;exports.fromTemporaryCredentials=G;exports.fromWebToken=Y;
|