mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-03 06:05:04 +09:00
chore: Update dist
This commit is contained in:
+359
-322
@@ -8327,82 +8327,6 @@ var AwsRestXmlProtocol = class extends import_protocols6.HttpBindingProtocol {
|
|||||||
0 && (0);
|
0 && (0);
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 5606:
|
|
||||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/index.ts
|
|
||||||
var index_exports = {};
|
|
||||||
__export(index_exports, {
|
|
||||||
ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID,
|
|
||||||
ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
|
|
||||||
ENV_EXPIRATION: () => ENV_EXPIRATION,
|
|
||||||
ENV_KEY: () => ENV_KEY,
|
|
||||||
ENV_SECRET: () => ENV_SECRET,
|
|
||||||
ENV_SESSION: () => ENV_SESSION,
|
|
||||||
fromEnv: () => fromEnv
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(index_exports);
|
|
||||||
|
|
||||||
// src/fromEnv.ts
|
|
||||||
var import_client = __nccwpck_require__(5152);
|
|
||||||
var import_property_provider = __nccwpck_require__(1238);
|
|
||||||
var ENV_KEY = "AWS_ACCESS_KEY_ID";
|
|
||||||
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
|
||||||
var ENV_SESSION = "AWS_SESSION_TOKEN";
|
|
||||||
var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
|
|
||||||
var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
|
|
||||||
var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
|
|
||||||
var fromEnv = /* @__PURE__ */ __name((init) => async () => {
|
|
||||||
init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");
|
|
||||||
const accessKeyId = process.env[ENV_KEY];
|
|
||||||
const secretAccessKey = process.env[ENV_SECRET];
|
|
||||||
const sessionToken = process.env[ENV_SESSION];
|
|
||||||
const expiry = process.env[ENV_EXPIRATION];
|
|
||||||
const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
|
|
||||||
const accountId = process.env[ENV_ACCOUNT_ID];
|
|
||||||
if (accessKeyId && secretAccessKey) {
|
|
||||||
const credentials = {
|
|
||||||
accessKeyId,
|
|
||||||
secretAccessKey,
|
|
||||||
...sessionToken && { sessionToken },
|
|
||||||
...expiry && { expiration: new Date(expiry) },
|
|
||||||
...credentialScope && { credentialScope },
|
|
||||||
...accountId && { accountId }
|
|
||||||
};
|
|
||||||
(0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS", "g");
|
|
||||||
return credentials;
|
|
||||||
}
|
|
||||||
throw new import_property_provider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger });
|
|
||||||
}, "fromEnv");
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
|
|
||||||
0 && (0);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 1509:
|
/***/ 1509:
|
||||||
@@ -8706,7 +8630,7 @@ var resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileN
|
|||||||
}, "Ec2InstanceMetadata"),
|
}, "Ec2InstanceMetadata"),
|
||||||
Environment: /* @__PURE__ */ __name(async (options) => {
|
Environment: /* @__PURE__ */ __name(async (options) => {
|
||||||
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
|
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
|
||||||
const { fromEnv } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(5606)));
|
const { fromEnv } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(7121)));
|
||||||
return async () => fromEnv(options)().then(setNamedProvider);
|
return async () => fromEnv(options)().then(setNamedProvider);
|
||||||
}, "Environment")
|
}, "Environment")
|
||||||
};
|
};
|
||||||
@@ -8916,6 +8840,82 @@ var fromIni = /* @__PURE__ */ __name((_init = {}) => async ({ callerClientConfig
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 7121:
|
||||||
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
|
||||||
|
// src/index.ts
|
||||||
|
var index_exports = {};
|
||||||
|
__export(index_exports, {
|
||||||
|
ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID,
|
||||||
|
ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
|
||||||
|
ENV_EXPIRATION: () => ENV_EXPIRATION,
|
||||||
|
ENV_KEY: () => ENV_KEY,
|
||||||
|
ENV_SECRET: () => ENV_SECRET,
|
||||||
|
ENV_SESSION: () => ENV_SESSION,
|
||||||
|
fromEnv: () => fromEnv
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(index_exports);
|
||||||
|
|
||||||
|
// src/fromEnv.ts
|
||||||
|
var import_client = __nccwpck_require__(5152);
|
||||||
|
var import_property_provider = __nccwpck_require__(1238);
|
||||||
|
var ENV_KEY = "AWS_ACCESS_KEY_ID";
|
||||||
|
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
||||||
|
var ENV_SESSION = "AWS_SESSION_TOKEN";
|
||||||
|
var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
|
||||||
|
var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
|
||||||
|
var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
|
||||||
|
var fromEnv = /* @__PURE__ */ __name((init) => async () => {
|
||||||
|
init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");
|
||||||
|
const accessKeyId = process.env[ENV_KEY];
|
||||||
|
const secretAccessKey = process.env[ENV_SECRET];
|
||||||
|
const sessionToken = process.env[ENV_SESSION];
|
||||||
|
const expiry = process.env[ENV_EXPIRATION];
|
||||||
|
const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
|
||||||
|
const accountId = process.env[ENV_ACCOUNT_ID];
|
||||||
|
if (accessKeyId && secretAccessKey) {
|
||||||
|
const credentials = {
|
||||||
|
accessKeyId,
|
||||||
|
secretAccessKey,
|
||||||
|
...sessionToken && { sessionToken },
|
||||||
|
...expiry && { expiration: new Date(expiry) },
|
||||||
|
...credentialScope && { credentialScope },
|
||||||
|
...accountId && { accountId }
|
||||||
|
};
|
||||||
|
(0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS", "g");
|
||||||
|
return credentials;
|
||||||
|
}
|
||||||
|
throw new import_property_provider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger });
|
||||||
|
}, "fromEnv");
|
||||||
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
|
||||||
|
0 && (0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 5861:
|
/***/ 5861:
|
||||||
@@ -8962,7 +8962,7 @@ __export(index_exports, {
|
|||||||
module.exports = __toCommonJS(index_exports);
|
module.exports = __toCommonJS(index_exports);
|
||||||
|
|
||||||
// src/defaultProvider.ts
|
// src/defaultProvider.ts
|
||||||
var import_credential_provider_env = __nccwpck_require__(5606);
|
var import_credential_provider_env = __nccwpck_require__(6153);
|
||||||
|
|
||||||
var import_shared_ini_file_loader = __nccwpck_require__(4964);
|
var import_shared_ini_file_loader = __nccwpck_require__(4964);
|
||||||
|
|
||||||
@@ -9067,6 +9067,82 @@ var credentialsTreatedAsExpired = /* @__PURE__ */ __name((credentials) => creden
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 6153:
|
||||||
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
|
||||||
|
// src/index.ts
|
||||||
|
var index_exports = {};
|
||||||
|
__export(index_exports, {
|
||||||
|
ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID,
|
||||||
|
ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
|
||||||
|
ENV_EXPIRATION: () => ENV_EXPIRATION,
|
||||||
|
ENV_KEY: () => ENV_KEY,
|
||||||
|
ENV_SECRET: () => ENV_SECRET,
|
||||||
|
ENV_SESSION: () => ENV_SESSION,
|
||||||
|
fromEnv: () => fromEnv
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(index_exports);
|
||||||
|
|
||||||
|
// src/fromEnv.ts
|
||||||
|
var import_client = __nccwpck_require__(5152);
|
||||||
|
var import_property_provider = __nccwpck_require__(1238);
|
||||||
|
var ENV_KEY = "AWS_ACCESS_KEY_ID";
|
||||||
|
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
||||||
|
var ENV_SESSION = "AWS_SESSION_TOKEN";
|
||||||
|
var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
|
||||||
|
var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
|
||||||
|
var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
|
||||||
|
var fromEnv = /* @__PURE__ */ __name((init) => async () => {
|
||||||
|
init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");
|
||||||
|
const accessKeyId = process.env[ENV_KEY];
|
||||||
|
const secretAccessKey = process.env[ENV_SECRET];
|
||||||
|
const sessionToken = process.env[ENV_SESSION];
|
||||||
|
const expiry = process.env[ENV_EXPIRATION];
|
||||||
|
const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
|
||||||
|
const accountId = process.env[ENV_ACCOUNT_ID];
|
||||||
|
if (accessKeyId && secretAccessKey) {
|
||||||
|
const credentials = {
|
||||||
|
accessKeyId,
|
||||||
|
secretAccessKey,
|
||||||
|
...sessionToken && { sessionToken },
|
||||||
|
...expiry && { expiration: new Date(expiry) },
|
||||||
|
...credentialScope && { credentialScope },
|
||||||
|
...accountId && { accountId }
|
||||||
|
};
|
||||||
|
(0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS", "g");
|
||||||
|
return credentials;
|
||||||
|
}
|
||||||
|
throw new import_property_provider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger });
|
||||||
|
}, "fromEnv");
|
||||||
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
|
||||||
|
0 && (0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 5360:
|
/***/ 5360:
|
||||||
@@ -15880,20 +15956,15 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|||||||
if (traits.httpQueryParams) {
|
if (traits.httpQueryParams) {
|
||||||
for (const [key, val] of Object.entries(data)) {
|
for (const [key, val] of Object.entries(data)) {
|
||||||
if (!(key in query)) {
|
if (!(key in query)) {
|
||||||
this.serializeQuery(
|
const valueSchema = ns.getValueSchema();
|
||||||
import_schema2.NormalizedSchema.of([
|
Object.assign(valueSchema.getMergedTraits(), {
|
||||||
ns.getValueSchema(),
|
// We pass on the traits to the sub-schema
|
||||||
{
|
// because we are still in the process of serializing the map itself.
|
||||||
// We pass on the traits to the sub-schema
|
...traits,
|
||||||
// because we are still in the process of serializing the map itself.
|
httpQuery: key,
|
||||||
...traits,
|
httpQueryParams: void 0
|
||||||
httpQuery: key,
|
});
|
||||||
httpQueryParams: void 0
|
this.serializeQuery(valueSchema, val, query);
|
||||||
}
|
|
||||||
]),
|
|
||||||
val,
|
|
||||||
query
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -15980,6 +16051,7 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|||||||
if (null != value) {
|
if (null != value) {
|
||||||
if (memberSchema.isListSchema()) {
|
if (memberSchema.isListSchema()) {
|
||||||
const headerListValueSchema = memberSchema.getValueSchema();
|
const headerListValueSchema = memberSchema.getValueSchema();
|
||||||
|
headerListValueSchema.getMergedTraits().httpHeader = key;
|
||||||
let sections;
|
let sections;
|
||||||
if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === import_schema2.SCHEMA.TIMESTAMP_DEFAULT) {
|
if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === import_schema2.SCHEMA.TIMESTAMP_DEFAULT) {
|
||||||
sections = (0, import_serde.splitEvery)(value, ",", 2);
|
sections = (0, import_serde.splitEvery)(value, ",", 2);
|
||||||
@@ -15988,7 +16060,7 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|||||||
}
|
}
|
||||||
const list = [];
|
const list = [];
|
||||||
for (const section of sections) {
|
for (const section of sections) {
|
||||||
list.push(await deserializer.read([headerListValueSchema, { httpHeader: key }], section.trim()));
|
list.push(await deserializer.read(headerListValueSchema, section.trim()));
|
||||||
}
|
}
|
||||||
dataObject[memberName] = list;
|
dataObject[memberName] = list;
|
||||||
} else {
|
} else {
|
||||||
@@ -15999,8 +16071,10 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|||||||
dataObject[memberName] = {};
|
dataObject[memberName] = {};
|
||||||
for (const [header, value] of Object.entries(response.headers)) {
|
for (const [header, value] of Object.entries(response.headers)) {
|
||||||
if (header.startsWith(memberTraits.httpPrefixHeaders)) {
|
if (header.startsWith(memberTraits.httpPrefixHeaders)) {
|
||||||
|
const valueSchema = memberSchema.getValueSchema();
|
||||||
|
valueSchema.getMergedTraits().httpHeader = header;
|
||||||
dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(
|
dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(
|
||||||
[memberSchema.getValueSchema(), { httpHeader: header }],
|
valueSchema,
|
||||||
value
|
value
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -16708,152 +16782,113 @@ var TypeRegistry = class _TypeRegistry {
|
|||||||
|
|
||||||
// src/submodules/schema/schemas/Schema.ts
|
// src/submodules/schema/schemas/Schema.ts
|
||||||
var Schema = class {
|
var Schema = class {
|
||||||
constructor(name, traits) {
|
static assign(instance, values) {
|
||||||
this.name = name;
|
const schema = Object.assign(instance, values);
|
||||||
this.traits = traits;
|
TypeRegistry.for(schema.namespace).register(schema.name, schema);
|
||||||
|
return schema;
|
||||||
|
}
|
||||||
|
static [Symbol.hasInstance](lhs) {
|
||||||
|
const isPrototype = this.prototype.isPrototypeOf(lhs);
|
||||||
|
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||||
|
const list2 = lhs;
|
||||||
|
return list2.symbol === this.symbol;
|
||||||
|
}
|
||||||
|
return isPrototype;
|
||||||
|
}
|
||||||
|
getName() {
|
||||||
|
return this.namespace + "#" + this.name;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// src/submodules/schema/schemas/ListSchema.ts
|
// src/submodules/schema/schemas/ListSchema.ts
|
||||||
var ListSchema = class _ListSchema extends Schema {
|
var ListSchema = class _ListSchema extends Schema {
|
||||||
constructor(name, traits, valueSchema) {
|
constructor() {
|
||||||
super(name, traits);
|
super(...arguments);
|
||||||
this.name = name;
|
|
||||||
this.traits = traits;
|
|
||||||
this.valueSchema = valueSchema;
|
|
||||||
this.symbol = _ListSchema.symbol;
|
this.symbol = _ListSchema.symbol;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::ListSchema");
|
this.symbol = Symbol.for("@smithy/lis");
|
||||||
}
|
|
||||||
static [Symbol.hasInstance](lhs) {
|
|
||||||
const isPrototype = _ListSchema.prototype.isPrototypeOf(lhs);
|
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const list2 = lhs;
|
|
||||||
return list2.symbol === _ListSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function list(namespace, name, traits = {}, valueSchema) {
|
var list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema(), {
|
||||||
const schema = new ListSchema(
|
name,
|
||||||
namespace + "#" + name,
|
namespace,
|
||||||
traits,
|
traits,
|
||||||
typeof valueSchema === "function" ? valueSchema() : valueSchema
|
valueSchema
|
||||||
);
|
});
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
|
||||||
return schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
// src/submodules/schema/schemas/MapSchema.ts
|
// src/submodules/schema/schemas/MapSchema.ts
|
||||||
var MapSchema = class _MapSchema extends Schema {
|
var MapSchema = class _MapSchema extends Schema {
|
||||||
constructor(name, traits, keySchema, valueSchema) {
|
constructor() {
|
||||||
super(name, traits);
|
super(...arguments);
|
||||||
this.name = name;
|
|
||||||
this.traits = traits;
|
|
||||||
this.keySchema = keySchema;
|
|
||||||
this.valueSchema = valueSchema;
|
|
||||||
this.symbol = _MapSchema.symbol;
|
this.symbol = _MapSchema.symbol;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::MapSchema");
|
this.symbol = Symbol.for("@smithy/map");
|
||||||
}
|
|
||||||
static [Symbol.hasInstance](lhs) {
|
|
||||||
const isPrototype = _MapSchema.prototype.isPrototypeOf(lhs);
|
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const map2 = lhs;
|
|
||||||
return map2.symbol === _MapSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function map(namespace, name, traits = {}, keySchema, valueSchema) {
|
var map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema(), {
|
||||||
const schema = new MapSchema(
|
name,
|
||||||
namespace + "#" + name,
|
namespace,
|
||||||
traits,
|
traits,
|
||||||
keySchema,
|
keySchema,
|
||||||
typeof valueSchema === "function" ? valueSchema() : valueSchema
|
valueSchema
|
||||||
);
|
});
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
|
||||||
return schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
// src/submodules/schema/schemas/OperationSchema.ts
|
// src/submodules/schema/schemas/OperationSchema.ts
|
||||||
var OperationSchema = class extends Schema {
|
var OperationSchema = class _OperationSchema extends Schema {
|
||||||
constructor(name, traits, input, output) {
|
constructor() {
|
||||||
super(name, traits);
|
super(...arguments);
|
||||||
this.name = name;
|
this.symbol = _OperationSchema.symbol;
|
||||||
this.traits = traits;
|
}
|
||||||
this.input = input;
|
static {
|
||||||
this.output = output;
|
this.symbol = Symbol.for("@smithy/ope");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function op(namespace, name, traits = {}, input, output) {
|
var op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema(), {
|
||||||
const schema = new OperationSchema(namespace + "#" + name, traits, input, output);
|
name,
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
namespace,
|
||||||
return schema;
|
traits,
|
||||||
}
|
input,
|
||||||
|
output
|
||||||
|
});
|
||||||
|
|
||||||
// src/submodules/schema/schemas/StructureSchema.ts
|
// src/submodules/schema/schemas/StructureSchema.ts
|
||||||
var StructureSchema = class _StructureSchema extends Schema {
|
var StructureSchema = class _StructureSchema extends Schema {
|
||||||
constructor(name, traits, memberNames, memberList) {
|
constructor() {
|
||||||
super(name, traits);
|
super(...arguments);
|
||||||
this.name = name;
|
|
||||||
this.traits = traits;
|
|
||||||
this.memberNames = memberNames;
|
|
||||||
this.memberList = memberList;
|
|
||||||
this.symbol = _StructureSchema.symbol;
|
this.symbol = _StructureSchema.symbol;
|
||||||
this.members = {};
|
|
||||||
for (let i = 0; i < memberNames.length; ++i) {
|
|
||||||
this.members[memberNames[i]] = Array.isArray(memberList[i]) ? memberList[i] : [memberList[i], 0];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::StructureSchema");
|
this.symbol = Symbol.for("@smithy/str");
|
||||||
}
|
|
||||||
static [Symbol.hasInstance](lhs) {
|
|
||||||
const isPrototype = _StructureSchema.prototype.isPrototypeOf(lhs);
|
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const struct2 = lhs;
|
|
||||||
return struct2.symbol === _StructureSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function struct(namespace, name, traits, memberNames, memberList) {
|
var struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema(), {
|
||||||
const schema = new StructureSchema(namespace + "#" + name, traits, memberNames, memberList);
|
name,
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
namespace,
|
||||||
return schema;
|
traits,
|
||||||
}
|
memberNames,
|
||||||
|
memberList
|
||||||
|
});
|
||||||
|
|
||||||
// src/submodules/schema/schemas/ErrorSchema.ts
|
// src/submodules/schema/schemas/ErrorSchema.ts
|
||||||
var ErrorSchema = class _ErrorSchema extends StructureSchema {
|
var ErrorSchema = class _ErrorSchema extends StructureSchema {
|
||||||
constructor(name, traits, memberNames, memberList, ctor) {
|
constructor() {
|
||||||
super(name, traits, memberNames, memberList);
|
super(...arguments);
|
||||||
this.name = name;
|
|
||||||
this.traits = traits;
|
|
||||||
this.memberNames = memberNames;
|
|
||||||
this.memberList = memberList;
|
|
||||||
this.ctor = ctor;
|
|
||||||
this.symbol = _ErrorSchema.symbol;
|
this.symbol = _ErrorSchema.symbol;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::ErrorSchema");
|
this.symbol = Symbol.for("@smithy/err");
|
||||||
}
|
|
||||||
static [Symbol.hasInstance](lhs) {
|
|
||||||
const isPrototype = _ErrorSchema.prototype.isPrototypeOf(lhs);
|
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const err = lhs;
|
|
||||||
return err.symbol === _ErrorSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function error(namespace, name, traits = {}, memberNames, memberList, ctor) {
|
var error = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema(), {
|
||||||
const schema = new ErrorSchema(namespace + "#" + name, traits, memberNames, memberList, ctor);
|
name,
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
namespace,
|
||||||
return schema;
|
traits,
|
||||||
}
|
memberNames,
|
||||||
|
memberList,
|
||||||
|
ctor
|
||||||
|
});
|
||||||
|
|
||||||
// src/submodules/schema/schemas/sentinels.ts
|
// src/submodules/schema/schemas/sentinels.ts
|
||||||
var SCHEMA = {
|
var SCHEMA = {
|
||||||
@@ -16889,30 +16924,20 @@ var SCHEMA = {
|
|||||||
|
|
||||||
// src/submodules/schema/schemas/SimpleSchema.ts
|
// src/submodules/schema/schemas/SimpleSchema.ts
|
||||||
var SimpleSchema = class _SimpleSchema extends Schema {
|
var SimpleSchema = class _SimpleSchema extends Schema {
|
||||||
constructor(name, schemaRef, traits) {
|
constructor() {
|
||||||
super(name, traits);
|
super(...arguments);
|
||||||
this.name = name;
|
|
||||||
this.schemaRef = schemaRef;
|
|
||||||
this.traits = traits;
|
|
||||||
this.symbol = _SimpleSchema.symbol;
|
this.symbol = _SimpleSchema.symbol;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::SimpleSchema");
|
this.symbol = Symbol.for("@smithy/sim");
|
||||||
}
|
|
||||||
static [Symbol.hasInstance](lhs) {
|
|
||||||
const isPrototype = _SimpleSchema.prototype.isPrototypeOf(lhs);
|
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const sim2 = lhs;
|
|
||||||
return sim2.symbol === _SimpleSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function sim(namespace, name, schemaRef, traits) {
|
var sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema(), {
|
||||||
const schema = new SimpleSchema(namespace + "#" + name, schemaRef, traits);
|
name,
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
namespace,
|
||||||
return schema;
|
traits,
|
||||||
}
|
schemaRef
|
||||||
|
});
|
||||||
|
|
||||||
// src/submodules/schema/schemas/NormalizedSchema.ts
|
// src/submodules/schema/schemas/NormalizedSchema.ts
|
||||||
var NormalizedSchema = class _NormalizedSchema {
|
var NormalizedSchema = class _NormalizedSchema {
|
||||||
@@ -16944,13 +16969,9 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
this.memberTraits = 0;
|
this.memberTraits = 0;
|
||||||
}
|
}
|
||||||
if (schema instanceof _NormalizedSchema) {
|
if (schema instanceof _NormalizedSchema) {
|
||||||
this.name = schema.name;
|
Object.assign(this, schema);
|
||||||
this.traits = schema.traits;
|
|
||||||
this._isMemberSchema = schema._isMemberSchema;
|
|
||||||
this.schema = schema.schema;
|
|
||||||
this.memberTraits = Object.assign({}, schema.getMemberTraits(), this.getMemberTraits());
|
this.memberTraits = Object.assign({}, schema.getMemberTraits(), this.getMemberTraits());
|
||||||
this.normalizedTraits = void 0;
|
this.normalizedTraits = void 0;
|
||||||
this.ref = schema.ref;
|
|
||||||
this.memberName = memberName ?? schema.memberName;
|
this.memberName = memberName ?? schema.memberName;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -16960,34 +16981,33 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
} else {
|
} else {
|
||||||
this.traits = 0;
|
this.traits = 0;
|
||||||
}
|
}
|
||||||
this.name = (typeof this.schema === "object" ? this.schema?.name : void 0) ?? this.memberName ?? this.getSchemaName();
|
this.name = (this.schema instanceof Schema ? this.schema.getName?.() : void 0) ?? this.memberName ?? this.getSchemaName();
|
||||||
if (this._isMemberSchema && !memberName) {
|
if (this._isMemberSchema && !memberName) {
|
||||||
throw new Error(
|
throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);
|
||||||
`@smithy/core/schema - NormalizedSchema member schema ${this.getName(
|
|
||||||
true
|
|
||||||
)} must initialize with memberName argument.`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::NormalizedSchema");
|
this.symbol = Symbol.for("@smithy/nor");
|
||||||
}
|
}
|
||||||
static [Symbol.hasInstance](lhs) {
|
static [Symbol.hasInstance](lhs) {
|
||||||
const isPrototype = _NormalizedSchema.prototype.isPrototypeOf(lhs);
|
return Schema[Symbol.hasInstance].bind(this)(lhs);
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const ns = lhs;
|
|
||||||
return ns.symbol === _NormalizedSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Static constructor that attempts to avoid wrapping a NormalizedSchema within another.
|
* Static constructor that attempts to avoid wrapping a NormalizedSchema within another.
|
||||||
*/
|
*/
|
||||||
static of(ref, memberName) {
|
static of(ref) {
|
||||||
if (ref instanceof _NormalizedSchema) {
|
if (ref instanceof _NormalizedSchema) {
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
return new _NormalizedSchema(ref, memberName);
|
if (Array.isArray(ref)) {
|
||||||
|
const [ns, traits] = ref;
|
||||||
|
if (ns instanceof _NormalizedSchema) {
|
||||||
|
Object.assign(ns.getMergedTraits(), _NormalizedSchema.translateTraits(traits));
|
||||||
|
return ns;
|
||||||
|
}
|
||||||
|
throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);
|
||||||
|
}
|
||||||
|
return new _NormalizedSchema(ref);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param indicator - numeric indicator for preset trait combination.
|
* @param indicator - numeric indicator for preset trait combination.
|
||||||
@@ -16999,46 +17019,29 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
}
|
}
|
||||||
indicator = indicator | 0;
|
indicator = indicator | 0;
|
||||||
const traits = {};
|
const traits = {};
|
||||||
if ((indicator & 1) === 1) {
|
let i = 0;
|
||||||
traits.httpLabel = 1;
|
for (const trait of [
|
||||||
}
|
"httpLabel",
|
||||||
if ((indicator >> 1 & 1) === 1) {
|
"idempotent",
|
||||||
traits.idempotent = 1;
|
"idempotencyToken",
|
||||||
}
|
"sensitive",
|
||||||
if ((indicator >> 2 & 1) === 1) {
|
"httpPayload",
|
||||||
traits.idempotencyToken = 1;
|
"httpResponseCode",
|
||||||
}
|
"httpQueryParams"
|
||||||
if ((indicator >> 3 & 1) === 1) {
|
]) {
|
||||||
traits.sensitive = 1;
|
if ((indicator >> i++ & 1) === 1) {
|
||||||
}
|
traits[trait] = 1;
|
||||||
if ((indicator >> 4 & 1) === 1) {
|
}
|
||||||
traits.httpPayload = 1;
|
|
||||||
}
|
|
||||||
if ((indicator >> 5 & 1) === 1) {
|
|
||||||
traits.httpResponseCode = 1;
|
|
||||||
}
|
|
||||||
if ((indicator >> 6 & 1) === 1) {
|
|
||||||
traits.httpQueryParams = 1;
|
|
||||||
}
|
}
|
||||||
return traits;
|
return traits;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Creates a normalized member schema from the given schema and member name.
|
|
||||||
*/
|
|
||||||
static memberFrom(memberSchema, memberName) {
|
|
||||||
if (memberSchema instanceof _NormalizedSchema) {
|
|
||||||
memberSchema.memberName = memberName;
|
|
||||||
memberSchema._isMemberSchema = true;
|
|
||||||
return memberSchema;
|
|
||||||
}
|
|
||||||
return new _NormalizedSchema(memberSchema, memberName);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @returns the underlying non-normalized schema.
|
* @returns the underlying non-normalized schema.
|
||||||
*/
|
*/
|
||||||
getSchema() {
|
getSchema() {
|
||||||
if (this.schema instanceof _NormalizedSchema) {
|
if (this.schema instanceof _NormalizedSchema) {
|
||||||
return this.schema = this.schema.getSchema();
|
Object.assign(this, { schema: this.schema.getSchema() });
|
||||||
|
return this.schema;
|
||||||
}
|
}
|
||||||
if (this.schema instanceof SimpleSchema) {
|
if (this.schema instanceof SimpleSchema) {
|
||||||
return deref(this.schema.schemaRef);
|
return deref(this.schema.schemaRef);
|
||||||
@@ -17063,7 +17066,7 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
*/
|
*/
|
||||||
getMemberName() {
|
getMemberName() {
|
||||||
if (!this.isMemberSchema()) {
|
if (!this.isMemberSchema()) {
|
||||||
throw new Error(`@smithy/core/schema - cannot get member name on non-member schema: ${this.getName(true)}`);
|
throw new Error(`@smithy/core/schema - non-member schema: ${this.getName(true)}`);
|
||||||
}
|
}
|
||||||
return this.memberName;
|
return this.memberName;
|
||||||
}
|
}
|
||||||
@@ -17090,9 +17093,6 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
}
|
}
|
||||||
return inner instanceof MapSchema;
|
return inner instanceof MapSchema;
|
||||||
}
|
}
|
||||||
isDocumentSchema() {
|
|
||||||
return this.getSchema() === SCHEMA.DOCUMENT;
|
|
||||||
}
|
|
||||||
isStructSchema() {
|
isStructSchema() {
|
||||||
const inner = this.getSchema();
|
const inner = this.getSchema();
|
||||||
return inner !== null && typeof inner === "object" && "members" in inner || inner instanceof StructureSchema;
|
return inner !== null && typeof inner === "object" && "members" in inner || inner instanceof StructureSchema;
|
||||||
@@ -17104,6 +17104,9 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
const schema = this.getSchema();
|
const schema = this.getSchema();
|
||||||
return typeof schema === "number" && schema >= SCHEMA.TIMESTAMP_DEFAULT && schema <= SCHEMA.TIMESTAMP_EPOCH_SECONDS;
|
return typeof schema === "number" && schema >= SCHEMA.TIMESTAMP_DEFAULT && schema <= SCHEMA.TIMESTAMP_EPOCH_SECONDS;
|
||||||
}
|
}
|
||||||
|
isDocumentSchema() {
|
||||||
|
return this.getSchema() === SCHEMA.DOCUMENT;
|
||||||
|
}
|
||||||
isStringSchema() {
|
isStringSchema() {
|
||||||
return this.getSchema() === SCHEMA.STRING;
|
return this.getSchema() === SCHEMA.STRING;
|
||||||
}
|
}
|
||||||
@@ -17143,14 +17146,10 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
* This method is cached.
|
* This method is cached.
|
||||||
*/
|
*/
|
||||||
getMergedTraits() {
|
getMergedTraits() {
|
||||||
if (this.normalizedTraits) {
|
return this.normalizedTraits ?? (this.normalizedTraits = {
|
||||||
return this.normalizedTraits;
|
|
||||||
}
|
|
||||||
this.normalizedTraits = {
|
|
||||||
...this.getOwnTraits(),
|
...this.getOwnTraits(),
|
||||||
...this.getMemberTraits()
|
...this.getMemberTraits()
|
||||||
};
|
});
|
||||||
return this.normalizedTraits;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @returns only the member traits. If the schema is not a member, this returns empty.
|
* @returns only the member traits. If the schema is not a member, this returns empty.
|
||||||
@@ -17172,16 +17171,16 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
*/
|
*/
|
||||||
getKeySchema() {
|
getKeySchema() {
|
||||||
if (this.isDocumentSchema()) {
|
if (this.isDocumentSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([SCHEMA.DOCUMENT, 0], "key");
|
return this.memberFrom([SCHEMA.DOCUMENT, 0], "key");
|
||||||
}
|
}
|
||||||
if (!this.isMapSchema()) {
|
if (!this.isMapSchema()) {
|
||||||
throw new Error(`@smithy/core/schema - cannot get key schema for non-map schema: ${this.getName(true)}`);
|
throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);
|
||||||
}
|
}
|
||||||
const schema = this.getSchema();
|
const schema = this.getSchema();
|
||||||
if (typeof schema === "number") {
|
if (typeof schema === "number") {
|
||||||
return _NormalizedSchema.memberFrom([63 & schema, 0], "key");
|
return this.memberFrom([63 & schema, 0], "key");
|
||||||
}
|
}
|
||||||
return _NormalizedSchema.memberFrom([schema.keySchema, 0], "key");
|
return this.memberFrom([schema.keySchema, 0], "key");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @returns the schema of the map's value or list's member.
|
* @returns the schema of the map's value or list's member.
|
||||||
@@ -17193,28 +17192,28 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
const schema = this.getSchema();
|
const schema = this.getSchema();
|
||||||
if (typeof schema === "number") {
|
if (typeof schema === "number") {
|
||||||
if (this.isMapSchema()) {
|
if (this.isMapSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([63 & schema, 0], "value");
|
return this.memberFrom([63 & schema, 0], "value");
|
||||||
} else if (this.isListSchema()) {
|
} else if (this.isListSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([63 & schema, 0], "member");
|
return this.memberFrom([63 & schema, 0], "member");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (schema && typeof schema === "object") {
|
if (schema && typeof schema === "object") {
|
||||||
if (this.isStructSchema()) {
|
if (this.isStructSchema()) {
|
||||||
throw new Error(`cannot call getValueSchema() with StructureSchema ${this.getName(true)}`);
|
throw new Error(`may not getValueSchema() on structure ${this.getName(true)}`);
|
||||||
}
|
}
|
||||||
const collection = schema;
|
const collection = schema;
|
||||||
if ("valueSchema" in collection) {
|
if ("valueSchema" in collection) {
|
||||||
if (this.isMapSchema()) {
|
if (this.isMapSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([collection.valueSchema, 0], "value");
|
return this.memberFrom([collection.valueSchema, 0], "value");
|
||||||
} else if (this.isListSchema()) {
|
} else if (this.isListSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([collection.valueSchema, 0], "member");
|
return this.memberFrom([collection.valueSchema, 0], "member");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.isDocumentSchema()) {
|
if (this.isDocumentSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([SCHEMA.DOCUMENT, 0], "value");
|
return this.memberFrom([SCHEMA.DOCUMENT, 0], "value");
|
||||||
}
|
}
|
||||||
throw new Error(`@smithy/core/schema - the schema ${this.getName(true)} does not have a value member.`);
|
throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param member - to query.
|
* @param member - to query.
|
||||||
@@ -17223,7 +17222,7 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
hasMemberSchema(member) {
|
hasMemberSchema(member) {
|
||||||
if (this.isStructSchema()) {
|
if (this.isStructSchema()) {
|
||||||
const struct2 = this.getSchema();
|
const struct2 = this.getSchema();
|
||||||
return member in struct2.members;
|
return struct2.memberNames.includes(member);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -17238,17 +17237,17 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
getMemberSchema(member) {
|
getMemberSchema(member) {
|
||||||
if (this.isStructSchema()) {
|
if (this.isStructSchema()) {
|
||||||
const struct2 = this.getSchema();
|
const struct2 = this.getSchema();
|
||||||
if (!(member in struct2.members)) {
|
if (!struct2.memberNames.includes(member)) {
|
||||||
throw new Error(
|
throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${member}.`);
|
||||||
`@smithy/core/schema - the schema ${this.getName(true)} does not have a member with name=${member}.`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return _NormalizedSchema.memberFrom(struct2.members[member], member);
|
const i = struct2.memberNames.indexOf(member);
|
||||||
|
const memberSchema = struct2.memberList[i];
|
||||||
|
return this.memberFrom(Array.isArray(memberSchema) ? memberSchema : [memberSchema, 0], member);
|
||||||
}
|
}
|
||||||
if (this.isDocumentSchema()) {
|
if (this.isDocumentSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([SCHEMA.DOCUMENT, 0], member);
|
return this.memberFrom([SCHEMA.DOCUMENT, 0], member);
|
||||||
}
|
}
|
||||||
throw new Error(`@smithy/core/schema - the schema ${this.getName(true)} does not have members.`);
|
throw new Error(`@smithy/core/schema - ${this.getName(true)} has no members.`);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This can be used for checking the members as a hashmap.
|
* This can be used for checking the members as a hashmap.
|
||||||
@@ -17256,22 +17255,19 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
*
|
*
|
||||||
* This does NOT return list and map members, it is only for structures.
|
* This does NOT return list and map members, it is only for structures.
|
||||||
*
|
*
|
||||||
|
* @deprecated use (checked) structIterator instead.
|
||||||
|
*
|
||||||
* @returns a map of member names to member schemas (normalized).
|
* @returns a map of member names to member schemas (normalized).
|
||||||
*/
|
*/
|
||||||
getMemberSchemas() {
|
getMemberSchemas() {
|
||||||
const { schema } = this;
|
const buffer = {};
|
||||||
const struct2 = schema;
|
try {
|
||||||
if (!struct2 || typeof struct2 !== "object") {
|
for (const [k, v] of this.structIterator()) {
|
||||||
return {};
|
buffer[k] = v;
|
||||||
}
|
|
||||||
if ("members" in struct2) {
|
|
||||||
const buffer = {};
|
|
||||||
for (const member of struct2.memberNames) {
|
|
||||||
buffer[member] = this.getMemberSchema(member);
|
|
||||||
}
|
}
|
||||||
return buffer;
|
} catch (ignored) {
|
||||||
}
|
}
|
||||||
return {};
|
return buffer;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @returns member name of event stream or empty string indicating none exists or this
|
* @returns member name of event stream or empty string indicating none exists or this
|
||||||
@@ -17298,13 +17294,25 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.isStructSchema()) {
|
if (!this.isStructSchema()) {
|
||||||
throw new Error("@smithy/core/schema - cannot acquire structIterator on non-struct schema.");
|
throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
|
||||||
}
|
}
|
||||||
const struct2 = this.getSchema();
|
const struct2 = this.getSchema();
|
||||||
for (let i = 0; i < struct2.memberNames.length; ++i) {
|
for (let i = 0; i < struct2.memberNames.length; ++i) {
|
||||||
yield [struct2.memberNames[i], _NormalizedSchema.memberFrom([struct2.memberList[i], 0], struct2.memberNames[i])];
|
yield [struct2.memberNames[i], this.memberFrom([struct2.memberList[i], 0], struct2.memberNames[i])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Creates a normalized member schema from the given schema and member name.
|
||||||
|
*/
|
||||||
|
memberFrom(memberSchema, memberName) {
|
||||||
|
if (memberSchema instanceof _NormalizedSchema) {
|
||||||
|
return Object.assign(memberSchema, {
|
||||||
|
memberName,
|
||||||
|
_isMemberSchema: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return new _NormalizedSchema(memberSchema, memberName);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @returns a last-resort human-readable name for the schema if it has no other identifiers.
|
* @returns a last-resort human-readable name for the schema if it has no other identifiers.
|
||||||
*/
|
*/
|
||||||
@@ -21749,11 +21757,15 @@ exports.getSSOTokenFilepath = getSSOTokenFilepath;
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.getSSOTokenFromFile = void 0;
|
exports.getSSOTokenFromFile = exports.tokenIntercept = void 0;
|
||||||
const fs_1 = __nccwpck_require__(9896);
|
const fs_1 = __nccwpck_require__(9896);
|
||||||
const getSSOTokenFilepath_1 = __nccwpck_require__(269);
|
const getSSOTokenFilepath_1 = __nccwpck_require__(269);
|
||||||
const { readFile } = fs_1.promises;
|
const { readFile } = fs_1.promises;
|
||||||
|
exports.tokenIntercept = {};
|
||||||
const getSSOTokenFromFile = async (id) => {
|
const getSSOTokenFromFile = async (id) => {
|
||||||
|
if (exports.tokenIntercept[id]) {
|
||||||
|
return exports.tokenIntercept[id];
|
||||||
|
}
|
||||||
const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id);
|
const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id);
|
||||||
const ssoTokenText = await readFile(ssoTokenFilepath, "utf8");
|
const ssoTokenText = await readFile(ssoTokenFilepath, "utf8");
|
||||||
return JSON.parse(ssoTokenText);
|
return JSON.parse(ssoTokenText);
|
||||||
@@ -21792,7 +21804,10 @@ __export(index_exports, {
|
|||||||
CONFIG_PREFIX_SEPARATOR: () => CONFIG_PREFIX_SEPARATOR,
|
CONFIG_PREFIX_SEPARATOR: () => CONFIG_PREFIX_SEPARATOR,
|
||||||
DEFAULT_PROFILE: () => DEFAULT_PROFILE,
|
DEFAULT_PROFILE: () => DEFAULT_PROFILE,
|
||||||
ENV_PROFILE: () => ENV_PROFILE,
|
ENV_PROFILE: () => ENV_PROFILE,
|
||||||
|
SSOToken: () => import_getSSOTokenFromFile2.SSOToken,
|
||||||
|
externalDataInterceptor: () => externalDataInterceptor,
|
||||||
getProfileName: () => getProfileName,
|
getProfileName: () => getProfileName,
|
||||||
|
getSSOTokenFromFile: () => import_getSSOTokenFromFile2.getSSOTokenFromFile,
|
||||||
loadSharedConfigFiles: () => loadSharedConfigFiles,
|
loadSharedConfigFiles: () => loadSharedConfigFiles,
|
||||||
loadSsoSessionData: () => loadSsoSessionData,
|
loadSsoSessionData: () => loadSsoSessionData,
|
||||||
parseKnownFiles: () => parseKnownFiles
|
parseKnownFiles: () => parseKnownFiles
|
||||||
@@ -21807,7 +21822,7 @@ var getProfileName = /* @__PURE__ */ __name((init) => init.profile || process.en
|
|||||||
|
|
||||||
// src/index.ts
|
// src/index.ts
|
||||||
__reExport(index_exports, __nccwpck_require__(269), module.exports);
|
__reExport(index_exports, __nccwpck_require__(269), module.exports);
|
||||||
__reExport(index_exports, __nccwpck_require__(1326), module.exports);
|
var import_getSSOTokenFromFile2 = __nccwpck_require__(1326);
|
||||||
|
|
||||||
// src/loadSharedConfigFiles.ts
|
// src/loadSharedConfigFiles.ts
|
||||||
|
|
||||||
@@ -21957,6 +21972,24 @@ var parseKnownFiles = /* @__PURE__ */ __name(async (init) => {
|
|||||||
const parsedFiles = await loadSharedConfigFiles(init);
|
const parsedFiles = await loadSharedConfigFiles(init);
|
||||||
return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
|
return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
|
||||||
}, "parseKnownFiles");
|
}, "parseKnownFiles");
|
||||||
|
|
||||||
|
// src/externalDataInterceptor.ts
|
||||||
|
var import_getSSOTokenFromFile = __nccwpck_require__(1326);
|
||||||
|
var import_slurpFile3 = __nccwpck_require__(4246);
|
||||||
|
var externalDataInterceptor = {
|
||||||
|
getFileRecord() {
|
||||||
|
return import_slurpFile3.fileIntercept;
|
||||||
|
},
|
||||||
|
interceptFile(path, contents) {
|
||||||
|
import_slurpFile3.fileIntercept[path] = Promise.resolve(contents);
|
||||||
|
},
|
||||||
|
getTokenRecord() {
|
||||||
|
return import_getSSOTokenFromFile.tokenIntercept;
|
||||||
|
},
|
||||||
|
interceptToken(id, contents) {
|
||||||
|
import_getSSOTokenFromFile.tokenIntercept[id] = contents;
|
||||||
|
}
|
||||||
|
};
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
|
||||||
0 && (0);
|
0 && (0);
|
||||||
@@ -21971,15 +22004,19 @@ var parseKnownFiles = /* @__PURE__ */ __name(async (init) => {
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.slurpFile = void 0;
|
exports.slurpFile = exports.fileIntercept = exports.filePromisesHash = void 0;
|
||||||
const fs_1 = __nccwpck_require__(9896);
|
const fs_1 = __nccwpck_require__(9896);
|
||||||
const { readFile } = fs_1.promises;
|
const { readFile } = fs_1.promises;
|
||||||
const filePromisesHash = {};
|
exports.filePromisesHash = {};
|
||||||
|
exports.fileIntercept = {};
|
||||||
const slurpFile = (path, options) => {
|
const slurpFile = (path, options) => {
|
||||||
if (!filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) {
|
if (exports.fileIntercept[path] !== undefined) {
|
||||||
filePromisesHash[path] = readFile(path, "utf8");
|
return exports.fileIntercept[path];
|
||||||
}
|
}
|
||||||
return filePromisesHash[path];
|
if (!exports.filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) {
|
||||||
|
exports.filePromisesHash[path] = readFile(path, "utf8");
|
||||||
|
}
|
||||||
|
return exports.filePromisesHash[path];
|
||||||
};
|
};
|
||||||
exports.slurpFile = slurpFile;
|
exports.slurpFile = slurpFile;
|
||||||
|
|
||||||
|
|||||||
+359
-322
@@ -9188,82 +9188,6 @@ var AwsRestXmlProtocol = class extends import_protocols6.HttpBindingProtocol {
|
|||||||
0 && (0);
|
0 && (0);
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
|
||||||
|
|
||||||
/***/ 5606:
|
|
||||||
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
||||||
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
var __defProp = Object.defineProperty;
|
|
||||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
||||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
||||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
||||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
||||||
var __export = (target, all) => {
|
|
||||||
for (var name in all)
|
|
||||||
__defProp(target, name, { get: all[name], enumerable: true });
|
|
||||||
};
|
|
||||||
var __copyProps = (to, from, except, desc) => {
|
|
||||||
if (from && typeof from === "object" || typeof from === "function") {
|
|
||||||
for (let key of __getOwnPropNames(from))
|
|
||||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
||||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
||||||
}
|
|
||||||
return to;
|
|
||||||
};
|
|
||||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
||||||
|
|
||||||
// src/index.ts
|
|
||||||
var index_exports = {};
|
|
||||||
__export(index_exports, {
|
|
||||||
ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID,
|
|
||||||
ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
|
|
||||||
ENV_EXPIRATION: () => ENV_EXPIRATION,
|
|
||||||
ENV_KEY: () => ENV_KEY,
|
|
||||||
ENV_SECRET: () => ENV_SECRET,
|
|
||||||
ENV_SESSION: () => ENV_SESSION,
|
|
||||||
fromEnv: () => fromEnv
|
|
||||||
});
|
|
||||||
module.exports = __toCommonJS(index_exports);
|
|
||||||
|
|
||||||
// src/fromEnv.ts
|
|
||||||
var import_client = __nccwpck_require__(5152);
|
|
||||||
var import_property_provider = __nccwpck_require__(1238);
|
|
||||||
var ENV_KEY = "AWS_ACCESS_KEY_ID";
|
|
||||||
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
|
||||||
var ENV_SESSION = "AWS_SESSION_TOKEN";
|
|
||||||
var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
|
|
||||||
var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
|
|
||||||
var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
|
|
||||||
var fromEnv = /* @__PURE__ */ __name((init) => async () => {
|
|
||||||
init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");
|
|
||||||
const accessKeyId = process.env[ENV_KEY];
|
|
||||||
const secretAccessKey = process.env[ENV_SECRET];
|
|
||||||
const sessionToken = process.env[ENV_SESSION];
|
|
||||||
const expiry = process.env[ENV_EXPIRATION];
|
|
||||||
const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
|
|
||||||
const accountId = process.env[ENV_ACCOUNT_ID];
|
|
||||||
if (accessKeyId && secretAccessKey) {
|
|
||||||
const credentials = {
|
|
||||||
accessKeyId,
|
|
||||||
secretAccessKey,
|
|
||||||
...sessionToken && { sessionToken },
|
|
||||||
...expiry && { expiration: new Date(expiry) },
|
|
||||||
...credentialScope && { credentialScope },
|
|
||||||
...accountId && { accountId }
|
|
||||||
};
|
|
||||||
(0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS", "g");
|
|
||||||
return credentials;
|
|
||||||
}
|
|
||||||
throw new import_property_provider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger });
|
|
||||||
}, "fromEnv");
|
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
|
||||||
|
|
||||||
0 && (0);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 1509:
|
/***/ 1509:
|
||||||
@@ -9567,7 +9491,7 @@ var resolveCredentialSource = /* @__PURE__ */ __name((credentialSource, profileN
|
|||||||
}, "Ec2InstanceMetadata"),
|
}, "Ec2InstanceMetadata"),
|
||||||
Environment: /* @__PURE__ */ __name(async (options) => {
|
Environment: /* @__PURE__ */ __name(async (options) => {
|
||||||
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
|
logger?.debug("@aws-sdk/credential-provider-ini - credential_source is Environment");
|
||||||
const { fromEnv } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(5606)));
|
const { fromEnv } = await Promise.resolve().then(() => __toESM(__nccwpck_require__(7121)));
|
||||||
return async () => fromEnv(options)().then(setNamedProvider);
|
return async () => fromEnv(options)().then(setNamedProvider);
|
||||||
}, "Environment")
|
}, "Environment")
|
||||||
};
|
};
|
||||||
@@ -9777,6 +9701,82 @@ var fromIni = /* @__PURE__ */ __name((_init = {}) => async ({ callerClientConfig
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 7121:
|
||||||
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
|
||||||
|
// src/index.ts
|
||||||
|
var index_exports = {};
|
||||||
|
__export(index_exports, {
|
||||||
|
ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID,
|
||||||
|
ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
|
||||||
|
ENV_EXPIRATION: () => ENV_EXPIRATION,
|
||||||
|
ENV_KEY: () => ENV_KEY,
|
||||||
|
ENV_SECRET: () => ENV_SECRET,
|
||||||
|
ENV_SESSION: () => ENV_SESSION,
|
||||||
|
fromEnv: () => fromEnv
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(index_exports);
|
||||||
|
|
||||||
|
// src/fromEnv.ts
|
||||||
|
var import_client = __nccwpck_require__(5152);
|
||||||
|
var import_property_provider = __nccwpck_require__(1238);
|
||||||
|
var ENV_KEY = "AWS_ACCESS_KEY_ID";
|
||||||
|
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
||||||
|
var ENV_SESSION = "AWS_SESSION_TOKEN";
|
||||||
|
var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
|
||||||
|
var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
|
||||||
|
var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
|
||||||
|
var fromEnv = /* @__PURE__ */ __name((init) => async () => {
|
||||||
|
init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");
|
||||||
|
const accessKeyId = process.env[ENV_KEY];
|
||||||
|
const secretAccessKey = process.env[ENV_SECRET];
|
||||||
|
const sessionToken = process.env[ENV_SESSION];
|
||||||
|
const expiry = process.env[ENV_EXPIRATION];
|
||||||
|
const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
|
||||||
|
const accountId = process.env[ENV_ACCOUNT_ID];
|
||||||
|
if (accessKeyId && secretAccessKey) {
|
||||||
|
const credentials = {
|
||||||
|
accessKeyId,
|
||||||
|
secretAccessKey,
|
||||||
|
...sessionToken && { sessionToken },
|
||||||
|
...expiry && { expiration: new Date(expiry) },
|
||||||
|
...credentialScope && { credentialScope },
|
||||||
|
...accountId && { accountId }
|
||||||
|
};
|
||||||
|
(0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS", "g");
|
||||||
|
return credentials;
|
||||||
|
}
|
||||||
|
throw new import_property_provider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger });
|
||||||
|
}, "fromEnv");
|
||||||
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
|
||||||
|
0 && (0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 5861:
|
/***/ 5861:
|
||||||
@@ -9823,7 +9823,7 @@ __export(index_exports, {
|
|||||||
module.exports = __toCommonJS(index_exports);
|
module.exports = __toCommonJS(index_exports);
|
||||||
|
|
||||||
// src/defaultProvider.ts
|
// src/defaultProvider.ts
|
||||||
var import_credential_provider_env = __nccwpck_require__(5606);
|
var import_credential_provider_env = __nccwpck_require__(6153);
|
||||||
|
|
||||||
var import_shared_ini_file_loader = __nccwpck_require__(4964);
|
var import_shared_ini_file_loader = __nccwpck_require__(4964);
|
||||||
|
|
||||||
@@ -9928,6 +9928,82 @@ var credentialsTreatedAsExpired = /* @__PURE__ */ __name((credentials) => creden
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/***/ }),
|
||||||
|
|
||||||
|
/***/ 6153:
|
||||||
|
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
||||||
|
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var __defProp = Object.defineProperty;
|
||||||
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||||
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||||
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||||
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||||
|
var __export = (target, all) => {
|
||||||
|
for (var name in all)
|
||||||
|
__defProp(target, name, { get: all[name], enumerable: true });
|
||||||
|
};
|
||||||
|
var __copyProps = (to, from, except, desc) => {
|
||||||
|
if (from && typeof from === "object" || typeof from === "function") {
|
||||||
|
for (let key of __getOwnPropNames(from))
|
||||||
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||||
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||||
|
}
|
||||||
|
return to;
|
||||||
|
};
|
||||||
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||||
|
|
||||||
|
// src/index.ts
|
||||||
|
var index_exports = {};
|
||||||
|
__export(index_exports, {
|
||||||
|
ENV_ACCOUNT_ID: () => ENV_ACCOUNT_ID,
|
||||||
|
ENV_CREDENTIAL_SCOPE: () => ENV_CREDENTIAL_SCOPE,
|
||||||
|
ENV_EXPIRATION: () => ENV_EXPIRATION,
|
||||||
|
ENV_KEY: () => ENV_KEY,
|
||||||
|
ENV_SECRET: () => ENV_SECRET,
|
||||||
|
ENV_SESSION: () => ENV_SESSION,
|
||||||
|
fromEnv: () => fromEnv
|
||||||
|
});
|
||||||
|
module.exports = __toCommonJS(index_exports);
|
||||||
|
|
||||||
|
// src/fromEnv.ts
|
||||||
|
var import_client = __nccwpck_require__(5152);
|
||||||
|
var import_property_provider = __nccwpck_require__(1238);
|
||||||
|
var ENV_KEY = "AWS_ACCESS_KEY_ID";
|
||||||
|
var ENV_SECRET = "AWS_SECRET_ACCESS_KEY";
|
||||||
|
var ENV_SESSION = "AWS_SESSION_TOKEN";
|
||||||
|
var ENV_EXPIRATION = "AWS_CREDENTIAL_EXPIRATION";
|
||||||
|
var ENV_CREDENTIAL_SCOPE = "AWS_CREDENTIAL_SCOPE";
|
||||||
|
var ENV_ACCOUNT_ID = "AWS_ACCOUNT_ID";
|
||||||
|
var fromEnv = /* @__PURE__ */ __name((init) => async () => {
|
||||||
|
init?.logger?.debug("@aws-sdk/credential-provider-env - fromEnv");
|
||||||
|
const accessKeyId = process.env[ENV_KEY];
|
||||||
|
const secretAccessKey = process.env[ENV_SECRET];
|
||||||
|
const sessionToken = process.env[ENV_SESSION];
|
||||||
|
const expiry = process.env[ENV_EXPIRATION];
|
||||||
|
const credentialScope = process.env[ENV_CREDENTIAL_SCOPE];
|
||||||
|
const accountId = process.env[ENV_ACCOUNT_ID];
|
||||||
|
if (accessKeyId && secretAccessKey) {
|
||||||
|
const credentials = {
|
||||||
|
accessKeyId,
|
||||||
|
secretAccessKey,
|
||||||
|
...sessionToken && { sessionToken },
|
||||||
|
...expiry && { expiration: new Date(expiry) },
|
||||||
|
...credentialScope && { credentialScope },
|
||||||
|
...accountId && { accountId }
|
||||||
|
};
|
||||||
|
(0, import_client.setCredentialFeature)(credentials, "CREDENTIALS_ENV_VARS", "g");
|
||||||
|
return credentials;
|
||||||
|
}
|
||||||
|
throw new import_property_provider.CredentialsProviderError("Unable to find environment variable credentials.", { logger: init?.logger });
|
||||||
|
}, "fromEnv");
|
||||||
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
|
||||||
|
0 && (0);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***/ }),
|
/***/ }),
|
||||||
|
|
||||||
/***/ 5360:
|
/***/ 5360:
|
||||||
@@ -16741,20 +16817,15 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|||||||
if (traits.httpQueryParams) {
|
if (traits.httpQueryParams) {
|
||||||
for (const [key, val] of Object.entries(data)) {
|
for (const [key, val] of Object.entries(data)) {
|
||||||
if (!(key in query)) {
|
if (!(key in query)) {
|
||||||
this.serializeQuery(
|
const valueSchema = ns.getValueSchema();
|
||||||
import_schema2.NormalizedSchema.of([
|
Object.assign(valueSchema.getMergedTraits(), {
|
||||||
ns.getValueSchema(),
|
// We pass on the traits to the sub-schema
|
||||||
{
|
// because we are still in the process of serializing the map itself.
|
||||||
// We pass on the traits to the sub-schema
|
...traits,
|
||||||
// because we are still in the process of serializing the map itself.
|
httpQuery: key,
|
||||||
...traits,
|
httpQueryParams: void 0
|
||||||
httpQuery: key,
|
});
|
||||||
httpQueryParams: void 0
|
this.serializeQuery(valueSchema, val, query);
|
||||||
}
|
|
||||||
]),
|
|
||||||
val,
|
|
||||||
query
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@@ -16841,6 +16912,7 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|||||||
if (null != value) {
|
if (null != value) {
|
||||||
if (memberSchema.isListSchema()) {
|
if (memberSchema.isListSchema()) {
|
||||||
const headerListValueSchema = memberSchema.getValueSchema();
|
const headerListValueSchema = memberSchema.getValueSchema();
|
||||||
|
headerListValueSchema.getMergedTraits().httpHeader = key;
|
||||||
let sections;
|
let sections;
|
||||||
if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === import_schema2.SCHEMA.TIMESTAMP_DEFAULT) {
|
if (headerListValueSchema.isTimestampSchema() && headerListValueSchema.getSchema() === import_schema2.SCHEMA.TIMESTAMP_DEFAULT) {
|
||||||
sections = (0, import_serde.splitEvery)(value, ",", 2);
|
sections = (0, import_serde.splitEvery)(value, ",", 2);
|
||||||
@@ -16849,7 +16921,7 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|||||||
}
|
}
|
||||||
const list = [];
|
const list = [];
|
||||||
for (const section of sections) {
|
for (const section of sections) {
|
||||||
list.push(await deserializer.read([headerListValueSchema, { httpHeader: key }], section.trim()));
|
list.push(await deserializer.read(headerListValueSchema, section.trim()));
|
||||||
}
|
}
|
||||||
dataObject[memberName] = list;
|
dataObject[memberName] = list;
|
||||||
} else {
|
} else {
|
||||||
@@ -16860,8 +16932,10 @@ var HttpBindingProtocol = class extends HttpProtocol {
|
|||||||
dataObject[memberName] = {};
|
dataObject[memberName] = {};
|
||||||
for (const [header, value] of Object.entries(response.headers)) {
|
for (const [header, value] of Object.entries(response.headers)) {
|
||||||
if (header.startsWith(memberTraits.httpPrefixHeaders)) {
|
if (header.startsWith(memberTraits.httpPrefixHeaders)) {
|
||||||
|
const valueSchema = memberSchema.getValueSchema();
|
||||||
|
valueSchema.getMergedTraits().httpHeader = header;
|
||||||
dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(
|
dataObject[memberName][header.slice(memberTraits.httpPrefixHeaders.length)] = await deserializer.read(
|
||||||
[memberSchema.getValueSchema(), { httpHeader: header }],
|
valueSchema,
|
||||||
value
|
value
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -17569,152 +17643,113 @@ var TypeRegistry = class _TypeRegistry {
|
|||||||
|
|
||||||
// src/submodules/schema/schemas/Schema.ts
|
// src/submodules/schema/schemas/Schema.ts
|
||||||
var Schema = class {
|
var Schema = class {
|
||||||
constructor(name, traits) {
|
static assign(instance, values) {
|
||||||
this.name = name;
|
const schema = Object.assign(instance, values);
|
||||||
this.traits = traits;
|
TypeRegistry.for(schema.namespace).register(schema.name, schema);
|
||||||
|
return schema;
|
||||||
|
}
|
||||||
|
static [Symbol.hasInstance](lhs) {
|
||||||
|
const isPrototype = this.prototype.isPrototypeOf(lhs);
|
||||||
|
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
||||||
|
const list2 = lhs;
|
||||||
|
return list2.symbol === this.symbol;
|
||||||
|
}
|
||||||
|
return isPrototype;
|
||||||
|
}
|
||||||
|
getName() {
|
||||||
|
return this.namespace + "#" + this.name;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// src/submodules/schema/schemas/ListSchema.ts
|
// src/submodules/schema/schemas/ListSchema.ts
|
||||||
var ListSchema = class _ListSchema extends Schema {
|
var ListSchema = class _ListSchema extends Schema {
|
||||||
constructor(name, traits, valueSchema) {
|
constructor() {
|
||||||
super(name, traits);
|
super(...arguments);
|
||||||
this.name = name;
|
|
||||||
this.traits = traits;
|
|
||||||
this.valueSchema = valueSchema;
|
|
||||||
this.symbol = _ListSchema.symbol;
|
this.symbol = _ListSchema.symbol;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::ListSchema");
|
this.symbol = Symbol.for("@smithy/lis");
|
||||||
}
|
|
||||||
static [Symbol.hasInstance](lhs) {
|
|
||||||
const isPrototype = _ListSchema.prototype.isPrototypeOf(lhs);
|
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const list2 = lhs;
|
|
||||||
return list2.symbol === _ListSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function list(namespace, name, traits = {}, valueSchema) {
|
var list = (namespace, name, traits, valueSchema) => Schema.assign(new ListSchema(), {
|
||||||
const schema = new ListSchema(
|
name,
|
||||||
namespace + "#" + name,
|
namespace,
|
||||||
traits,
|
traits,
|
||||||
typeof valueSchema === "function" ? valueSchema() : valueSchema
|
valueSchema
|
||||||
);
|
});
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
|
||||||
return schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
// src/submodules/schema/schemas/MapSchema.ts
|
// src/submodules/schema/schemas/MapSchema.ts
|
||||||
var MapSchema = class _MapSchema extends Schema {
|
var MapSchema = class _MapSchema extends Schema {
|
||||||
constructor(name, traits, keySchema, valueSchema) {
|
constructor() {
|
||||||
super(name, traits);
|
super(...arguments);
|
||||||
this.name = name;
|
|
||||||
this.traits = traits;
|
|
||||||
this.keySchema = keySchema;
|
|
||||||
this.valueSchema = valueSchema;
|
|
||||||
this.symbol = _MapSchema.symbol;
|
this.symbol = _MapSchema.symbol;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::MapSchema");
|
this.symbol = Symbol.for("@smithy/map");
|
||||||
}
|
|
||||||
static [Symbol.hasInstance](lhs) {
|
|
||||||
const isPrototype = _MapSchema.prototype.isPrototypeOf(lhs);
|
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const map2 = lhs;
|
|
||||||
return map2.symbol === _MapSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function map(namespace, name, traits = {}, keySchema, valueSchema) {
|
var map = (namespace, name, traits, keySchema, valueSchema) => Schema.assign(new MapSchema(), {
|
||||||
const schema = new MapSchema(
|
name,
|
||||||
namespace + "#" + name,
|
namespace,
|
||||||
traits,
|
traits,
|
||||||
keySchema,
|
keySchema,
|
||||||
typeof valueSchema === "function" ? valueSchema() : valueSchema
|
valueSchema
|
||||||
);
|
});
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
|
||||||
return schema;
|
|
||||||
}
|
|
||||||
|
|
||||||
// src/submodules/schema/schemas/OperationSchema.ts
|
// src/submodules/schema/schemas/OperationSchema.ts
|
||||||
var OperationSchema = class extends Schema {
|
var OperationSchema = class _OperationSchema extends Schema {
|
||||||
constructor(name, traits, input, output) {
|
constructor() {
|
||||||
super(name, traits);
|
super(...arguments);
|
||||||
this.name = name;
|
this.symbol = _OperationSchema.symbol;
|
||||||
this.traits = traits;
|
}
|
||||||
this.input = input;
|
static {
|
||||||
this.output = output;
|
this.symbol = Symbol.for("@smithy/ope");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function op(namespace, name, traits = {}, input, output) {
|
var op = (namespace, name, traits, input, output) => Schema.assign(new OperationSchema(), {
|
||||||
const schema = new OperationSchema(namespace + "#" + name, traits, input, output);
|
name,
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
namespace,
|
||||||
return schema;
|
traits,
|
||||||
}
|
input,
|
||||||
|
output
|
||||||
|
});
|
||||||
|
|
||||||
// src/submodules/schema/schemas/StructureSchema.ts
|
// src/submodules/schema/schemas/StructureSchema.ts
|
||||||
var StructureSchema = class _StructureSchema extends Schema {
|
var StructureSchema = class _StructureSchema extends Schema {
|
||||||
constructor(name, traits, memberNames, memberList) {
|
constructor() {
|
||||||
super(name, traits);
|
super(...arguments);
|
||||||
this.name = name;
|
|
||||||
this.traits = traits;
|
|
||||||
this.memberNames = memberNames;
|
|
||||||
this.memberList = memberList;
|
|
||||||
this.symbol = _StructureSchema.symbol;
|
this.symbol = _StructureSchema.symbol;
|
||||||
this.members = {};
|
|
||||||
for (let i = 0; i < memberNames.length; ++i) {
|
|
||||||
this.members[memberNames[i]] = Array.isArray(memberList[i]) ? memberList[i] : [memberList[i], 0];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::StructureSchema");
|
this.symbol = Symbol.for("@smithy/str");
|
||||||
}
|
|
||||||
static [Symbol.hasInstance](lhs) {
|
|
||||||
const isPrototype = _StructureSchema.prototype.isPrototypeOf(lhs);
|
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const struct2 = lhs;
|
|
||||||
return struct2.symbol === _StructureSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function struct(namespace, name, traits, memberNames, memberList) {
|
var struct = (namespace, name, traits, memberNames, memberList) => Schema.assign(new StructureSchema(), {
|
||||||
const schema = new StructureSchema(namespace + "#" + name, traits, memberNames, memberList);
|
name,
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
namespace,
|
||||||
return schema;
|
traits,
|
||||||
}
|
memberNames,
|
||||||
|
memberList
|
||||||
|
});
|
||||||
|
|
||||||
// src/submodules/schema/schemas/ErrorSchema.ts
|
// src/submodules/schema/schemas/ErrorSchema.ts
|
||||||
var ErrorSchema = class _ErrorSchema extends StructureSchema {
|
var ErrorSchema = class _ErrorSchema extends StructureSchema {
|
||||||
constructor(name, traits, memberNames, memberList, ctor) {
|
constructor() {
|
||||||
super(name, traits, memberNames, memberList);
|
super(...arguments);
|
||||||
this.name = name;
|
|
||||||
this.traits = traits;
|
|
||||||
this.memberNames = memberNames;
|
|
||||||
this.memberList = memberList;
|
|
||||||
this.ctor = ctor;
|
|
||||||
this.symbol = _ErrorSchema.symbol;
|
this.symbol = _ErrorSchema.symbol;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::ErrorSchema");
|
this.symbol = Symbol.for("@smithy/err");
|
||||||
}
|
|
||||||
static [Symbol.hasInstance](lhs) {
|
|
||||||
const isPrototype = _ErrorSchema.prototype.isPrototypeOf(lhs);
|
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const err = lhs;
|
|
||||||
return err.symbol === _ErrorSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function error(namespace, name, traits = {}, memberNames, memberList, ctor) {
|
var error = (namespace, name, traits, memberNames, memberList, ctor) => Schema.assign(new ErrorSchema(), {
|
||||||
const schema = new ErrorSchema(namespace + "#" + name, traits, memberNames, memberList, ctor);
|
name,
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
namespace,
|
||||||
return schema;
|
traits,
|
||||||
}
|
memberNames,
|
||||||
|
memberList,
|
||||||
|
ctor
|
||||||
|
});
|
||||||
|
|
||||||
// src/submodules/schema/schemas/sentinels.ts
|
// src/submodules/schema/schemas/sentinels.ts
|
||||||
var SCHEMA = {
|
var SCHEMA = {
|
||||||
@@ -17750,30 +17785,20 @@ var SCHEMA = {
|
|||||||
|
|
||||||
// src/submodules/schema/schemas/SimpleSchema.ts
|
// src/submodules/schema/schemas/SimpleSchema.ts
|
||||||
var SimpleSchema = class _SimpleSchema extends Schema {
|
var SimpleSchema = class _SimpleSchema extends Schema {
|
||||||
constructor(name, schemaRef, traits) {
|
constructor() {
|
||||||
super(name, traits);
|
super(...arguments);
|
||||||
this.name = name;
|
|
||||||
this.schemaRef = schemaRef;
|
|
||||||
this.traits = traits;
|
|
||||||
this.symbol = _SimpleSchema.symbol;
|
this.symbol = _SimpleSchema.symbol;
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::SimpleSchema");
|
this.symbol = Symbol.for("@smithy/sim");
|
||||||
}
|
|
||||||
static [Symbol.hasInstance](lhs) {
|
|
||||||
const isPrototype = _SimpleSchema.prototype.isPrototypeOf(lhs);
|
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const sim2 = lhs;
|
|
||||||
return sim2.symbol === _SimpleSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function sim(namespace, name, schemaRef, traits) {
|
var sim = (namespace, name, schemaRef, traits) => Schema.assign(new SimpleSchema(), {
|
||||||
const schema = new SimpleSchema(namespace + "#" + name, schemaRef, traits);
|
name,
|
||||||
TypeRegistry.for(namespace).register(name, schema);
|
namespace,
|
||||||
return schema;
|
traits,
|
||||||
}
|
schemaRef
|
||||||
|
});
|
||||||
|
|
||||||
// src/submodules/schema/schemas/NormalizedSchema.ts
|
// src/submodules/schema/schemas/NormalizedSchema.ts
|
||||||
var NormalizedSchema = class _NormalizedSchema {
|
var NormalizedSchema = class _NormalizedSchema {
|
||||||
@@ -17805,13 +17830,9 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
this.memberTraits = 0;
|
this.memberTraits = 0;
|
||||||
}
|
}
|
||||||
if (schema instanceof _NormalizedSchema) {
|
if (schema instanceof _NormalizedSchema) {
|
||||||
this.name = schema.name;
|
Object.assign(this, schema);
|
||||||
this.traits = schema.traits;
|
|
||||||
this._isMemberSchema = schema._isMemberSchema;
|
|
||||||
this.schema = schema.schema;
|
|
||||||
this.memberTraits = Object.assign({}, schema.getMemberTraits(), this.getMemberTraits());
|
this.memberTraits = Object.assign({}, schema.getMemberTraits(), this.getMemberTraits());
|
||||||
this.normalizedTraits = void 0;
|
this.normalizedTraits = void 0;
|
||||||
this.ref = schema.ref;
|
|
||||||
this.memberName = memberName ?? schema.memberName;
|
this.memberName = memberName ?? schema.memberName;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -17821,34 +17842,33 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
} else {
|
} else {
|
||||||
this.traits = 0;
|
this.traits = 0;
|
||||||
}
|
}
|
||||||
this.name = (typeof this.schema === "object" ? this.schema?.name : void 0) ?? this.memberName ?? this.getSchemaName();
|
this.name = (this.schema instanceof Schema ? this.schema.getName?.() : void 0) ?? this.memberName ?? this.getSchemaName();
|
||||||
if (this._isMemberSchema && !memberName) {
|
if (this._isMemberSchema && !memberName) {
|
||||||
throw new Error(
|
throw new Error(`@smithy/core/schema - NormalizedSchema member init ${this.getName(true)} missing member name.`);
|
||||||
`@smithy/core/schema - NormalizedSchema member schema ${this.getName(
|
|
||||||
true
|
|
||||||
)} must initialize with memberName argument.`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static {
|
static {
|
||||||
this.symbol = Symbol.for("@smithy/core/schema::NormalizedSchema");
|
this.symbol = Symbol.for("@smithy/nor");
|
||||||
}
|
}
|
||||||
static [Symbol.hasInstance](lhs) {
|
static [Symbol.hasInstance](lhs) {
|
||||||
const isPrototype = _NormalizedSchema.prototype.isPrototypeOf(lhs);
|
return Schema[Symbol.hasInstance].bind(this)(lhs);
|
||||||
if (!isPrototype && typeof lhs === "object" && lhs !== null) {
|
|
||||||
const ns = lhs;
|
|
||||||
return ns.symbol === _NormalizedSchema.symbol;
|
|
||||||
}
|
|
||||||
return isPrototype;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Static constructor that attempts to avoid wrapping a NormalizedSchema within another.
|
* Static constructor that attempts to avoid wrapping a NormalizedSchema within another.
|
||||||
*/
|
*/
|
||||||
static of(ref, memberName) {
|
static of(ref) {
|
||||||
if (ref instanceof _NormalizedSchema) {
|
if (ref instanceof _NormalizedSchema) {
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
return new _NormalizedSchema(ref, memberName);
|
if (Array.isArray(ref)) {
|
||||||
|
const [ns, traits] = ref;
|
||||||
|
if (ns instanceof _NormalizedSchema) {
|
||||||
|
Object.assign(ns.getMergedTraits(), _NormalizedSchema.translateTraits(traits));
|
||||||
|
return ns;
|
||||||
|
}
|
||||||
|
throw new Error(`@smithy/core/schema - may not init unwrapped member schema=${JSON.stringify(ref, null, 2)}.`);
|
||||||
|
}
|
||||||
|
return new _NormalizedSchema(ref);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param indicator - numeric indicator for preset trait combination.
|
* @param indicator - numeric indicator for preset trait combination.
|
||||||
@@ -17860,46 +17880,29 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
}
|
}
|
||||||
indicator = indicator | 0;
|
indicator = indicator | 0;
|
||||||
const traits = {};
|
const traits = {};
|
||||||
if ((indicator & 1) === 1) {
|
let i = 0;
|
||||||
traits.httpLabel = 1;
|
for (const trait of [
|
||||||
}
|
"httpLabel",
|
||||||
if ((indicator >> 1 & 1) === 1) {
|
"idempotent",
|
||||||
traits.idempotent = 1;
|
"idempotencyToken",
|
||||||
}
|
"sensitive",
|
||||||
if ((indicator >> 2 & 1) === 1) {
|
"httpPayload",
|
||||||
traits.idempotencyToken = 1;
|
"httpResponseCode",
|
||||||
}
|
"httpQueryParams"
|
||||||
if ((indicator >> 3 & 1) === 1) {
|
]) {
|
||||||
traits.sensitive = 1;
|
if ((indicator >> i++ & 1) === 1) {
|
||||||
}
|
traits[trait] = 1;
|
||||||
if ((indicator >> 4 & 1) === 1) {
|
}
|
||||||
traits.httpPayload = 1;
|
|
||||||
}
|
|
||||||
if ((indicator >> 5 & 1) === 1) {
|
|
||||||
traits.httpResponseCode = 1;
|
|
||||||
}
|
|
||||||
if ((indicator >> 6 & 1) === 1) {
|
|
||||||
traits.httpQueryParams = 1;
|
|
||||||
}
|
}
|
||||||
return traits;
|
return traits;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Creates a normalized member schema from the given schema and member name.
|
|
||||||
*/
|
|
||||||
static memberFrom(memberSchema, memberName) {
|
|
||||||
if (memberSchema instanceof _NormalizedSchema) {
|
|
||||||
memberSchema.memberName = memberName;
|
|
||||||
memberSchema._isMemberSchema = true;
|
|
||||||
return memberSchema;
|
|
||||||
}
|
|
||||||
return new _NormalizedSchema(memberSchema, memberName);
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* @returns the underlying non-normalized schema.
|
* @returns the underlying non-normalized schema.
|
||||||
*/
|
*/
|
||||||
getSchema() {
|
getSchema() {
|
||||||
if (this.schema instanceof _NormalizedSchema) {
|
if (this.schema instanceof _NormalizedSchema) {
|
||||||
return this.schema = this.schema.getSchema();
|
Object.assign(this, { schema: this.schema.getSchema() });
|
||||||
|
return this.schema;
|
||||||
}
|
}
|
||||||
if (this.schema instanceof SimpleSchema) {
|
if (this.schema instanceof SimpleSchema) {
|
||||||
return deref(this.schema.schemaRef);
|
return deref(this.schema.schemaRef);
|
||||||
@@ -17924,7 +17927,7 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
*/
|
*/
|
||||||
getMemberName() {
|
getMemberName() {
|
||||||
if (!this.isMemberSchema()) {
|
if (!this.isMemberSchema()) {
|
||||||
throw new Error(`@smithy/core/schema - cannot get member name on non-member schema: ${this.getName(true)}`);
|
throw new Error(`@smithy/core/schema - non-member schema: ${this.getName(true)}`);
|
||||||
}
|
}
|
||||||
return this.memberName;
|
return this.memberName;
|
||||||
}
|
}
|
||||||
@@ -17951,9 +17954,6 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
}
|
}
|
||||||
return inner instanceof MapSchema;
|
return inner instanceof MapSchema;
|
||||||
}
|
}
|
||||||
isDocumentSchema() {
|
|
||||||
return this.getSchema() === SCHEMA.DOCUMENT;
|
|
||||||
}
|
|
||||||
isStructSchema() {
|
isStructSchema() {
|
||||||
const inner = this.getSchema();
|
const inner = this.getSchema();
|
||||||
return inner !== null && typeof inner === "object" && "members" in inner || inner instanceof StructureSchema;
|
return inner !== null && typeof inner === "object" && "members" in inner || inner instanceof StructureSchema;
|
||||||
@@ -17965,6 +17965,9 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
const schema = this.getSchema();
|
const schema = this.getSchema();
|
||||||
return typeof schema === "number" && schema >= SCHEMA.TIMESTAMP_DEFAULT && schema <= SCHEMA.TIMESTAMP_EPOCH_SECONDS;
|
return typeof schema === "number" && schema >= SCHEMA.TIMESTAMP_DEFAULT && schema <= SCHEMA.TIMESTAMP_EPOCH_SECONDS;
|
||||||
}
|
}
|
||||||
|
isDocumentSchema() {
|
||||||
|
return this.getSchema() === SCHEMA.DOCUMENT;
|
||||||
|
}
|
||||||
isStringSchema() {
|
isStringSchema() {
|
||||||
return this.getSchema() === SCHEMA.STRING;
|
return this.getSchema() === SCHEMA.STRING;
|
||||||
}
|
}
|
||||||
@@ -18004,14 +18007,10 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
* This method is cached.
|
* This method is cached.
|
||||||
*/
|
*/
|
||||||
getMergedTraits() {
|
getMergedTraits() {
|
||||||
if (this.normalizedTraits) {
|
return this.normalizedTraits ?? (this.normalizedTraits = {
|
||||||
return this.normalizedTraits;
|
|
||||||
}
|
|
||||||
this.normalizedTraits = {
|
|
||||||
...this.getOwnTraits(),
|
...this.getOwnTraits(),
|
||||||
...this.getMemberTraits()
|
...this.getMemberTraits()
|
||||||
};
|
});
|
||||||
return this.normalizedTraits;
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @returns only the member traits. If the schema is not a member, this returns empty.
|
* @returns only the member traits. If the schema is not a member, this returns empty.
|
||||||
@@ -18033,16 +18032,16 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
*/
|
*/
|
||||||
getKeySchema() {
|
getKeySchema() {
|
||||||
if (this.isDocumentSchema()) {
|
if (this.isDocumentSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([SCHEMA.DOCUMENT, 0], "key");
|
return this.memberFrom([SCHEMA.DOCUMENT, 0], "key");
|
||||||
}
|
}
|
||||||
if (!this.isMapSchema()) {
|
if (!this.isMapSchema()) {
|
||||||
throw new Error(`@smithy/core/schema - cannot get key schema for non-map schema: ${this.getName(true)}`);
|
throw new Error(`@smithy/core/schema - cannot get key for non-map: ${this.getName(true)}`);
|
||||||
}
|
}
|
||||||
const schema = this.getSchema();
|
const schema = this.getSchema();
|
||||||
if (typeof schema === "number") {
|
if (typeof schema === "number") {
|
||||||
return _NormalizedSchema.memberFrom([63 & schema, 0], "key");
|
return this.memberFrom([63 & schema, 0], "key");
|
||||||
}
|
}
|
||||||
return _NormalizedSchema.memberFrom([schema.keySchema, 0], "key");
|
return this.memberFrom([schema.keySchema, 0], "key");
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @returns the schema of the map's value or list's member.
|
* @returns the schema of the map's value or list's member.
|
||||||
@@ -18054,28 +18053,28 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
const schema = this.getSchema();
|
const schema = this.getSchema();
|
||||||
if (typeof schema === "number") {
|
if (typeof schema === "number") {
|
||||||
if (this.isMapSchema()) {
|
if (this.isMapSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([63 & schema, 0], "value");
|
return this.memberFrom([63 & schema, 0], "value");
|
||||||
} else if (this.isListSchema()) {
|
} else if (this.isListSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([63 & schema, 0], "member");
|
return this.memberFrom([63 & schema, 0], "member");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (schema && typeof schema === "object") {
|
if (schema && typeof schema === "object") {
|
||||||
if (this.isStructSchema()) {
|
if (this.isStructSchema()) {
|
||||||
throw new Error(`cannot call getValueSchema() with StructureSchema ${this.getName(true)}`);
|
throw new Error(`may not getValueSchema() on structure ${this.getName(true)}`);
|
||||||
}
|
}
|
||||||
const collection = schema;
|
const collection = schema;
|
||||||
if ("valueSchema" in collection) {
|
if ("valueSchema" in collection) {
|
||||||
if (this.isMapSchema()) {
|
if (this.isMapSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([collection.valueSchema, 0], "value");
|
return this.memberFrom([collection.valueSchema, 0], "value");
|
||||||
} else if (this.isListSchema()) {
|
} else if (this.isListSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([collection.valueSchema, 0], "member");
|
return this.memberFrom([collection.valueSchema, 0], "member");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.isDocumentSchema()) {
|
if (this.isDocumentSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([SCHEMA.DOCUMENT, 0], "value");
|
return this.memberFrom([SCHEMA.DOCUMENT, 0], "value");
|
||||||
}
|
}
|
||||||
throw new Error(`@smithy/core/schema - the schema ${this.getName(true)} does not have a value member.`);
|
throw new Error(`@smithy/core/schema - ${this.getName(true)} has no value member.`);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param member - to query.
|
* @param member - to query.
|
||||||
@@ -18084,7 +18083,7 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
hasMemberSchema(member) {
|
hasMemberSchema(member) {
|
||||||
if (this.isStructSchema()) {
|
if (this.isStructSchema()) {
|
||||||
const struct2 = this.getSchema();
|
const struct2 = this.getSchema();
|
||||||
return member in struct2.members;
|
return struct2.memberNames.includes(member);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -18099,17 +18098,17 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
getMemberSchema(member) {
|
getMemberSchema(member) {
|
||||||
if (this.isStructSchema()) {
|
if (this.isStructSchema()) {
|
||||||
const struct2 = this.getSchema();
|
const struct2 = this.getSchema();
|
||||||
if (!(member in struct2.members)) {
|
if (!struct2.memberNames.includes(member)) {
|
||||||
throw new Error(
|
throw new Error(`@smithy/core/schema - ${this.getName(true)} has no member=${member}.`);
|
||||||
`@smithy/core/schema - the schema ${this.getName(true)} does not have a member with name=${member}.`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return _NormalizedSchema.memberFrom(struct2.members[member], member);
|
const i = struct2.memberNames.indexOf(member);
|
||||||
|
const memberSchema = struct2.memberList[i];
|
||||||
|
return this.memberFrom(Array.isArray(memberSchema) ? memberSchema : [memberSchema, 0], member);
|
||||||
}
|
}
|
||||||
if (this.isDocumentSchema()) {
|
if (this.isDocumentSchema()) {
|
||||||
return _NormalizedSchema.memberFrom([SCHEMA.DOCUMENT, 0], member);
|
return this.memberFrom([SCHEMA.DOCUMENT, 0], member);
|
||||||
}
|
}
|
||||||
throw new Error(`@smithy/core/schema - the schema ${this.getName(true)} does not have members.`);
|
throw new Error(`@smithy/core/schema - ${this.getName(true)} has no members.`);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This can be used for checking the members as a hashmap.
|
* This can be used for checking the members as a hashmap.
|
||||||
@@ -18117,22 +18116,19 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
*
|
*
|
||||||
* This does NOT return list and map members, it is only for structures.
|
* This does NOT return list and map members, it is only for structures.
|
||||||
*
|
*
|
||||||
|
* @deprecated use (checked) structIterator instead.
|
||||||
|
*
|
||||||
* @returns a map of member names to member schemas (normalized).
|
* @returns a map of member names to member schemas (normalized).
|
||||||
*/
|
*/
|
||||||
getMemberSchemas() {
|
getMemberSchemas() {
|
||||||
const { schema } = this;
|
const buffer = {};
|
||||||
const struct2 = schema;
|
try {
|
||||||
if (!struct2 || typeof struct2 !== "object") {
|
for (const [k, v] of this.structIterator()) {
|
||||||
return {};
|
buffer[k] = v;
|
||||||
}
|
|
||||||
if ("members" in struct2) {
|
|
||||||
const buffer = {};
|
|
||||||
for (const member of struct2.memberNames) {
|
|
||||||
buffer[member] = this.getMemberSchema(member);
|
|
||||||
}
|
}
|
||||||
return buffer;
|
} catch (ignored) {
|
||||||
}
|
}
|
||||||
return {};
|
return buffer;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @returns member name of event stream or empty string indicating none exists or this
|
* @returns member name of event stream or empty string indicating none exists or this
|
||||||
@@ -18159,13 +18155,25 @@ var NormalizedSchema = class _NormalizedSchema {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!this.isStructSchema()) {
|
if (!this.isStructSchema()) {
|
||||||
throw new Error("@smithy/core/schema - cannot acquire structIterator on non-struct schema.");
|
throw new Error("@smithy/core/schema - cannot iterate non-struct schema.");
|
||||||
}
|
}
|
||||||
const struct2 = this.getSchema();
|
const struct2 = this.getSchema();
|
||||||
for (let i = 0; i < struct2.memberNames.length; ++i) {
|
for (let i = 0; i < struct2.memberNames.length; ++i) {
|
||||||
yield [struct2.memberNames[i], _NormalizedSchema.memberFrom([struct2.memberList[i], 0], struct2.memberNames[i])];
|
yield [struct2.memberNames[i], this.memberFrom([struct2.memberList[i], 0], struct2.memberNames[i])];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Creates a normalized member schema from the given schema and member name.
|
||||||
|
*/
|
||||||
|
memberFrom(memberSchema, memberName) {
|
||||||
|
if (memberSchema instanceof _NormalizedSchema) {
|
||||||
|
return Object.assign(memberSchema, {
|
||||||
|
memberName,
|
||||||
|
_isMemberSchema: true
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return new _NormalizedSchema(memberSchema, memberName);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* @returns a last-resort human-readable name for the schema if it has no other identifiers.
|
* @returns a last-resort human-readable name for the schema if it has no other identifiers.
|
||||||
*/
|
*/
|
||||||
@@ -22610,11 +22618,15 @@ exports.getSSOTokenFilepath = getSSOTokenFilepath;
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.getSSOTokenFromFile = void 0;
|
exports.getSSOTokenFromFile = exports.tokenIntercept = void 0;
|
||||||
const fs_1 = __nccwpck_require__(9896);
|
const fs_1 = __nccwpck_require__(9896);
|
||||||
const getSSOTokenFilepath_1 = __nccwpck_require__(269);
|
const getSSOTokenFilepath_1 = __nccwpck_require__(269);
|
||||||
const { readFile } = fs_1.promises;
|
const { readFile } = fs_1.promises;
|
||||||
|
exports.tokenIntercept = {};
|
||||||
const getSSOTokenFromFile = async (id) => {
|
const getSSOTokenFromFile = async (id) => {
|
||||||
|
if (exports.tokenIntercept[id]) {
|
||||||
|
return exports.tokenIntercept[id];
|
||||||
|
}
|
||||||
const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id);
|
const ssoTokenFilepath = (0, getSSOTokenFilepath_1.getSSOTokenFilepath)(id);
|
||||||
const ssoTokenText = await readFile(ssoTokenFilepath, "utf8");
|
const ssoTokenText = await readFile(ssoTokenFilepath, "utf8");
|
||||||
return JSON.parse(ssoTokenText);
|
return JSON.parse(ssoTokenText);
|
||||||
@@ -22653,7 +22665,10 @@ __export(index_exports, {
|
|||||||
CONFIG_PREFIX_SEPARATOR: () => CONFIG_PREFIX_SEPARATOR,
|
CONFIG_PREFIX_SEPARATOR: () => CONFIG_PREFIX_SEPARATOR,
|
||||||
DEFAULT_PROFILE: () => DEFAULT_PROFILE,
|
DEFAULT_PROFILE: () => DEFAULT_PROFILE,
|
||||||
ENV_PROFILE: () => ENV_PROFILE,
|
ENV_PROFILE: () => ENV_PROFILE,
|
||||||
|
SSOToken: () => import_getSSOTokenFromFile2.SSOToken,
|
||||||
|
externalDataInterceptor: () => externalDataInterceptor,
|
||||||
getProfileName: () => getProfileName,
|
getProfileName: () => getProfileName,
|
||||||
|
getSSOTokenFromFile: () => import_getSSOTokenFromFile2.getSSOTokenFromFile,
|
||||||
loadSharedConfigFiles: () => loadSharedConfigFiles,
|
loadSharedConfigFiles: () => loadSharedConfigFiles,
|
||||||
loadSsoSessionData: () => loadSsoSessionData,
|
loadSsoSessionData: () => loadSsoSessionData,
|
||||||
parseKnownFiles: () => parseKnownFiles
|
parseKnownFiles: () => parseKnownFiles
|
||||||
@@ -22668,7 +22683,7 @@ var getProfileName = /* @__PURE__ */ __name((init) => init.profile || process.en
|
|||||||
|
|
||||||
// src/index.ts
|
// src/index.ts
|
||||||
__reExport(index_exports, __nccwpck_require__(269), module.exports);
|
__reExport(index_exports, __nccwpck_require__(269), module.exports);
|
||||||
__reExport(index_exports, __nccwpck_require__(1326), module.exports);
|
var import_getSSOTokenFromFile2 = __nccwpck_require__(1326);
|
||||||
|
|
||||||
// src/loadSharedConfigFiles.ts
|
// src/loadSharedConfigFiles.ts
|
||||||
|
|
||||||
@@ -22818,6 +22833,24 @@ var parseKnownFiles = /* @__PURE__ */ __name(async (init) => {
|
|||||||
const parsedFiles = await loadSharedConfigFiles(init);
|
const parsedFiles = await loadSharedConfigFiles(init);
|
||||||
return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
|
return mergeConfigFiles(parsedFiles.configFile, parsedFiles.credentialsFile);
|
||||||
}, "parseKnownFiles");
|
}, "parseKnownFiles");
|
||||||
|
|
||||||
|
// src/externalDataInterceptor.ts
|
||||||
|
var import_getSSOTokenFromFile = __nccwpck_require__(1326);
|
||||||
|
var import_slurpFile3 = __nccwpck_require__(4246);
|
||||||
|
var externalDataInterceptor = {
|
||||||
|
getFileRecord() {
|
||||||
|
return import_slurpFile3.fileIntercept;
|
||||||
|
},
|
||||||
|
interceptFile(path, contents) {
|
||||||
|
import_slurpFile3.fileIntercept[path] = Promise.resolve(contents);
|
||||||
|
},
|
||||||
|
getTokenRecord() {
|
||||||
|
return import_getSSOTokenFromFile.tokenIntercept;
|
||||||
|
},
|
||||||
|
interceptToken(id, contents) {
|
||||||
|
import_getSSOTokenFromFile.tokenIntercept[id] = contents;
|
||||||
|
}
|
||||||
|
};
|
||||||
// Annotate the CommonJS export names for ESM import in node:
|
// Annotate the CommonJS export names for ESM import in node:
|
||||||
|
|
||||||
0 && (0);
|
0 && (0);
|
||||||
@@ -22832,15 +22865,19 @@ var parseKnownFiles = /* @__PURE__ */ __name(async (init) => {
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
||||||
exports.slurpFile = void 0;
|
exports.slurpFile = exports.fileIntercept = exports.filePromisesHash = void 0;
|
||||||
const fs_1 = __nccwpck_require__(9896);
|
const fs_1 = __nccwpck_require__(9896);
|
||||||
const { readFile } = fs_1.promises;
|
const { readFile } = fs_1.promises;
|
||||||
const filePromisesHash = {};
|
exports.filePromisesHash = {};
|
||||||
|
exports.fileIntercept = {};
|
||||||
const slurpFile = (path, options) => {
|
const slurpFile = (path, options) => {
|
||||||
if (!filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) {
|
if (exports.fileIntercept[path] !== undefined) {
|
||||||
filePromisesHash[path] = readFile(path, "utf8");
|
return exports.fileIntercept[path];
|
||||||
}
|
}
|
||||||
return filePromisesHash[path];
|
if (!exports.filePromisesHash[path] || (options === null || options === void 0 ? void 0 : options.ignoreCache)) {
|
||||||
|
exports.filePromisesHash[path] = readFile(path, "utf8");
|
||||||
|
}
|
||||||
|
return exports.filePromisesHash[path];
|
||||||
};
|
};
|
||||||
exports.slurpFile = slurpFile;
|
exports.slurpFile = slurpFile;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user