gemi 0.4.78 → 0.4.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/app/App.d.ts +5 -10
  2. package/dist/app/App.d.ts.map +1 -1
  3. package/dist/app/index.js +60 -60
  4. package/dist/bin/index.js +104 -75
  5. package/dist/broadcasting/BroadcastingChannel.d.ts +5 -0
  6. package/dist/broadcasting/BroadcastingChannel.d.ts.map +1 -0
  7. package/dist/broadcasting/index.js +2 -0
  8. package/dist/chunk-02ba977a552fd2da.js +18 -0
  9. package/dist/chunk-0ba2cc302113ab40.js +3 -0
  10. package/dist/{chunk-28c7d04b6f555350.js → chunk-1e6b656dc70ab1fd.js} +2 -2
  11. package/dist/{chunk-e3d242546d1a2927.js → chunk-24a86f8f5ddc0cbd.js} +1 -1
  12. package/dist/chunk-2786cd9024d0d164.js +2 -0
  13. package/dist/chunk-357d6f34be7eafaa.js +2 -0
  14. package/dist/chunk-5075c75a0b45f02c.js +2 -0
  15. package/dist/{chunk-20e12a96dfe36b97.js → chunk-53b7d6267c9172bc.js} +1 -1
  16. package/dist/chunk-55c7fe17750b0378.js +9 -0
  17. package/dist/chunk-5ddf530ee3afe1d4.js +2 -0
  18. package/dist/{chunk-4e37f45d636da627.js → chunk-6a97611e6bd65152.js} +2 -2
  19. package/dist/chunk-7d5fe4acabfee228.js +2 -0
  20. package/dist/{chunk-9631e167bae739a0.js → chunk-813a4c185ab4c0c0.js} +1 -1
  21. package/dist/chunk-81fb135d80e84b06.js +2 -0
  22. package/dist/chunk-8ee09f1f74206a04.js +2 -0
  23. package/dist/chunk-9475c6ed18013dc8.js +2 -0
  24. package/dist/chunk-a7246b5b3e2f2366.js +2 -0
  25. package/dist/chunk-aebf7df48200842b.js +2 -0
  26. package/dist/chunk-b3b228374e54f4ff.js +6 -0
  27. package/dist/chunk-c22e0fc22de0403a.js +2 -0
  28. package/dist/chunk-e1a9177afdc46b3b.js +2 -0
  29. package/dist/chunk-e834f558250dac89.js +2 -0
  30. package/dist/chunk-e910e2a8677bca82.js +2 -0
  31. package/dist/chunk-f47acd04bf65c5c9.js +2 -0
  32. package/dist/{chunk-5ea45ebea038bef4.js → chunk-f9f264ce0c8e9699.js} +2 -2
  33. package/dist/{chunk-4ad752c87b795617.js → chunk-ff8cd8fd047cfee5.js} +2 -2
  34. package/dist/client/ClientRouter.d.ts.map +1 -1
  35. package/dist/client/HttpReload.d.ts.map +1 -1
  36. package/dist/client/WebsocketContext.d.ts +10 -0
  37. package/dist/client/WebsocketContext.d.ts.map +1 -0
  38. package/dist/client/index.d.ts +2 -0
  39. package/dist/client/index.d.ts.map +1 -1
  40. package/dist/client/index.js +114 -13
  41. package/dist/client/useBroadcast.d.ts +4 -0
  42. package/dist/client/useBroadcast.d.ts.map +1 -0
  43. package/dist/client/useQuery.d.ts.map +1 -1
  44. package/dist/client/useSearchParams.d.ts +1 -1
  45. package/dist/client/useSearchParams.d.ts.map +1 -1
  46. package/dist/client/useSubscription.d.ts +5 -0
  47. package/dist/client/useSubscription.d.ts.map +1 -0
  48. package/dist/email/Email.d.ts +12 -5
  49. package/dist/email/Email.d.ts.map +1 -1
  50. package/dist/email/index.d.ts +0 -2
  51. package/dist/email/index.d.ts.map +1 -1
  52. package/dist/email/index.js +1 -1
  53. package/dist/facades/Auth.d.ts.map +1 -1
  54. package/dist/facades/Broadcast.d.ts +6 -0
  55. package/dist/facades/Broadcast.d.ts.map +1 -0
  56. package/dist/facades/Prefetch.d.ts.map +1 -1
  57. package/dist/facades/index.d.ts +1 -0
  58. package/dist/facades/index.d.ts.map +1 -1
  59. package/dist/facades/index.js +1 -1
  60. package/dist/http/ApiRouter.d.ts.map +1 -1
  61. package/dist/http/BroadcastingRouter.d.ts +8 -0
  62. package/dist/http/BroadcastingRouter.d.ts.map +1 -0
  63. package/dist/http/HttpRequest.d.ts.map +1 -1
  64. package/dist/http/index.js +1 -1
  65. package/dist/kernel/Kernel.d.ts +9 -3
  66. package/dist/kernel/Kernel.d.ts.map +1 -1
  67. package/dist/kernel/context.d.ts +4 -2
  68. package/dist/kernel/context.d.ts.map +1 -1
  69. package/dist/kernel/index.js +1 -2
  70. package/dist/server/index.js +5 -5
  71. package/dist/services/ServiceContainer.d.ts +7 -0
  72. package/dist/services/ServiceContainer.d.ts.map +1 -0
  73. package/dist/services/email/EmailServiceContainer.d.ts +8 -0
  74. package/dist/services/email/EmailServiceContainer.d.ts.map +1 -0
  75. package/dist/services/email/EmailServiceProvider.d.ts +9 -0
  76. package/dist/services/email/EmailServiceProvider.d.ts.map +1 -0
  77. package/dist/services/email/drivers/EmailDriver.d.ts +5 -0
  78. package/dist/services/email/drivers/EmailDriver.d.ts.map +1 -0
  79. package/dist/services/email/drivers/ResendDriver.d.ts +8 -0
  80. package/dist/services/email/drivers/ResendDriver.d.ts.map +1 -0
  81. package/dist/{email → services/email/drivers}/types.d.ts +2 -3
  82. package/dist/services/email/drivers/types.d.ts.map +1 -0
  83. package/dist/services/index.d.ts +5 -0
  84. package/dist/services/index.d.ts.map +1 -1
  85. package/dist/services/index.js +1 -1
  86. package/dist/services/pubsub/BroadcastingServiceContainer.d.ts +24 -0
  87. package/dist/services/pubsub/BroadcastingServiceContainer.d.ts.map +1 -0
  88. package/dist/services/pubsub/BroadcastingServiceProvider.d.ts +7 -0
  89. package/dist/services/pubsub/BroadcastingServiceProvider.d.ts.map +1 -0
  90. package/dist/services/pubsub/types.d.ts +6 -0
  91. package/dist/services/pubsub/types.d.ts.map +1 -0
  92. package/dist/utils/applyParams.d.ts +1 -1
  93. package/dist/utils/applyParams.d.ts.map +1 -1
  94. package/package.json +4 -2
  95. package/dist/chunk-168ace6fc79b185b.js +0 -2
  96. package/dist/chunk-1c56f79378e4123d.js +0 -2
  97. package/dist/chunk-269dd2cd89aa1c32.js +0 -2
  98. package/dist/chunk-30daf610f498e198.js +0 -6
  99. package/dist/chunk-3abc648638ed6645.js +0 -18
  100. package/dist/chunk-48b2990a93ae50b3.js +0 -2
  101. package/dist/chunk-52dd5453e79e1cef.js +0 -2
  102. package/dist/chunk-5c1c113b94101135.js +0 -2
  103. package/dist/chunk-5fb9d31b7b4629e9.js +0 -1
  104. package/dist/chunk-8bf925705fdcef0c.js +0 -2
  105. package/dist/chunk-9c05674e98ebc485.js +0 -2
  106. package/dist/chunk-a5da5f8d6f9e8633.js +0 -2
  107. package/dist/chunk-b943cac32cc3670f.js +0 -2
  108. package/dist/chunk-d4eceea16ddc567d.js +0 -9
  109. package/dist/chunk-e64fe80074576b85.js +0 -2
  110. package/dist/chunk-f9d7921dc209275a.js +0 -2
  111. package/dist/email/EmailServiceProvider.d.ts +0 -8
  112. package/dist/email/EmailServiceProvider.d.ts.map +0 -1
  113. package/dist/email/EmailTemplate.d.ts +0 -22
  114. package/dist/email/EmailTemplate.d.ts.map +0 -1
  115. package/dist/email/providers.d.ts +0 -5
  116. package/dist/email/providers.d.ts.map +0 -1
  117. package/dist/email/types.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BroadcastingServiceContainer.d.ts","sourceRoot":"","sources":["../../../services/pubsub/BroadcastingServiceContainer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,KAAK,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEhD,KAAK,eAAe,GAAG,CAAC,GAAG,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;AAEtD,qBAAa,4BAA6B,SAAQ,gBAAgB;IAQ7C,OAAO,EAAE,2BAA2B;IAPvD,IAAI,SAAkC;IACtC,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO;iBACI,OAAO;iBACP,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;OACzB;gBAEc,OAAO,EAAE,2BAA2B;IAIvD,SAAS,CAAC,EAAE,EAAE,eAAe;IAI7B,OAAO,CAAC,GAAG,IAAI,EAAE,WAAW;IAKtB,aAAa,CACjB,EAAE,EAAE,eAAe,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC,EACzC,OAAO,EAAE,MAAM,GAAG,MAAM;IAgC1B,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,YAAY;CAYvC"}
