UNPKG

@smythos/cli

Version:

SmythOS SRE Command Line Interface

3 lines (2 loc) 24.4 kB
#!/usr/bin/env node "use strict";var N=Object.defineProperty;var I=(S,E)=>N(S,"name",{value:E,configurable:!0});var commands_agent=require("./agent.index.cjs");require("buffer");require("stream");require("node:stream");require("http");require("https");require("http2");require("os");require("path");require("crypto");var _package=require("./package2.cjs"),noAuth=require("./noAuth2.cjs"),createAggregatedClient=require("./create-aggregated-client.cjs");require("./index2.cjs");require("node:url");require("node:fs");require("node:fs/promises");require("node:util");require("node:path");require("fs");require("node:os");require("tty");require("util");require("inspector");require("node:perf_hooks");require("url");require("node:readline");require("node:process");require("node:tty");require("./index3.cjs");require("./index4.cjs");require("events");require("string_decoder");require("zlib");require("assert");require("process");require("querystring");require("net");require("tls");require("dns");require("fs/promises");require("child_process");require("punycode");require("node:stream/web");require("node:events");require("timers");require("node:crypto");require("readline");require("./index5.cjs");require("./index6.cjs");const defaultSSOOIDCHttpAuthSchemeParametersProvider=I(async(S,E,y)=>({operation:commands_agent.getSmithyContext(E).operation,region:await commands_agent.normalizeProvider(S.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()}),"defaultSSOOIDCHttpAuthSchemeParametersProvider");function createAwsAuthSigv4HttpAuthOption(S){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sso-oauth",region:S.region},propertiesExtractor:I((E,y)=>({signingProperties:{config:E,context:y}}),"propertiesExtractor")}}I(createAwsAuthSigv4HttpAuthOption,"createAwsAuthSigv4HttpAuthOption");function createSmithyApiNoAuthHttpAuthOption(S){return{schemeId:"smithy.api#noAuth"}}I(createSmithyApiNoAuthHttpAuthOption,"createSmithyApiNoAuthHttpAuthOption");const defaultSSOOIDCHttpAuthSchemeProvider=I(S=>{const E=[];switch(S.operation){case"CreateToken":{E.push(createSmithyApiNoAuthHttpAuthOption());break}default:E.push(createAwsAuthSigv4HttpAuthOption(S))}return E},"defaultSSOOIDCHttpAuthSchemeProvider"),resolveHttpAuthSchemeConfig=I(S=>{const E=commands_agent.resolveAwsSdkSigV4Config$1(S);return Object.assign(E,{authSchemePreference:commands_agent.normalizeProvider(S.authSchemePreference??[])})},"resolveHttpAuthSchemeConfig"),resolveClientEndpointParameters=I(S=>Object.assign(S,{useDualstackEndpoint:S.useDualstackEndpoint??!1,useFipsEndpoint:S.useFipsEndpoint??!1,defaultSigningName:"sso-oauth"}),"resolveClientEndpointParameters"),commonParams={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}},u="required",v="fn",w="argv",x="ref",a=!0,b="isSet",c="booleanEquals",d="error",e="endpoint",f="tree",g="PartitionResult",h="getAttr",i={[u]:!1,type:"String"},j={[u]:!0,default:!1,type:"Boolean"},k={[x]:"Endpoint"},l={[v]:c,[w]:[{[x]:"UseFIPS"},!0]},m={[v]:c,[w]:[{[x]:"UseDualStack"},!0]},n={},o={[v]:h,[w]:[{[x]:g},"supportsFIPS"]},p={[x]:g},q={[v]:c,[w]:[!0,{[v]:h,[w]:[p,"supportsDualStack"]}]},r=[l],s=[m],t=[{[x]:"Region"}],_data={parameters:{Region:i,UseDualStack:j,UseFIPS:j,Endpoint:i},rules:[{conditions:[{[v]:b,[w]:[k]}],rules:[{conditions:r,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:d},{conditions:s,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:d},{endpoint:{url:k,properties:n,headers:n},type:e}],type:f},{conditions:[{[v]:b,[w]:t}],rules:[{conditions:[{[v]:"aws.partition",[w]:t,assign:g}],rules:[{conditions:[l,m],rules:[{conditions:[{[v]:c,[w]:[a,o]},q],rules:[{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:e}],type:f},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:d}],type:f},{conditions:r,rules:[{conditions:[{[v]:c,[w]:[o,a]}],rules:[{conditions:[{[v]:"stringEquals",[w]:[{[v]:h,[w]:[p,"name"]},"aws-us-gov"]}],endpoint:{url:"https://oidc.{Region}.amazonaws.com",properties:n,headers:n},type:e},{endpoint:{url:"https://oidc-fips.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:e}],type:f},{error:"FIPS is enabled but this partition does not support FIPS",type:d}],type:f},{conditions:s,rules:[{conditions:[q],rules:[{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:n,headers:n},type:e}],type:f},{error:"DualStack is enabled but this partition does not support DualStack",type:d}],type:f},{endpoint:{url:"https://oidc.{Region}.{PartitionResult#dnsSuffix}",properties:n,headers:n},type:e}],type:f}],type:f},{error:"Invalid Configuration: Missing Region",type:d}]},ruleSet=_data,cache=new commands_agent.EndpointCache({size:50,params:["Endpoint","Region","UseDualStack","UseFIPS"]}),defaultEndpointResolver=I((S,E={})=>cache.get(S,()=>commands_agent.resolveEndpoint(ruleSet,{endpointParams:S,logger:E.logger})),"defaultEndpointResolver");commands_agent.customEndpointFunctions.aws=commands_agent.awsEndpointFunctions$1;const getRuntimeConfig$1=I(S=>({apiVersion:"2019-06-10",base64Decoder:S?.base64Decoder??commands_agent.fromBase64,base64Encoder:S?.base64Encoder??commands_agent.toBase64,disableHostPrefix:S?.disableHostPrefix??!1,endpointProvider:S?.endpointProvider??defaultEndpointResolver,extensions:S?.extensions??[],httpAuthSchemeProvider:S?.httpAuthSchemeProvider??defaultSSOOIDCHttpAuthSchemeProvider,httpAuthSchemes:S?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:I(E=>E.getIdentityProvider("aws.auth#sigv4"),"identityProvider"),signer:new commands_agent.AwsSdkSigV4Signer$1},{schemeId:"smithy.api#noAuth",identityProvider:I(E=>E.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),"identityProvider"),signer:new noAuth.NoAuthSigner}],logger:S?.logger??new commands_agent.NoOpLogger,serviceId:S?.serviceId??"SSO OIDC",urlParser:S?.urlParser??commands_agent.parseUrl,utf8Decoder:S?.utf8Decoder??commands_agent.fromUtf8,utf8Encoder:S?.utf8Encoder??commands_agent.toUtf8}),"getRuntimeConfig$1"),getRuntimeConfig=I(S=>{commands_agent.emitWarningIfUnsupportedVersion(process.version);const E=commands_agent.resolveDefaultsModeConfig(S),y=I(()=>E().then(commands_agent.loadConfigsForDefaultMode),"defaultConfigProvider"),C=getRuntimeConfig$1(S);commands_agent.emitWarningIfUnsupportedVersion$2(process.version);const _={profile:S?.profile,logger:C.logger};return{...C,...S,runtime:"node",defaultsMode:E,authSchemePreference:S?.authSchemePreference??commands_agent.loadConfig(commands_agent.NODE_AUTH_SCHEME_PREFERENCE_OPTIONS$1,_),bodyLengthChecker:S?.bodyLengthChecker??commands_agent.calculateBodyLength,defaultUserAgentProvider:S?.defaultUserAgentProvider??commands_agent.createDefaultUserAgentProvider$1({serviceId:C.serviceId,clientVersion:_package.packageInfo.version}),maxAttempts:S?.maxAttempts??commands_agent.loadConfig(commands_agent.NODE_MAX_ATTEMPT_CONFIG_OPTIONS,S),region:S?.region??commands_agent.loadConfig(commands_agent.NODE_REGION_CONFIG_OPTIONS,{...commands_agent.NODE_REGION_CONFIG_FILE_OPTIONS,..._}),requestHandler:commands_agent.NodeHttpHandler.create(S?.requestHandler??y),retryMode:S?.retryMode??commands_agent.loadConfig({...commands_agent.NODE_RETRY_MODE_CONFIG_OPTIONS,default:I(async()=>(await y()).retryMode||commands_agent.DEFAULT_RETRY_MODE,"default")},S),sha256:S?.sha256??commands_agent.Hash.bind(null,"sha256"),streamCollector:S?.streamCollector??commands_agent.streamCollector,useDualstackEndpoint:S?.useDualstackEndpoint??commands_agent.loadConfig(commands_agent.NODE_USE_DUALSTACK_ENDPOINT_CONFIG_OPTIONS,_),useFipsEndpoint:S?.useFipsEndpoint??commands_agent.loadConfig(commands_agent.NODE_USE_FIPS_ENDPOINT_CONFIG_OPTIONS,_),userAgentAppId:S?.userAgentAppId??commands_agent.loadConfig(commands_agent.NODE_APP_ID_CONFIG_OPTIONS$1,_)}},"getRuntimeConfig"),getHttpAuthExtensionConfiguration=I(S=>{const E=S.httpAuthSchemes;let y=S.httpAuthSchemeProvider,C=S.credentials;return{setHttpAuthScheme(_){const P=E.findIndex(O=>O.schemeId===_.schemeId);P===-1?E.push(_):E.splice(P,1,_)},httpAuthSchemes(){return E},setHttpAuthSchemeProvider(_){y=_},httpAuthSchemeProvider(){return y},setCredentials(_){C=_},credentials(){return C}}},"getHttpAuthExtensionConfiguration"),resolveHttpAuthRuntimeConfig=I(S=>({httpAuthSchemes:S.httpAuthSchemes(),httpAuthSchemeProvider:S.httpAuthSchemeProvider(),credentials:S.credentials()}),"resolveHttpAuthRuntimeConfig"),resolveRuntimeExtensions=I((S,E)=>{const y=Object.assign(commands_agent.getAwsRegionExtensionConfiguration(S),commands_agent.getDefaultExtensionConfiguration(S),commands_agent.getHttpHandlerExtensionConfiguration(S),getHttpAuthExtensionConfiguration(S));return E.forEach(C=>C.configure(y)),Object.assign(S,commands_agent.resolveAwsRegionExtensionConfiguration(y),commands_agent.resolveDefaultRuntimeConfig(y),commands_agent.resolveHttpHandlerRuntimeConfig(y),resolveHttpAuthRuntimeConfig(y))},"resolveRuntimeExtensions");class SSOOIDCClient extends commands_agent.Client{static{I(this,"SSOOIDCClient")}config;constructor(...[E]){const y=getRuntimeConfig(E||{});super(y),this.initConfig=y;const C=resolveClientEndpointParameters(y),_=commands_agent.resolveUserAgentConfig$1(C),P=commands_agent.resolveRetryConfig(_),O=commands_agent.resolveRegionConfig(P),A=commands_agent.resolveHostHeaderConfig(O),T=commands_agent.resolveEndpointConfig(A),R=resolveHttpAuthSchemeConfig(T),D=resolveRuntimeExtensions(R,E?.extensions||[]);this.config=D,this.middlewareStack.use(commands_agent.getUserAgentPlugin$1(this.config)),this.middlewareStack.use(commands_agent.getRetryPlugin(this.config)),this.middlewareStack.use(commands_agent.getContentLengthPlugin(this.config)),this.middlewareStack.use(commands_agent.getHostHeaderPlugin(this.config)),this.middlewareStack.use(commands_agent.getLoggerPlugin(this.config)),this.middlewareStack.use(commands_agent.getRecursionDetectionPlugin(this.config)),this.middlewareStack.use(commands_agent.getHttpAuthSchemeEndpointRuleSetPlugin$1(this.config,{httpAuthSchemeParametersProvider:defaultSSOOIDCHttpAuthSchemeParametersProvider,identityProviderConfigProvider:I(async $=>new commands_agent.DefaultIdentityProviderConfig$1({"aws.auth#sigv4":$.credentials}),"identityProviderConfigProvider")})),this.middlewareStack.use(commands_agent.getHttpSigningPlugin$1(this.config))}destroy(){super.destroy()}}class SSOOIDCServiceException extends commands_agent.ServiceException{static{I(this,"SSOOIDCServiceException")}constructor(E){super(E),Object.setPrototypeOf(this,SSOOIDCServiceException.prototype)}}class AccessDeniedException extends SSOOIDCServiceException{static{I(this,"AccessDeniedException")}name="AccessDeniedException";$fault="client";error;error_description;constructor(E){super({name:"AccessDeniedException",$fault:"client",...E}),Object.setPrototypeOf(this,AccessDeniedException.prototype),this.error=E.error,this.error_description=E.error_description}}class AuthorizationPendingException extends SSOOIDCServiceException{static{I(this,"AuthorizationPendingException")}name="AuthorizationPendingException";$fault="client";error;error_description;constructor(E){super({name:"AuthorizationPendingException",$fault:"client",...E}),Object.setPrototypeOf(this,AuthorizationPendingException.prototype),this.error=E.error,this.error_description=E.error_description}}const CreateTokenRequestFilterSensitiveLog=I(S=>({...S,...S.clientSecret&&{clientSecret:commands_agent.SENSITIVE_STRING},...S.refreshToken&&{refreshToken:commands_agent.SENSITIVE_STRING},...S.codeVerifier&&{codeVerifier:commands_agent.SENSITIVE_STRING}}),"CreateTokenRequestFilterSensitiveLog"),CreateTokenResponseFilterSensitiveLog=I(S=>({...S,...S.accessToken&&{accessToken:commands_agent.SENSITIVE_STRING},...S.refreshToken&&{refreshToken:commands_agent.SENSITIVE_STRING},...S.idToken&&{idToken:commands_agent.SENSITIVE_STRING}}),"CreateTokenResponseFilterSensitiveLog");class ExpiredTokenException extends SSOOIDCServiceException{static{I(this,"ExpiredTokenException")}name="ExpiredTokenException";$fault="client";error;error_description;constructor(E){super({name:"ExpiredTokenException",$fault:"client",...E}),Object.setPrototypeOf(this,ExpiredTokenException.prototype),this.error=E.error,this.error_description=E.error_description}}class InternalServerException extends SSOOIDCServiceException{static{I(this,"InternalServerException")}name="InternalServerException";$fault="server";error;error_description;constructor(E){super({name:"InternalServerException",$fault:"server",...E}),Object.setPrototypeOf(this,InternalServerException.prototype),this.error=E.error,this.error_description=E.error_description}}class InvalidClientException extends SSOOIDCServiceException{static{I(this,"InvalidClientException")}name="InvalidClientException";$fault="client";error;error_description;constructor(E){super({name:"InvalidClientException",$fault:"client",...E}),Object.setPrototypeOf(this,InvalidClientException.prototype),this.error=E.error,this.error_description=E.error_description}}class InvalidGrantException extends SSOOIDCServiceException{static{I(this,"InvalidGrantException")}name="InvalidGrantException";$fault="client";error;error_description;constructor(E){super({name:"InvalidGrantException",$fault:"client",...E}),Object.setPrototypeOf(this,InvalidGrantException.prototype),this.error=E.error,this.error_description=E.error_description}}class InvalidRequestException extends SSOOIDCServiceException{static{I(this,"InvalidRequestException")}name="InvalidRequestException";$fault="client";error;error_description;constructor(E){super({name:"InvalidRequestException",$fault:"client",...E}),Object.setPrototypeOf(this,InvalidRequestException.prototype),this.error=E.error,this.error_description=E.error_description}}class InvalidScopeException extends SSOOIDCServiceException{static{I(this,"InvalidScopeException")}name="InvalidScopeException";$fault="client";error;error_description;constructor(E){super({name:"InvalidScopeException",$fault:"client",...E}),Object.setPrototypeOf(this,InvalidScopeException.prototype),this.error=E.error,this.error_description=E.error_description}}class SlowDownException extends SSOOIDCServiceException{static{I(this,"SlowDownException")}name="SlowDownException";$fault="client";error;error_description;constructor(E){super({name:"SlowDownException",$fault:"client",...E}),Object.setPrototypeOf(this,SlowDownException.prototype),this.error=E.error,this.error_description=E.error_description}}class UnauthorizedClientException extends SSOOIDCServiceException{static{I(this,"UnauthorizedClientException")}name="UnauthorizedClientException";$fault="client";error;error_description;constructor(E){super({name:"UnauthorizedClientException",$fault:"client",...E}),Object.setPrototypeOf(this,UnauthorizedClientException.prototype),this.error=E.error,this.error_description=E.error_description}}class UnsupportedGrantTypeException extends SSOOIDCServiceException{static{I(this,"UnsupportedGrantTypeException")}name="UnsupportedGrantTypeException";$fault="client";error;error_description;constructor(E){super({name:"UnsupportedGrantTypeException",$fault:"client",...E}),Object.setPrototypeOf(this,UnsupportedGrantTypeException.prototype),this.error=E.error,this.error_description=E.error_description}}const se_CreateTokenCommand=I(async(S,E)=>{const y=commands_agent.requestBuilder$1(S,E),C={"content-type":"application/json"};y.bp("/token");let _;return _=JSON.stringify(commands_agent.take(S,{clientId:[],clientSecret:[],code:[],codeVerifier:[],deviceCode:[],grantType:[],redirectUri:[],refreshToken:[],scope:I(P=>commands_agent._json(P),"scope")})),y.m("POST").h(C).b(_),y.build()},"se_CreateTokenCommand"),de_CreateTokenCommand=I(async(S,E)=>{if(S.statusCode!==200&&S.statusCode>=300)return de_CommandError(S,E);const y=commands_agent.map({$metadata:deserializeMetadata(S)}),C=commands_agent.expectNonNull(commands_agent.expectObject(await commands_agent.parseJsonBody$1(S.body,E)),"body"),_=commands_agent.take(C,{accessToken:commands_agent.expectString,expiresIn:commands_agent.expectInt32,idToken:commands_agent.expectString,refreshToken:commands_agent.expectString,tokenType:commands_agent.expectString});return Object.assign(y,_),y},"de_CreateTokenCommand"),de_CommandError=I(async(S,E)=>{const y={...S,body:await commands_agent.parseJsonErrorBody$1(S.body,E)},C=commands_agent.loadRestJsonErrorCode$1(S,y.body);switch(C){case"AccessDeniedException":case"com.amazonaws.ssooidc#AccessDeniedException":throw await de_AccessDeniedExceptionRes(y);case"AuthorizationPendingException":case"com.amazonaws.ssooidc#AuthorizationPendingException":throw await de_AuthorizationPendingExceptionRes(y);case"ExpiredTokenException":case"com.amazonaws.ssooidc#ExpiredTokenException":throw await de_ExpiredTokenExceptionRes(y);case"InternalServerException":case"com.amazonaws.ssooidc#InternalServerException":throw await de_InternalServerExceptionRes(y);case"InvalidClientException":case"com.amazonaws.ssooidc#InvalidClientException":throw await de_InvalidClientExceptionRes(y);case"InvalidGrantException":case"com.amazonaws.ssooidc#InvalidGrantException":throw await de_InvalidGrantExceptionRes(y);case"InvalidRequestException":case"com.amazonaws.ssooidc#InvalidRequestException":throw await de_InvalidRequestExceptionRes(y);case"InvalidScopeException":case"com.amazonaws.ssooidc#InvalidScopeException":throw await de_InvalidScopeExceptionRes(y);case"SlowDownException":case"com.amazonaws.ssooidc#SlowDownException":throw await de_SlowDownExceptionRes(y);case"UnauthorizedClientException":case"com.amazonaws.ssooidc#UnauthorizedClientException":throw await de_UnauthorizedClientExceptionRes(y);case"UnsupportedGrantTypeException":case"com.amazonaws.ssooidc#UnsupportedGrantTypeException":throw await de_UnsupportedGrantTypeExceptionRes(y);default:const _=y.body;return throwDefaultError({output:S,parsedBody:_,errorCode:C})}},"de_CommandError"),throwDefaultError=commands_agent.withBaseException(SSOOIDCServiceException),de_AccessDeniedExceptionRes=I(async(S,E)=>{const y=commands_agent.map({}),C=S.body,_=commands_agent.take(C,{error:commands_agent.expectString,error_description:commands_agent.expectString});Object.assign(y,_);const P=new AccessDeniedException({$metadata:deserializeMetadata(S),...y});return commands_agent.decorateServiceException(P,S.body)},"de_AccessDeniedExceptionRes"),de_AuthorizationPendingExceptionRes=I(async(S,E)=>{const y=commands_agent.map({}),C=S.body,_=commands_agent.take(C,{error:commands_agent.expectString,error_description:commands_agent.expectString});Object.assign(y,_);const P=new AuthorizationPendingException({$metadata:deserializeMetadata(S),...y});return commands_agent.decorateServiceException(P,S.body)},"de_AuthorizationPendingExceptionRes"),de_ExpiredTokenExceptionRes=I(async(S,E)=>{const y=commands_agent.map({}),C=S.body,_=commands_agent.take(C,{error:commands_agent.expectString,error_description:commands_agent.expectString});Object.assign(y,_);const P=new ExpiredTokenException({$metadata:deserializeMetadata(S),...y});return commands_agent.decorateServiceException(P,S.body)},"de_ExpiredTokenExceptionRes"),de_InternalServerExceptionRes=I(async(S,E)=>{const y=commands_agent.map({}),C=S.body,_=commands_agent.take(C,{error:commands_agent.expectString,error_description:commands_agent.expectString});Object.assign(y,_);const P=new InternalServerException({$metadata:deserializeMetadata(S),...y});return commands_agent.decorateServiceException(P,S.body)},"de_InternalServerExceptionRes"),de_InvalidClientExceptionRes=I(async(S,E)=>{const y=commands_agent.map({}),C=S.body,_=commands_agent.take(C,{error:commands_agent.expectString,error_description:commands_agent.expectString});Object.assign(y,_);const P=new InvalidClientException({$metadata:deserializeMetadata(S),...y});return commands_agent.decorateServiceException(P,S.body)},"de_InvalidClientExceptionRes"),de_InvalidGrantExceptionRes=I(async(S,E)=>{const y=commands_agent.map({}),C=S.body,_=commands_agent.take(C,{error:commands_agent.expectString,error_description:commands_agent.expectString});Object.assign(y,_);const P=new InvalidGrantException({$metadata:deserializeMetadata(S),...y});return commands_agent.decorateServiceException(P,S.body)},"de_InvalidGrantExceptionRes"),de_InvalidRequestExceptionRes=I(async(S,E)=>{const y=commands_agent.map({}),C=S.body,_=commands_agent.take(C,{error:commands_agent.expectString,error_description:commands_agent.expectString});Object.assign(y,_);const P=new InvalidRequestException({$metadata:deserializeMetadata(S),...y});return commands_agent.decorateServiceException(P,S.body)},"de_InvalidRequestExceptionRes"),de_InvalidScopeExceptionRes=I(async(S,E)=>{const y=commands_agent.map({}),C=S.body,_=commands_agent.take(C,{error:commands_agent.expectString,error_description:commands_agent.expectString});Object.assign(y,_);const P=new InvalidScopeException({$metadata:deserializeMetadata(S),...y});return commands_agent.decorateServiceException(P,S.body)},"de_InvalidScopeExceptionRes"),de_SlowDownExceptionRes=I(async(S,E)=>{const y=commands_agent.map({}),C=S.body,_=commands_agent.take(C,{error:commands_agent.expectString,error_description:commands_agent.expectString});Object.assign(y,_);const P=new SlowDownException({$metadata:deserializeMetadata(S),...y});return commands_agent.decorateServiceException(P,S.body)},"de_SlowDownExceptionRes"),de_UnauthorizedClientExceptionRes=I(async(S,E)=>{const y=commands_agent.map({}),C=S.body,_=commands_agent.take(C,{error:commands_agent.expectString,error_description:commands_agent.expectString});Object.assign(y,_);const P=new UnauthorizedClientException({$metadata:deserializeMetadata(S),...y});return commands_agent.decorateServiceException(P,S.body)},"de_UnauthorizedClientExceptionRes"),de_UnsupportedGrantTypeExceptionRes=I(async(S,E)=>{const y=commands_agent.map({}),C=S.body,_=commands_agent.take(C,{error:commands_agent.expectString,error_description:commands_agent.expectString});Object.assign(y,_);const P=new UnsupportedGrantTypeException({$metadata:deserializeMetadata(S),...y});return commands_agent.decorateServiceException(P,S.body)},"de_UnsupportedGrantTypeExceptionRes"),deserializeMetadata=I(S=>({httpStatusCode:S.statusCode,requestId:S.headers["x-amzn-requestid"]??S.headers["x-amzn-request-id"]??S.headers["x-amz-request-id"],extendedRequestId:S.headers["x-amz-id-2"],cfId:S.headers["x-amz-cf-id"]}),"deserializeMetadata");class CreateTokenCommand extends commands_agent.Command.classBuilder().ep(commonParams).m(function(E,y,C,_){return[commands_agent.getSerdePlugin(C,this.serialize,this.deserialize),commands_agent.getEndpointPlugin(C,E.getEndpointParameterInstructions())]}).s("AWSSSOOIDCService","CreateToken",{}).n("SSOOIDCClient","CreateTokenCommand").f(CreateTokenRequestFilterSensitiveLog,CreateTokenResponseFilterSensitiveLog).ser(se_CreateTokenCommand).de(de_CreateTokenCommand).build(){static{I(this,"CreateTokenCommand")}}const commands={CreateTokenCommand};class SSOOIDC extends SSOOIDCClient{static{I(this,"SSOOIDC")}}createAggregatedClient.createAggregatedClient(commands,SSOOIDC);exports.$Command=commands_agent.Command;exports.__Client=commands_agent.Client;exports.AccessDeniedException=AccessDeniedException;exports.AuthorizationPendingException=AuthorizationPendingException;exports.CreateTokenCommand=CreateTokenCommand;exports.CreateTokenRequestFilterSensitiveLog=CreateTokenRequestFilterSensitiveLog;exports.CreateTokenResponseFilterSensitiveLog=CreateTokenResponseFilterSensitiveLog;exports.ExpiredTokenException=ExpiredTokenException;exports.InternalServerException=InternalServerException;exports.InvalidClientException=InvalidClientException;exports.InvalidGrantException=InvalidGrantException;exports.InvalidRequestException=InvalidRequestException;exports.InvalidScopeException=InvalidScopeException;exports.SSOOIDC=SSOOIDC;exports.SSOOIDCClient=SSOOIDCClient;exports.SSOOIDCServiceException=SSOOIDCServiceException;exports.SlowDownException=SlowDownException;exports.UnauthorizedClientException=UnauthorizedClientException;exports.UnsupportedGrantTypeException=UnsupportedGrantTypeException;