@@ -0,0 +1,7 @@
1
+ import { ServiceProvider } from "../ServiceProvider";
2
+ import { BroadcastingChannel } from "../../broadcasting/BroadcastingChannel";
3
+ export declare class BroadcastingServiceProvider extends ServiceProvider {
4
+ channels: Record<string, new () => BroadcastingChannel>;
5
+ boot(): void;
6
+ }
7
+ //# sourceMappingURL=BroadcastingServiceProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BroadcastingServiceProvider.d.ts","sourceRoot":"","sources":["../../../services/pubsub/BroadcastingServiceProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAK7E,qBAAa,2BAA4B,SAAQ,eAAe;IAC9D,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,mBAAmB,CAAC,CAAM;IAE7D,IAAI;CACL"}
@@ -0,0 +1,6 @@
1
+ export type PublishArgs = [
2
+ topic: string,
3
+ data: string | ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
4
+ compress?: boolean
5
+ ];
6
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../services/pubsub/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,WAAW,GAAG,iBAAiB;IAChE,QAAQ,CAAC,EAAE,OAAO;CACnB,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare function applyParams<T extends string>(url: T, params: Record<string, string | undefined>): string;
1
+ export declare function applyParams<T extends string>(url: T, params: Record<string, string | number | undefined>): string;
2
2
  //# sourceMappingURL=applyParams.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"applyParams.d.ts","sourceRoot":"","sources":["../../utils/applyParams.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAC1C,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACzC,MAAM,CAiBR"}
1
+ {"version":3,"file":"applyParams.d.ts","sourceRoot":"","sources":["../../utils/applyParams.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,CAAC,SAAS,MAAM,EAC1C,GAAG,EAAE,CAAC,EACN,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC,GAClD,MAAM,CAiBR"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gemi",
3
- "version": "0.4.78",
3
+ "version": "0.4.80",
4
4
  "devDependencies": {
5
5
  "@babel/parser": "^7.25.4",
6
6
  "@repo/eslint-config": "*",
@@ -27,7 +27,8 @@
27
27
  "./runtime": "./dist/runtime/index.js",
28
28
  "./server": "./dist/server/index.js",
29
29
  "./kernel": "./dist/kernel/index.js",
30
- "./services": "./dist/services/index.js"
30
+ "./services": "./dist/services/index.js",
31
+ "./broadcasting": "./dist/broadcasting/index.js"
31
32
  },
32
33
  "files": [
33
34
  "dist/**/*"
@@ -51,6 +52,7 @@
51
52
  "@aws-sdk/client-s3": "^3.629.0",
52
53
  "@aws-sdk/s3-request-presigner": "^3.629.0",
53
54
  "@prisma/client": "5.17.0",
55
+ "@react-email/render": "1.0.0-canary.1",
54
56
  "ast-types": "^0.14.2",
55
57
  "commander": "^12.1.0",
56
58
  "history": "^5.3.0",
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-e3d242546d1a2927.js";import"./chunk-4e37f45d636da627.js";import{nb as i,ob as f} from"./chunk-5fb9d31b7b4629e9.js";import{tb as y,ub as K,vb as E,yb as C,zb as N} from"./chunk-9631e167bae739a0.js";var F=(e)=>e&&(typeof e.sso_start_url==="string"||typeof e.sso_account_id==="string"||typeof e.sso_session==="string"||typeof e.sso_region==="string"||typeof e.sso_role_name==="string");var L=300000,_="To refresh this SSO session run 'aws sso login' with the corresponding profile.";var I={},M=async(e)=>{const{SSOOIDCClient:r}=await import("./chunk-e64fe80074576b85.js");if(I[e])return I[e];const s=new r({region:e});return I[e]=s,s};var H=async(e,r)=>{const{CreateTokenCommand:s}=await import("./chunk-e64fe80074576b85.js");return(await M(r)).send(new s({clientId:e.clientId,clientSecret:e.clientSecret,refreshToken:e.refreshToken,grantType:"refresh_token"}))};var v=(e)=>{if(e.expiration&&e.expiration.getTime()<Date.now())throw new f(`Token is expired. ${_}`,!1)};var m=(e,r,s=!1)=>{if(typeof r==="undefined")throw new f(`Value not present for '${e}' in SSO Token${s?". Cannot refresh":""}. ${_}`,!1)};import{promises as W} from"fs";var{writeFile:j}=W,b=(e,r)=>{const s=K(e),t=JSON.stringify(r,null,2);return j(s,t)};var G=new Date(0),U=(e={})=>async()=>{e.logger?.debug("@aws-sdk/token-providers - fromSso");const r=await N(e),s=y(e),t=r[s];if(!t)throw new f(`Profile '${s}' could not be found in shared credentials file.`,!1);else if(!t.sso_session)throw new f(`Profile '${s}' is missing required property 'sso_session'.`);const a=t.sso_session,c=(await C(e))[a];if(!c)throw new f(`Sso session '${a}' could not be found in shared credentials file.`,!1);for(let n of["sso_start_url","sso_region"])if(!c[n])throw new f(`Sso session '${a}' is missing required property '${n}'.`,!1);const{sso_start_url:p,sso_region:S}=c;let o;try{o=await E(a)}catch(n){throw new f(`The SSO session token associated with profile=${s} was not found or is invalid. ${_}`,!1)}m("accessToken",o.accessToken),m("expiresAt",o.expiresAt);const{accessToken:x,expiresAt:u}=o,l={token:x,expiration:new Date(u)};if(l.expiration.getTime()-Date.now()>L)return l;if(Date.now()-G.getTime()<30000)return v(l),l;m("clientId",o.clientId,!0),m("clientSecret",o.clientSecret,!0),m("refreshToken",o.refreshToken,!0);try{G.setTime(Date.now());const n=await H(o,S);m("accessToken",n.accessToken),m("expiresIn",n.expiresIn);const h=new Date(Date.now()+n.expiresIn*1000);try{await b(a,{...o,accessToken:n.accessToken,expiresAt:h.toISOString(),refreshToken:n.refreshToken})}catch(O){}return{token:n.accessToken,expiration:h}}catch(n){return v(l),l}};var T=!1,P=async({ssoStartUrl:e,ssoSession:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:a,ssoClient:d,clientConfig:c,profile:p,logger:S})=>{let o;const x="To refresh this SSO session run aws sso login with the corresponding profile.";if(r)try{const g=await U({profile:p})();o={accessToken:g.token,expiresAt:new Date(g.expiration).toISOString()}}catch(g){throw new i(g.message,{tryNextLink:T,logger:S})}else try{o=await E(e)}catch(g){throw new i("The SSO session associated with this profile is invalid. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:T,logger:S})}if(new Date(o.expiresAt).getTime()-Date.now()<=0)throw new i("The SSO session associated with this profile has expired. To refresh this SSO session run aws sso login with the corresponding profile.",{tryNextLink:T,logger:S});const{accessToken:u}=o,{SSOClient:l,GetRoleCredentialsCommand:n}=await import("./chunk-a5da5f8d6f9e8633.js"),h=d||new l(Object.assign({},c??{},{region:c?.region??t}));let O;try{O=await h.send(new n({accountId:s,roleName:a,accessToken:u}))}catch(g){throw new i(g,{tryNextLink:T,logger:S})}const{roleCredentials:{accessKeyId:w,secretAccessKey:k,sessionToken:R,expiration:D,credentialScope:A,accountId:$}={}}=O;if(!w||!k||!R||!D)throw new i("SSO returns an invalid temporary credential.",{tryNextLink:T,logger:S});return{accessKeyId:w,secretAccessKey:k,sessionToken:R,expiration:new Date(D),...A&&{credentialScope:A},...$&&{accountId:$}}};var q=(e,r)=>{const{sso_start_url:s,sso_account_id:t,sso_region:a,sso_role_name:d}=e;if(!s||!t||!a||!d)throw new i('Profile is configured with invalid SSO credentials. Required parameters "sso_account_id", '+`"sso_region", "sso_role_name", "sso_start_url". Got ${Object.keys(e).join(", ")}\nReference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html`,{tryNextLink:!1,logger:r});return e};var Ee=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-sso - fromSSO");const{ssoStartUrl:r,ssoAccountId:s,ssoRegion:t,ssoRoleName:a,ssoSession:d}=e,{ssoClient:c}=e,p=y(e);if(!r&&!s&&!t&&!a&&!d){const o=(await N(e))[p];if(!o)throw new i(`Profile ${p} was not found.`,{logger:e.logger});if(!F(o))throw new i(`Profile ${p} is not configured with SSO credentials.`,{logger:e.logger});if(o?.sso_session){const w=(await C(e))[o.sso_session],k=` configurations in profile ${p} and sso-session ${o.sso_session}`;if(t&&t!==w.sso_region)throw new i("Conflicting SSO region"+k,{tryNextLink:!1,logger:e.logger});if(r&&r!==w.sso_start_url)throw new i("Conflicting SSO start_url"+k,{tryNextLink:!1,logger:e.logger});o.sso_region=w.sso_region,o.sso_start_url=w.sso_start_url}const{sso_start_url:x,sso_account_id:u,sso_region:l,sso_role_name:n,sso_session:h}=q(o,e.logger);return P({ssoStartUrl:x,ssoSession:h,ssoAccountId:u,ssoRegion:l,ssoRoleName:n,ssoClient:c,clientConfig:e.clientConfig,profile:p})}else if(!r||!s||!t||!a)throw new i('Incomplete configuration. The fromSSO() argument hash must include "ssoStartUrl", "ssoAccountId", "ssoRegion", "ssoRoleName"',{tryNextLink:!1,logger:e.logger});else return P({ssoStartUrl:r,ssoSession:d,ssoAccountId:s,ssoRegion:t,ssoRoleName:a,ssoClient:c,clientConfig:e.clientConfig,profile:p})};export{q as validateSsoProfile,F as isSsoProfile,Ee as fromSSO};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-e3d242546d1a2927.js";import"./chunk-4e37f45d636da627.js";import{nb as o} from"./chunk-5fb9d31b7b4629e9.js";import{tb as K,zb as S} from"./chunk-9631e167bae739a0.js";import{exec as _} from"child_process";import{promisify as y} from"util";var i=(c,n,s)=>{if(n.Version!==1)throw Error(`Profile ${c} credential_process did not return Version 1.`);if(n.AccessKeyId===void 0||n.SecretAccessKey===void 0)throw Error(`Profile ${c} credential_process returned invalid credentials.`);if(n.Expiration){const t=new Date;if(new Date(n.Expiration)<t)throw Error(`Profile ${c} credential_process returned expired credentials.`)}let e=n.AccountId;if(!e&&s?.[c]?.aws_account_id)e=s[c].aws_account_id;return{accessKeyId:n.AccessKeyId,secretAccessKey:n.SecretAccessKey,...n.SessionToken&&{sessionToken:n.SessionToken},...n.Expiration&&{expiration:new Date(n.Expiration)},...n.CredentialScope&&{credentialScope:n.CredentialScope},...e&&{accountId:e}}};var x=async(c,n,s)=>{const e=n[c];if(n[c]){const t=e.credential_process;if(t!==void 0){const u=y(_);try{const{stdout:r}=await u(t);let w;try{w=JSON.parse(r.trim())}catch{throw Error(`Profile ${c} credential_process returned invalid JSON.`)}return i(c,w,n)}catch(r){throw new o(r.message,{logger:s})}}else throw new o(`Profile ${c} did not contain credential_process.`,{logger:s})}else throw new o(`Profile ${c} could not be found in shared credentials file.`,{logger:s})};var $=(c={})=>async()=>{c.logger?.debug("@aws-sdk/credential-provider-process - fromProcess");const n=await S(c);return x(K(c),n,c.logger)};export{$ as fromProcess};
@@ -1,2 +0,0 @@
1
- // @bun
2
- import"./chunk-e3d242546d1a2927.js";import{nb as E} from"./chunk-5fb9d31b7b4629e9.js";import{readFileSync as l} from"fs";var t=(e)=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");const{roleArn:o,roleSessionName:r,webIdentityToken:n,providerId:c,policyArns:i,policy:_,durationSeconds:N}=e;let{roleAssumerWithWebIdentity:s}=e;if(!s){const{getDefaultRoleAssumerWithWebIdentity:d}=await import("./chunk-5c1c113b94101135.js");s=d({...e.clientConfig,credentialProviderLogger:e.logger,parentClientConfig:e.parentClientConfig},e.clientPlugins)}return s({RoleArn:o,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:c,PolicyArns:i,Policy:_,DurationSeconds:N})};var m="AWS_WEB_IDENTITY_TOKEN_FILE",S="AWS_ROLE_ARN",p="AWS_ROLE_SESSION_NAME",A=(e={})=>async()=>{e.logger?.debug("@aws-sdk/credential-provider-web-identity - fromTokenFile");const o=e?.webIdentityTokenFile??process.env[m],r=e?.roleArn??process.env[S],n=e?.roleSessionName??process.env[p];if(!o||!r)throw new E("Web identity configuration not specified",{logger:e.logger});return t({...e,webIdentityToken:l(o,{encoding:"ascii"}),roleArn:r,roleSessionName:n})()};export{t as fromWebToken,A as fromTokenFile};
@@ -1,6 +0,0 @@
1
- // @bun
2
- import"./chunk-e3d242546d1a2927.js";import{Da as I,Ga as y,Wa as C,pa as i} from"./chunk-28c7d04b6f555350.js";import"./chunk-4e37f45d636da627.js";import{nb as n} from"./chunk-5fb9d31b7b4629e9.js";import u from"fs/promises";var T="169.254.170.2",x="169.254.170.23",P="[fd00:ec2::23]",d=(e,c)=>{if(e.protocol==="https:")return;if(e.hostname===T||e.hostname===x||e.hostname===P)return;if(e.hostname.includes("[")){if(e.hostname==="[::1]"||e.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(e.hostname==="localhost")return;const a=e.hostname.split("."),r=(t)=>{const s=parseInt(t,10);return 0<=s&&s<=255};if(a[0]==="127"&&r(a[1])&&r(a[2])&&r(a[3])&&a.length===4)return}throw new n(`URL not accepted. It must either be HTTPS or match one of the following:
3
- - loopback CIDR 127.0.0.0/8 or [::1/128]
4
- - ECS container host 169.254.170.2
5
- - EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:c})};function S(e){return new i({protocol:e.protocol,hostname:e.hostname,port:Number(e.port),path:e.pathname,query:Array.from(e.searchParams.entries()).reduce((c,[a,r])=>{return c[a]=r,c},{}),fragment:e.hash})}async function g(e,c){const r=await y(e.body).transformToString();if(e.statusCode===200){const t=JSON.parse(r);if(typeof t.AccessKeyId!=="string"||typeof t.SecretAccessKey!=="string"||typeof t.Token!=="string"||typeof t.Expiration!=="string")throw new n("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:c});return{accessKeyId:t.AccessKeyId,secretAccessKey:t.SecretAccessKey,sessionToken:t.Token,expiration:C(t.Expiration)}}if(e.statusCode>=400&&e.statusCode<500){let t={};try{t=JSON.parse(r)}catch(s){}throw Object.assign(new n(`Server responded with status: ${e.statusCode}`,{logger:c}),{Code:t.Code,Message:t.Message})}throw new n(`Server responded with status: ${e.statusCode}`,{logger:c})}var w=(e,c,a)=>{return async()=>{for(let r=0;r<c;++r)try{return await e()}catch(t){await new Promise((s)=>setTimeout(s,a))}return await e()}};var E="AWS_CONTAINER_CREDENTIALS_RELATIVE_URI",R="http://169.254.170.2",p="AWS_CONTAINER_CREDENTIALS_FULL_URI",A="AWS_CONTAINER_AUTHORIZATION_TOKEN_FILE",O="AWS_CONTAINER_AUTHORIZATION_TOKEN",b=(e={})=>{e.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let c;const a=e.awsContainerCredentialsRelativeUri??process.env[E],r=e.awsContainerCredentialsFullUri??process.env[p],t=e.awsContainerAuthorizationToken??process.env[O],s=e.awsContainerAuthorizationTokenFile??process.env[A],m=e.logger?.constructor?.name==="NoOpLogger"||!e.logger?console.warn:e.logger.warn;if(a&&r)m("@aws-sdk/credential-provider-http: you have set both awsContainerCredentialsRelativeUri and awsContainerCredentialsFullUri."),m("awsContainerCredentialsFullUri will take precedence.");if(t&&s)m("@aws-sdk/credential-provider-http: you have set both awsContainerAuthorizationToken and awsContainerAuthorizationTokenFile."),m("awsContainerAuthorizationToken will take precedence.");if(r)c=r;else if(a)c=`${R}${a}`;else throw new n(`No HTTP credential provider host provided.
6
- Set AWS_CONTAINER_CREDENTIALS_FULL_URI or AWS_CONTAINER_CREDENTIALS_RELATIVE_URI.`,{logger:e.logger});const h=new URL(c);d(h,e.logger);const K=new I({requestTimeout:e.timeout??1000,connectionTimeout:e.timeout??1000});return w(async()=>{const o=S(h);if(t)o.headers.Authorization=t;else if(s)o.headers.Authorization=(await u.readFile(s)).toString();try{const f=await K.handle(o);return g(f.response)}catch(f){throw new n(String(f),{logger:e.logger})}},e.maxRetries??3,e.timeout??1000)};export{b as fromHttp};