franchising 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +9 -1
  2. package/dist/cli.js +109 -109
  3. package/dist/core-BidJDmSN.cjs +759 -0
  4. package/dist/core-BidJDmSN.cjs.map +1 -0
  5. package/dist/core-C-EFrEd6.js +710 -0
  6. package/dist/core-C-EFrEd6.js.map +1 -0
  7. package/dist/{index-Cj-10Q5F.d.cts → index--EJQTnHy.d.cts} +2 -2
  8. package/dist/index-B3aVdDMV.d.cts +51 -0
  9. package/dist/{index-CYT1PFzo.d.cts → index-BDYdEWl2.d.cts} +157 -3
  10. package/dist/{index-B3UOHsA9.d.ts → index-BDYdEWl2.d.ts} +157 -3
  11. package/dist/index-ByS2IC02.d.ts +51 -0
  12. package/dist/{index-C1KmT8dQ.d.ts → index-u3ArUXO0.d.ts} +2 -2
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.d.cts +1 -1
  15. package/dist/index.d.ts +1 -1
  16. package/dist/index.js +1 -1
  17. package/dist/messaging/index.cjs +1 -1
  18. package/dist/messaging/index.d.cts +1 -1
  19. package/dist/messaging/index.d.ts +1 -1
  20. package/dist/messaging/index.js +1 -1
  21. package/dist/sdk-B2Lp3JCz.cjs +45 -0
  22. package/dist/sdk-B2Lp3JCz.cjs.map +1 -0
  23. package/dist/sdk-IGOHpAeG.js +22 -0
  24. package/dist/sdk-IGOHpAeG.js.map +1 -0
  25. package/dist/sso/client.d.cts +1 -2
  26. package/dist/sso/client.d.ts +1 -2
  27. package/dist/sso/index.d.cts +1 -2
  28. package/dist/sso/index.d.ts +1 -2
  29. package/dist/sso/nestjs.d.cts +2 -2
  30. package/dist/sso/nestjs.d.ts +2 -2
  31. package/dist/sso/resource.d.cts +2 -2
  32. package/dist/sso/resource.d.ts +2 -2
  33. package/dist/telemetry/core.cjs +11 -0
  34. package/dist/telemetry/core.d.cts +4 -0
  35. package/dist/telemetry/core.d.ts +4 -0
  36. package/dist/telemetry/core.js +5 -0
  37. package/dist/telemetry/index.cjs +86 -799
  38. package/dist/telemetry/index.cjs.map +1 -1
  39. package/dist/telemetry/index.d.cts +9 -55
  40. package/dist/telemetry/index.d.ts +9 -55
  41. package/dist/telemetry/index.js +67 -773
  42. package/dist/telemetry/index.js.map +1 -1
  43. package/dist/telemetry/register.cjs +86 -4
  44. package/dist/telemetry/register.cjs.map +1 -0
  45. package/dist/telemetry/register.d.cts +4 -4
  46. package/dist/telemetry/register.d.ts +4 -4
  47. package/dist/telemetry/register.js +84 -2
  48. package/dist/telemetry/register.js.map +1 -0
  49. package/dist/version-B0ADow60.js +1 -0
  50. package/dist/{version-CfUi3iAV.cjs → version-CMkha8JJ.cjs} +1 -1
  51. package/package.json +18 -2
  52. package/dist/runtime-C95UYYLb.cjs +0 -111
  53. package/dist/runtime-C95UYYLb.cjs.map +0 -1
  54. package/dist/runtime-DG2oBFYw.js +0 -88
  55. package/dist/runtime-DG2oBFYw.js.map +0 -1
  56. package/dist/team-CJVAg4HH.d.cts +0 -157
  57. package/dist/team-CJVAg4HH.d.ts +0 -157
  58. package/dist/version-CPunTYCY.js +0 -1
@@ -1771,5 +1771,5 @@ export declare const MESSAGE_JSON_MAX_BYTES: number;
1771
1771
  /** Limite do `subject`, em caracteres. */
1772
1772
  export declare const MESSAGE_SUBJECT_MAX_LENGTH = 998;
1773
1773
  /** Versão do pacote `franchising`, a mesma do `package.json`. */
1774
- export declare const VERSION = "0.1.0";
1774
+ export declare const VERSION = "0.2.0";
1775
1775
  export { type AcceptedBatchMessage, type AcceptedDelivery, type AcceptedMessage, type AcceptedMessageRetry, type AcceptedWebPushDelivery, type AttachmentContent, type AttachmentContentInput, type AttachmentInput, type AttachmentUrlInput, type BatchRequestOptions, type BatchSendEmailInput, type BatchSendMessageOptions, type BatchSendSmsInput, type BatchSendWebPushInput, type BatchSendWhatsAppInput, type CreateWebPushSubscriptionTokenInput, type CreateWhatsAppTemplateOptions, type EmailAttachmentDisposition, type EmailAttachmentInput, type EmailAttachmentOptions, type EmailDestination, type FetchLike, type IsoDateTime, type JsonObject, type ListMessagesOptions, type ListedMessage, type ListedMessageChannel, type LooseString, type Message, type MessageAttachment, type MessageAttachmentSource, type MessageAttempt, type MessageAttemptOutcome, type MessageChannel, type MessageDeliveryStatus, type MessageDestination, type MessageEvent, type MessageEventType, type MessageListPayload, type MessagePriority, type MessageRetry, type MessageStatus, Messaging as default, type MessagingConfig, type MessagingErrorCode, type MessagingErrorOptions, type ProviderChannel, type ProviderId, type RequestOptions, type Result, type RetryMessageOptions, type SendEmailInput, type SendEmailOptions, type SendMessageOptions, type SendSmsInput, type SendSmsOptions, type SendWebPushInput, type SendWebPushOptions, type SendWhatsAppInput, type SendWhatsAppOptions, type SmsDestination, type SubmitWhatsAppTemplateOptions, type UpdateWhatsAppTemplateOptions, type WebPushDestination, type WebPushSubscriptionToken, type WebPushTarget, type WhatsAppAttachmentInput, type WhatsAppDestination, type WhatsAppMediaKind, type WhatsAppProviderTemplate, type WhatsAppTemplate, type WhatsAppTemplateCategory, type WhatsAppTemplateComponent, type WhatsAppTemplateStatus };
@@ -1771,5 +1771,5 @@ export declare const MESSAGE_JSON_MAX_BYTES: number;
1771
1771
  /** Limite do `subject`, em caracteres. */
1772
1772
  export declare const MESSAGE_SUBJECT_MAX_LENGTH = 998;
1773
1773
  /** Versão do pacote `franchising`, a mesma do `package.json`. */
1774
- export declare const VERSION = "0.1.0";
1774
+ export declare const VERSION = "0.2.0";
1775
1775
  export { type AcceptedBatchMessage, type AcceptedDelivery, type AcceptedMessage, type AcceptedMessageRetry, type AcceptedWebPushDelivery, type AttachmentContent, type AttachmentContentInput, type AttachmentInput, type AttachmentUrlInput, type BatchRequestOptions, type BatchSendEmailInput, type BatchSendMessageOptions, type BatchSendSmsInput, type BatchSendWebPushInput, type BatchSendWhatsAppInput, type CreateWebPushSubscriptionTokenInput, type CreateWhatsAppTemplateOptions, type EmailAttachmentDisposition, type EmailAttachmentInput, type EmailAttachmentOptions, type EmailDestination, type FetchLike, type IsoDateTime, type JsonObject, type ListMessagesOptions, type ListedMessage, type ListedMessageChannel, type LooseString, type Message, type MessageAttachment, type MessageAttachmentSource, type MessageAttempt, type MessageAttemptOutcome, type MessageChannel, type MessageDeliveryStatus, type MessageDestination, type MessageEvent, type MessageEventType, type MessageListPayload, type MessagePriority, type MessageRetry, type MessageStatus, Messaging as default, type MessagingConfig, type MessagingErrorCode, type MessagingErrorOptions, type ProviderChannel, type ProviderId, type RequestOptions, type Result, type RetryMessageOptions, type SendEmailInput, type SendEmailOptions, type SendMessageOptions, type SendSmsInput, type SendSmsOptions, type SendWebPushInput, type SendWebPushOptions, type SendWhatsAppInput, type SendWhatsAppOptions, type SmsDestination, type SubmitWhatsAppTemplateOptions, type UpdateWhatsAppTemplateOptions, type WebPushDestination, type WebPushSubscriptionToken, type WebPushTarget, type WhatsAppAttachmentInput, type WhatsAppDestination, type WhatsAppMediaKind, type WhatsAppProviderTemplate, type WhatsAppTemplate, type WhatsAppTemplateCategory, type WhatsAppTemplateComponent, type WhatsAppTemplateStatus };
@@ -1 +1 @@
1
- import{t as e}from"../version-CPunTYCY.js";const t=1048576,n=10,r=20*t,i=1,a=5*t,o=10*t,s=1024,c=2048,l=255,u=[`upload`,`url`],d=[`attachment`,`inline`],f=[`application/msword`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,`application/vnd.ms-excel`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,`application/vnd.ms-powerpoint`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],p=[`application/pdf`,`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`text/csv`,`text/plain`,...f,`application/vnd.oasis.opendocument.text`,`application/vnd.oasis.opendocument.spreadsheet`,`application/zip`,`text/calendar`],m=/* @__PURE__ */ `apk.app.bat.cmd.com.cpl.dll.dmg.exe.hta.jar.js.jse.lnk.msi.msp.pif.ps1.reg.scr.sh.vb.vbe.vbs.wsf.wsh`.split(`.`),h=[`image`,`video`,`audio`,`document`],g={image:[`image/jpeg`,`image/png`],video:[`video/mp4`,`video/3gpp`],audio:[`audio/aac`,`audio/mp4`,`audio/mpeg`,`audio/amr`,`audio/ogg`],document:[`application/pdf`,...f,`text/plain`,`text/csv`,`application/zip`]},_={image:a,video:o,audio:o,document:o},ee=/* @__PURE__ */ `UNAUTHENTICATED.INVALID_API_KEY.ACTIVE_PROJECT_REQUIRED.PROJECT_ROLE_REQUIRED.VALIDATION_ERROR.FROM_DOMAIN_NOT_VERIFIED.SENDER_NOT_FOUND.WHATSAPP_TEMPLATE_NOT_FOUND.WHATSAPP_TEMPLATE_CONFLICT.WHATSAPP_TEMPLATE_PROVIDER_UNSUPPORTED.WHATSAPP_TEMPLATE_SUBMISSION_FAILED.WHATSAPP_TEMPLATE_SYNC_FAILED.WHATSAPP_TEMPLATE_INVALID_STATE.WHATSAPP_TEMPLATE_BODY_CONFLICT.ATTACHMENTS_NOT_SUPPORTED_FOR_CHANNEL.ATTACHMENTS_PROVIDER_TEMPLATE_CONFLICT.ATTACHMENT_INVALID.ATTACHMENT_CONTENT_TYPE_NOT_ALLOWED.ATTACHMENT_TOO_LARGE.ATTACHMENTS_LIMIT_EXCEEDED.ATTACHMENT_URL_NOT_ALLOWED.WHATSAPP_CAPTION_INVALID.PAYLOAD_TOO_LARGE.ATTACHMENT_STORAGE_UNAVAILABLE.ATTACHMENT_STORAGE_NOT_CONFIGURED.ATTACHMENT_EXPIRED.MESSAGE_NOT_FOUND.MESSAGE_NOT_RETRYABLE.MESSAGE_CONTENT_EXPIRED.IDEMPOTENCY_KEY_REUSED.ROUTE_NOT_FOUND.INTERNAL_SERVER_ERROR.RATE_LIMIT_EXCEEDED.CONNECTION_ERROR.TIMEOUT.UNEXPECTED_RESPONSE`.split(`.`);var v=class extends Error{name=`MessagingError`;code;status;errors;constructor(e){super(e.message,{cause:e.cause}),this.code=e.code,this.status=e.status,this.errors=e.errors}get retryable(){return this.status===0||this.status===408||this.status===429||this.status>=500}toJSON(){return{name:this.name,code:this.code,message:this.message,status:this.status,...this.errors?{errors:this.errors}:{}}}},y=class extends v{name=`ValidationError`},b=class extends v{name=`AuthenticationError`},x=class extends v{name=`PermissionError`},S=class extends v{name=`NotFoundError`},C=class extends v{name=`RateLimitError`;retryAfter;constructor(e){super(e),this.retryAfter=e.retryAfter}},w=class extends v{name=`ServerError`},T=class extends v{name=`ConnectionError`},E=class extends v{name=`TimeoutError`};function te(e){return e instanceof v}function ne(e){let t={code:e.code,message:e.message,status:e.status,...e.errors?{errors:e.errors}:{}};return e.status===429?new C({...t,...e.retryAfter===void 0?{}:{retryAfter:e.retryAfter}}):e.status>=500?new w(t):e.status===401?new b(t):e.status===403?new x(t):e.status===404?new S(t):e.status===400||e.status===422?new y(t):new v(t)}function re(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0){if(Array.isArray(r))for(let e of r)t.append(n,String(e));else t.append(n,r instanceof Date?r.toISOString():String(r))}let n=t.toString();return n?`?${n}`:``}const D=8e3,ie=e=>new Promise(t=>setTimeout(t,e));function ae(e,t){if(t!==void 0)return Math.min(t*1e3,D);let n=Math.min(500*2**e,D);return Math.round(n*(.5+Math.random()*.5))}function oe(e){if(!e)return;let t=Number(e);if(Number.isFinite(t)&&t>=0)return t;let n=Date.parse(e);if(!Number.isNaN(n))return Math.max(0,Math.round((n-Date.now())/1e3))}function O(e){if(e.length===1)return e[0];let t=AbortSignal.any;if(t)return t(e);let n=new AbortController;for(let t of e){if(t.aborted){n.abort(t.reason);break}t.addEventListener(`abort`,()=>n.abort(t.reason),{once:!0})}return n.signal}function k(e){return{data:e,error:null}}function A(e){return{data:null,error:e}}const j=e,se=`rockdev-messaging-node/${j}`,ce=3e4,le=2;var ue=class{config;constructor(e){this.config=e}async request(e){let t=`${this.config.baseUrl}/v1${e.path}${e.query?re(e.query):``}`,n=e.method===`GET`||e.idempotencyKey!==void 0?this.config.maxRetries:0,r;for(let i=0;i<=n;i+=1){let a=await this.attempt(t,e);if(a.error===null)return a;if(r=a.error,!a.error.retryable||e.options?.signal?.aborted||i===n)break;await ie(ae(i,a.error.retryAfter))}return A(r)}async attempt(e,t){let n=t.options?.timeout??this.config.timeout,r=new AbortController,i=setTimeout(()=>r.abort(),n),a=[r.signal];t.options?.signal&&a.push(t.options.signal);let o;try{o=await this.config.fetch(e,{method:t.method,headers:this.headers(t),signal:O(a),...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(e){return t.options?.signal?.aborted?A(new v({code:`CONNECTION_ERROR`,message:`The request was aborted by the caller.`,status:0,cause:e})):r.signal.aborted?A(new E({code:`TIMEOUT`,message:`The request did not complete within ${n}ms.`,status:0,cause:e})):A(new T({code:`CONNECTION_ERROR`,message:e instanceof Error?e.message:`The request could not reach the Messaging API.`,status:0,cause:e}))}finally{clearTimeout(i)}return this.parse(o)}headers(e){let t=e=>Object.fromEntries(Object.entries(e).filter(([e])=>e.toLowerCase()!==`idempotency-key`));return{accept:`application/json`,authorization:`Bearer ${this.config.secret}`,"user-agent":se,...e.body===void 0?{}:{"content-type":`application/json`},...t(this.config.headers),...t(e.options?.headers??{}),...e.idempotencyKey===void 0?{}:{"idempotency-key":e.idempotencyKey}}}async parse(e){let t=await e.text().catch(()=>``),n;try{n=t?JSON.parse(t):void 0}catch{n=void 0}if(!e.ok){let t=oe(e.headers.get(`retry-after`));return A(ne({code:n?.code??`INTERNAL_SERVER_ERROR`,message:n?.message??`The Messaging API responded with ${e.status}.`,status:e.status,...n?.errors?{errors:n.errors}:{},...t===void 0?{}:{retryAfter:t}}))}return!n||n.data===void 0?A(new v({code:`UNEXPECTED_RESPONSE`,message:`The Messaging API responded without the expected body.`,status:e.status})):k(n.data)}},M=class{messages;constructor(e){this.messages=e}async send(e,t){let{to:n,...r}=e;return this.messages.send({...r,to:typeof n==`string`?{email:n}:n},t)}async batch(e,t){return this.messages.batch(e.map(({to:e,...t})=>({...t,to:typeof e==`string`?{email:e}:e})),t)}},N=class e{fetchPage;messages;nextCursor;constructor(e,t){this.fetchPage=t,this.messages=e.messages,this.nextCursor=e.nextCursor}get hasMore(){return this.nextCursor!==null}async next(){return this.nextCursor===null?{data:new e({messages:[],nextCursor:null},this.fetchPage),error:null}:this.fetchPage(this.nextCursor)}async*[Symbol.asyncIterator](){let e=this;for(;;){for(let t of e.messages)yield t;if(!e.hasMore)return;let{data:t,error:n}=await e.next();if(n)throw n;e=t}}};function P(e){if(e!==void 0)return e instanceof Date?e.toISOString():e}function de(e){return{status:e.status,channel:e.channel,to:e.to,search:e.search,scheduled:e.scheduled,createdAfter:P(e.createdAfter),createdBefore:P(e.createdBefore),limit:e.limit,cursor:e.cursor}}const F=24576;function fe(e){let t=globalThis.Buffer;if(t)return t.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`);let n=``;for(let t=0;t<e.length;t+=F){let r=e.subarray(t,t+F),i=``;for(let e=0;e<r.length;e+=1)i+=String.fromCharCode(r[e]);n+=btoa(i)}return n}function pe(e){let t=e.endsWith(`==`)?2:+!!e.endsWith(`=`);return e.length/4*3-t}function I(e){return typeof Blob<`u`&&e instanceof Blob}function L(e){return`email`in e&&e.email!==void 0?`email`:`whatsapp`in e&&e.whatsapp!==void 0?`whatsapp`:`sms`in e&&e.sms!==void 0?`sms`:`webpush`}function R(e){return typeof e==`string`?e.includes(`@`)?{email:e}:{whatsapp:e}:e}function z(e){let t=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(e);if(!t)return null;let[n,r]=[Number(t[1]),Number(t[2])];return n===0||n===10||n===127||n===100&&r>=64&&r<=127||n===169&&r===254||n===172&&r>=16&&r<=31||n===192&&r===168||n===198&&(r===18||r===19)||n>=224}function B(e){if(!e.startsWith(`[`))return null;let t=e.slice(1,-1).toLowerCase(),n=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/.exec(t);return n?.[1]?z(n[1])??!0:t===`::`||t===`::1`||t.startsWith(`::ffff:`)||/^f[cd]/.test(t)||/^fe[89ab]/.test(t)||t.startsWith(`ff`)}function me(e){try{return new URL(e)}catch{return null}}const he={pdf:`application/pdf`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,csv:`text/csv`,txt:`text/plain`,doc:`application/msword`,docx:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,xls:`application/vnd.ms-excel`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,ppt:`application/vnd.ms-powerpoint`,pptx:`application/vnd.openxmlformats-officedocument.presentationml.presentation`,odt:`application/vnd.oasis.opendocument.text`,ods:`application/vnd.oasis.opendocument.spreadsheet`,zip:`application/zip`,ics:`text/calendar`,mp4:`video/mp4`,"3gp":`video/3gpp`,aac:`audio/aac`,m4a:`audio/mp4`,mp3:`audio/mpeg`,amr:`audio/amr`,ogg:`audio/ogg`,opus:`audio/ogg`};function V(e){return(e.split(`;`)[0]??``).trim().toLowerCase()}function H(e){let t=e.lastIndexOf(`.`);return t<=0||t===e.length-1?``:e.slice(t+1).toLowerCase()}function ge(e){let t=V(e);for(let e of h)if(g[e].includes(t))return e;return null}function _e(e){return he[H(e.trim())]}const ve=/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*(\s*;.*)?$/i,ye=/^[A-Za-z0-9+/]*={0,2}$/,be=/[/\\\u0000-\u001f\u007f]/;var U=class{code;message;detail;constructor(e,t,n){this.code=e,this.message=t,this.detail=n}};function W(e,t,n=t){throw new U(e,t,n)}function xe(e,t){let n=e=>W(`ATTACHMENT_URL_NOT_ALLOWED`,`The attachment URL is not allowed: ${e}.`,`${t}.url ${e}`);e.length>2048&&n(`must be at most ${c} characters long`);let r=me(e)??n(`must be a valid URL`);r.protocol!==`https:`&&n(`must use https`),(r.username||r.password)&&n(`must not contain credentials`),r.port&&r.port!==`443`&&n(`must use the default port`);let i=r.hostname.toLowerCase().replace(/\.$/,``);(i===`localhost`||i.endsWith(`.localhost`)||i.endsWith(`.local`)||i.endsWith(`.internal`))&&n(`must not point to a local host`),!i.startsWith(`[`)&&!i.includes(`.`)&&n(`must use a fully qualified host name`),(z(i)||B(i))&&n(`must not point to a private address`)}async function Se(e,t){let n=e=>W(`ATTACHMENT_INVALID`,`The attachment is invalid.`,e);typeof e==`object`&&e||n(`${t} must be an object`);let{filename:r,disposition:i,contentId:a}=e;(typeof r!=`string`||r.trim()===``)&&n(`${t}.filename is required`),r.length>255&&n(`${t}.filename must be at most 255 characters long`),be.test(r)&&n(`${t}.filename must not contain path separators or control characters`);let o=`url`in e&&e.url!==void 0;o===(`content`in e&&e.content!==void 0)&&n(`${t} must have exactly one of url or content`),i!==void 0&&!d.includes(i)&&n(`${t}.disposition must be one of attachment, inline`),a!==void 0&&(typeof a!=`string`||a===``||a.length>255)&&n(`${t}.contentId must be a non-empty string of at most 255 characters`),i===`inline`&&(a??``).trim()===``&&n(`${t}.contentId is required for inline attachments`);let s={...i===void 0?{}:{disposition:i},...a===void 0?{}:{contentId:a}},c=e=>e===void 0||e.trim()===``?n(`${t}.contentType is required`):(ve.test(e)||n(`${t}.contentType must be a type/subtype MIME type`),e);if(o){let{url:i}=e;return typeof i==`string`?(xe(i,t),{body:{filename:r,contentType:c(e.contentType),url:i,...s},size:null}):n(`${t}.url must be a string`)}let{content:l}=e,u,f,p;if(typeof l==`string`)l.length%4==0&&ye.test(l)||n(`${t}.content must be valid base64`),u=l,f=pe(l);else{let e;if(l instanceof Uint8Array)e=l;else if(l instanceof ArrayBuffer)e=new Uint8Array(l);else if(ArrayBuffer.isView(l))e=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);else if(I(l))p=l.type||void 0,e=new Uint8Array(await l.arrayBuffer());else return n(`${t}.content must be a Uint8Array, ArrayBuffer, Blob or base64 string`);u=fe(e),f=e.byteLength}return{body:{filename:r,contentType:c(e.contentType??p??_e(r)),content:u,...s},size:f}}function Ce(e,t,n){if(e===`email`){t.length>10&&W(`ATTACHMENTS_LIMIT_EXCEEDED`,`An email accepts at most 10 attachments.`);let e=0;t.forEach(({body:t,size:n},r)=>{let i=`attachments.${r}`;p.includes(V(t.contentType))||W(`ATTACHMENT_CONTENT_TYPE_NOT_ALLOWED`,`The attachment content type is not allowed for email.`,`${i}.contentType ${V(t.contentType)} is not allowed`),m.includes(H(t.filename.trim()))&&W(`ATTACHMENT_CONTENT_TYPE_NOT_ALLOWED`,`The attachment file extension is not allowed.`,`${i}.filename has a blocked extension`),e+=n??0}),e>20971520&&W(`ATTACHMENT_TOO_LARGE`,`Email attachments must add up to at most ${r} bytes.`);return}t.length>1&&W(`ATTACHMENTS_LIMIT_EXCEEDED`,`A WhatsApp message accepts at most 1 attachment.`);let[i]=t;if(!i)return;let a=`attachments.0`;(i.body.disposition!==void 0||i.body.contentId!==void 0)&&W(`ATTACHMENT_INVALID`,`The attachment is invalid.`,`${a}.disposition and contentId are email-only`);let o=ge(i.body.contentType);o||W(`ATTACHMENT_CONTENT_TYPE_NOT_ALLOWED`,`The attachment content type is not allowed for WhatsApp.`,`${a}.contentType ${V(i.body.contentType)} is not allowed`);let c=_[o];i.size!==null&&i.size>c&&W(`ATTACHMENT_TOO_LARGE`,`WhatsApp ${o} attachments must be at most ${c} bytes.`),n!==void 0&&o===`audio`&&W(`WHATSAPP_CAPTION_INVALID`,`WhatsApp audio does not accept a caption.`,`content must be empty for audio attachments`),n!==void 0&&n.length>1024&&W(`WHATSAPP_CAPTION_INVALID`,`A WhatsApp caption must be at most ${s} characters long.`,`content must be at most ${s} characters long`)}async function we(e,t,n=``){try{let n=L(e.to);n!==`email`&&n!==`whatsapp`&&W(`ATTACHMENTS_NOT_SUPPORTED_FOR_CHANNEL`,`Attachments are not supported for the ${n} channel.`),e.providerTemplate!==void 0&&W(`ATTACHMENTS_PROVIDER_TEMPLATE_CONFLICT`,`Attachments cannot be combined with providerTemplate.`),Array.isArray(t)||W(`ATTACHMENT_INVALID`,`The attachment is invalid.`,`attachments must be an array`);let r=[];for(let[e,n]of t.entries())r.push(await Se(n,`attachments.${e}`));return Ce(n,r,e.content),k(r.map(({body:e})=>e))}catch(e){if(!(e instanceof U))throw e;return A(new y({code:e.code,message:e.message,status:400,errors:[`${n}${e.detail}`]}))}}function Te(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}async function G(e,t=``){let{to:n,sendAt:r,attachments:i,...a}=e,{idempotencyKey:o,...s}=a,c=R(n),l;if(i!==void 0&&i.length>0){let e=await we({to:c,content:s.content,providerTemplate:s.providerTemplate},i,t);if(e.error)return A(e.error);l=e.data}return k(Te({...s,to:c,sendAt:P(r),attachments:l}))}var K=class{http;constructor(e){this.http=e}async send(e,t){let n=await G(e);return n.error?A(n.error):this.http.request({method:`POST`,path:`/messages`,body:n.data,...e.idempotencyKey===void 0?{}:{idempotencyKey:e.idempotencyKey},...t?{options:t}:{}})}async batch(e,t){let{idempotencyKey:n,...r}=t??{},i=[];for(let[t,n]of e.entries()){let e=await G(n,`${t}.`);if(e.error)return A(e.error);i.push(e.data)}return this.http.request({method:`POST`,path:`/messages/batch`,body:i,...n===void 0?{}:{idempotencyKey:n},...t?{options:r}:{}})}async create(e,t){return this.send(e,t)}async retry(e,t,n){return this.http.request({method:`POST`,path:`/messages/${encodeURIComponent(e)}/retry`,idempotencyKey:t.idempotencyKey,...n?{options:n}:{}})}async get(e,t){return this.http.request({method:`GET`,path:`/messages/${encodeURIComponent(e)}`,...t?{options:t}:{}})}async retrieve(e,t){return this.get(e,t)}async list(e={},t){let{data:n,error:r}=await this.http.request({method:`GET`,path:`/messages`,query:de(e),...t?{options:t}:{}});return r?{data:null,error:r}:{data:new N(n,n=>this.list({...e,cursor:n},t)),error:null}}},q=class{messages;constructor(e){this.messages=e}async send(e,t){let{to:n,...r}=e;return this.messages.send({...r,to:typeof n==`string`?{sms:n}:n},t)}async batch(e,t){return this.messages.batch(e.map(({to:e,...t})=>({...t,to:typeof e==`string`?{sms:e}:e})),t)}},J=class{messages;http;constructor(e,t){this.messages=e,this.http=t}async createSubscriptionToken(e,t){return this.http.request({method:`POST`,path:`/webpush/subscription-tokens`,body:e,...t?{options:t}:{}})}async send(e,t){let{to:n,...r}=e;return this.messages.send({...r,to:{webpush:typeof n==`string`?{recipientId:n}:n}},t)}async batch(e,t){return this.messages.batch(e.map(({to:e,...t})=>({...t,to:{webpush:typeof e==`string`?{recipientId:e}:e}})),t)}},Y=class{messages;constructor(e){this.messages=e}async send(e,t){let{to:n,...r}=e;return this.messages.send({...r,to:typeof n==`string`?{whatsapp:n}:n},t)}async batch(e,t){return this.messages.batch(e.map(({to:e,...t})=>({...t,to:typeof e==`string`?{whatsapp:e}:e})),t)}},X=class{http;constructor(e){this.http=e}list(e={},t){return this.http.request({method:`GET`,path:`/whatsapp-templates`,query:{senderId:e.senderId},...t?{options:t}:{}})}get(e,t){return this.http.request({method:`GET`,path:`/whatsapp-templates/${encodeURIComponent(e)}`,...t?{options:t}:{}})}create(e,t){return this.http.request({method:`POST`,path:`/whatsapp-templates`,body:e,...t?{options:t}:{}})}update(e,t,n){return this.http.request({method:`PATCH`,path:`/whatsapp-templates/${encodeURIComponent(e)}`,body:t,...n?{options:n}:{}})}submit(e,t,n){return this.http.request({method:`POST`,path:`/whatsapp-templates/${encodeURIComponent(e)}/submit`,body:t,...n?{options:n}:{}})}sync(e,t){return this.http.request({method:`POST`,path:`/whatsapp-templates/sync`,body:e,...t?{options:t}:{}})}};function Ee(e){return(globalThis.process?.env?.[e])?.trim()||void 0}const De=`https://api.messaging.rockfeller.com.br`;var Z=class{messages;emails;whatsapp;whatsappTemplates;sms;webPush;constructor(e){let t=typeof e==`string`?{secret:e}:e,n=t.secret?.trim();if(!n)throw Error("Messaging: `secret` é obrigatório. Use a API key do projeto, por exemplo new Messaging({ secret: process.env.MESSAGING_API_KEY }).");let r=new ue({secret:n,baseUrl:(t.baseUrl??Ee(`MESSAGING_BASE_URL`)??`https://api.messaging.rockfeller.com.br`).replace(/\/+$/,``),timeout:t.timeout??3e4,maxRetries:t.maxRetries??2,headers:t.headers??{},fetch:t.fetch??((e,t)=>globalThis.fetch(e,t))});this.messages=new K(r),this.emails=new M(this.messages),this.whatsapp=new Y(this.messages),this.whatsappTemplates=new X(r),this.sms=new q(this.messages),this.webPush=new J(this.messages,r)}};const Oe=25,ke=100,Ae=100,je=262144,Me=1600,Ne=65536,Pe=998,Fe=[`email`,`whatsapp`,`sms`,`webpush`],Q=[`resend`,`unosend`,`twilio`,`meta`,`evolution`],Ie=[`normal`,`low`],Le=[`accepted`,`canceled`,`processing`,`sent`,`delivered`,`complained`,`bounced`,`suppressed`,`failed`],Re=[`pending`,`canceled`,`processing`,`sent`,`delivered`,`complained`,`bounced`,`suppressed`,`failed`],ze=[`delivered`,`complained`],Be=[`bounced`,`suppressed`,`failed`],$=[`canceled`,`delivered`,`complained`,`bounced`,`suppressed`,`failed`];function Ve(e){return $.includes(e)}const He=[`sent`,`failed`,`unknown`],Ue=[`email.sent`,`email.delivered`,`email.delivery_delayed`,`email.opened`,`email.clicked`,`email.bounced`,`email.complained`,`email.failed`,`email.suppressed`,`whatsapp.sent`,`whatsapp.delivered`,`whatsapp.read`,`whatsapp.failed`,`sms.sent`,`sms.delivered`,`sms.failed`,`sms.bounced`,`webpush.sent`,`webpush.failed`,`webpush.expired`],We=[`MARKETING`,`UTILITY`],Ge=[`DRAFT`,`SUBMITTING`,`SUBMISSION_UNKNOWN`,`PENDING`,`APPROVED`,`REJECTED`,`PAUSED`,`DISABLED`,`DELETED`];export{l as ATTACHMENT_FILENAME_MAX_LENGTH,c as ATTACHMENT_URL_MAX_LENGTH,b as AuthenticationError,m as BLOCKED_ATTACHMENT_EXTENSIONS,T as ConnectionError,De as DEFAULT_BASE_URL,le as DEFAULT_MAX_RETRIES,ce as DEFAULT_TIMEOUT_MS,n as EMAIL_ATTACHMENTS_MAX_COUNT,r as EMAIL_ATTACHMENTS_MAX_TOTAL_BYTES,p as EMAIL_ATTACHMENT_CONTENT_TYPES,d as EMAIL_ATTACHMENT_DISPOSITIONS,M as Emails,u as MESSAGE_ATTACHMENT_SOURCES,He as MESSAGE_ATTEMPT_OUTCOMES,Ae as MESSAGE_BATCH_MAX_SIZE,je as MESSAGE_BODY_MAX_BYTES,ze as MESSAGE_DELIVERED_STATUSES,Re as MESSAGE_DELIVERY_STATUSES,$ as MESSAGE_DELIVERY_TERMINAL_STATUSES,Ue as MESSAGE_EVENT_TYPES,Ne as MESSAGE_JSON_MAX_BYTES,Oe as MESSAGE_LIST_DEFAULT_LIMIT,ke as MESSAGE_LIST_MAX_LIMIT,Ie as MESSAGE_PRIORITIES,Le as MESSAGE_STATUSES,Pe as MESSAGE_SUBJECT_MAX_LENGTH,Be as MESSAGE_UNDELIVERED_STATUSES,ee as MESSAGING_ERROR_CODES,K as Messages,N as MessagesPage,Z as Messaging,Z as default,v as MessagingError,S as NotFoundError,Fe as PROVIDER_CHANNELS,Q as PROVIDER_IDS,x as PermissionError,C as RateLimitError,Me as SMS_CONTENT_MAX_LENGTH,w as ServerError,q as Sms,E as TimeoutError,j as VERSION,y as ValidationError,i as WHATSAPP_ATTACHMENTS_MAX_COUNT,s as WHATSAPP_CAPTION_MAX_LENGTH,a as WHATSAPP_IMAGE_MAX_BYTES,h as WHATSAPP_MEDIA_KINDS,o as WHATSAPP_MEDIA_MAX_BYTES,_ as WHATSAPP_MEDIA_MAX_BYTES_BY_KIND,g as WHATSAPP_MEDIA_TYPES,We as WHATSAPP_TEMPLATE_CATEGORIES,Ge as WHATSAPP_TEMPLATE_STATUSES,J as WebPush,Y as WhatsApp,X as WhatsAppTemplates,A as failure,te as isMessagingError,Ve as isTerminalDeliveryStatus,k as success};
1
+ import{t as e}from"../version-B0ADow60.js";const t=1048576,n=10,r=20*t,i=1,a=5*t,o=10*t,s=1024,c=2048,l=255,u=[`upload`,`url`],d=[`attachment`,`inline`],f=[`application/msword`,`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,`application/vnd.ms-excel`,`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,`application/vnd.ms-powerpoint`,`application/vnd.openxmlformats-officedocument.presentationml.presentation`],p=[`application/pdf`,`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`text/csv`,`text/plain`,...f,`application/vnd.oasis.opendocument.text`,`application/vnd.oasis.opendocument.spreadsheet`,`application/zip`,`text/calendar`],m=/* @__PURE__ */ `apk.app.bat.cmd.com.cpl.dll.dmg.exe.hta.jar.js.jse.lnk.msi.msp.pif.ps1.reg.scr.sh.vb.vbe.vbs.wsf.wsh`.split(`.`),h=[`image`,`video`,`audio`,`document`],g={image:[`image/jpeg`,`image/png`],video:[`video/mp4`,`video/3gpp`],audio:[`audio/aac`,`audio/mp4`,`audio/mpeg`,`audio/amr`,`audio/ogg`],document:[`application/pdf`,...f,`text/plain`,`text/csv`,`application/zip`]},_={image:a,video:o,audio:o,document:o},ee=/* @__PURE__ */ `UNAUTHENTICATED.INVALID_API_KEY.ACTIVE_PROJECT_REQUIRED.PROJECT_ROLE_REQUIRED.VALIDATION_ERROR.FROM_DOMAIN_NOT_VERIFIED.SENDER_NOT_FOUND.WHATSAPP_TEMPLATE_NOT_FOUND.WHATSAPP_TEMPLATE_CONFLICT.WHATSAPP_TEMPLATE_PROVIDER_UNSUPPORTED.WHATSAPP_TEMPLATE_SUBMISSION_FAILED.WHATSAPP_TEMPLATE_SYNC_FAILED.WHATSAPP_TEMPLATE_INVALID_STATE.WHATSAPP_TEMPLATE_BODY_CONFLICT.ATTACHMENTS_NOT_SUPPORTED_FOR_CHANNEL.ATTACHMENTS_PROVIDER_TEMPLATE_CONFLICT.ATTACHMENT_INVALID.ATTACHMENT_CONTENT_TYPE_NOT_ALLOWED.ATTACHMENT_TOO_LARGE.ATTACHMENTS_LIMIT_EXCEEDED.ATTACHMENT_URL_NOT_ALLOWED.WHATSAPP_CAPTION_INVALID.PAYLOAD_TOO_LARGE.ATTACHMENT_STORAGE_UNAVAILABLE.ATTACHMENT_STORAGE_NOT_CONFIGURED.ATTACHMENT_EXPIRED.MESSAGE_NOT_FOUND.MESSAGE_NOT_RETRYABLE.MESSAGE_CONTENT_EXPIRED.IDEMPOTENCY_KEY_REUSED.ROUTE_NOT_FOUND.INTERNAL_SERVER_ERROR.RATE_LIMIT_EXCEEDED.CONNECTION_ERROR.TIMEOUT.UNEXPECTED_RESPONSE`.split(`.`);var v=class extends Error{name=`MessagingError`;code;status;errors;constructor(e){super(e.message,{cause:e.cause}),this.code=e.code,this.status=e.status,this.errors=e.errors}get retryable(){return this.status===0||this.status===408||this.status===429||this.status>=500}toJSON(){return{name:this.name,code:this.code,message:this.message,status:this.status,...this.errors?{errors:this.errors}:{}}}},y=class extends v{name=`ValidationError`},b=class extends v{name=`AuthenticationError`},x=class extends v{name=`PermissionError`},S=class extends v{name=`NotFoundError`},C=class extends v{name=`RateLimitError`;retryAfter;constructor(e){super(e),this.retryAfter=e.retryAfter}},w=class extends v{name=`ServerError`},T=class extends v{name=`ConnectionError`},E=class extends v{name=`TimeoutError`};function te(e){return e instanceof v}function ne(e){let t={code:e.code,message:e.message,status:e.status,...e.errors?{errors:e.errors}:{}};return e.status===429?new C({...t,...e.retryAfter===void 0?{}:{retryAfter:e.retryAfter}}):e.status>=500?new w(t):e.status===401?new b(t):e.status===403?new x(t):e.status===404?new S(t):e.status===400||e.status===422?new y(t):new v(t)}function re(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))if(r!==void 0){if(Array.isArray(r))for(let e of r)t.append(n,String(e));else t.append(n,r instanceof Date?r.toISOString():String(r))}let n=t.toString();return n?`?${n}`:``}const D=8e3,ie=e=>new Promise(t=>setTimeout(t,e));function ae(e,t){if(t!==void 0)return Math.min(t*1e3,D);let n=Math.min(500*2**e,D);return Math.round(n*(.5+Math.random()*.5))}function oe(e){if(!e)return;let t=Number(e);if(Number.isFinite(t)&&t>=0)return t;let n=Date.parse(e);if(!Number.isNaN(n))return Math.max(0,Math.round((n-Date.now())/1e3))}function O(e){if(e.length===1)return e[0];let t=AbortSignal.any;if(t)return t(e);let n=new AbortController;for(let t of e){if(t.aborted){n.abort(t.reason);break}t.addEventListener(`abort`,()=>n.abort(t.reason),{once:!0})}return n.signal}function k(e){return{data:e,error:null}}function A(e){return{data:null,error:e}}const j=e,se=`rockdev-messaging-node/${j}`,ce=3e4,le=2;var ue=class{config;constructor(e){this.config=e}async request(e){let t=`${this.config.baseUrl}/v1${e.path}${e.query?re(e.query):``}`,n=e.method===`GET`||e.idempotencyKey!==void 0?this.config.maxRetries:0,r;for(let i=0;i<=n;i+=1){let a=await this.attempt(t,e);if(a.error===null)return a;if(r=a.error,!a.error.retryable||e.options?.signal?.aborted||i===n)break;await ie(ae(i,a.error.retryAfter))}return A(r)}async attempt(e,t){let n=t.options?.timeout??this.config.timeout,r=new AbortController,i=setTimeout(()=>r.abort(),n),a=[r.signal];t.options?.signal&&a.push(t.options.signal);let o;try{o=await this.config.fetch(e,{method:t.method,headers:this.headers(t),signal:O(a),...t.body===void 0?{}:{body:JSON.stringify(t.body)}})}catch(e){return t.options?.signal?.aborted?A(new v({code:`CONNECTION_ERROR`,message:`The request was aborted by the caller.`,status:0,cause:e})):r.signal.aborted?A(new E({code:`TIMEOUT`,message:`The request did not complete within ${n}ms.`,status:0,cause:e})):A(new T({code:`CONNECTION_ERROR`,message:e instanceof Error?e.message:`The request could not reach the Messaging API.`,status:0,cause:e}))}finally{clearTimeout(i)}return this.parse(o)}headers(e){let t=e=>Object.fromEntries(Object.entries(e).filter(([e])=>e.toLowerCase()!==`idempotency-key`));return{accept:`application/json`,authorization:`Bearer ${this.config.secret}`,"user-agent":se,...e.body===void 0?{}:{"content-type":`application/json`},...t(this.config.headers),...t(e.options?.headers??{}),...e.idempotencyKey===void 0?{}:{"idempotency-key":e.idempotencyKey}}}async parse(e){let t=await e.text().catch(()=>``),n;try{n=t?JSON.parse(t):void 0}catch{n=void 0}if(!e.ok){let t=oe(e.headers.get(`retry-after`));return A(ne({code:n?.code??`INTERNAL_SERVER_ERROR`,message:n?.message??`The Messaging API responded with ${e.status}.`,status:e.status,...n?.errors?{errors:n.errors}:{},...t===void 0?{}:{retryAfter:t}}))}return!n||n.data===void 0?A(new v({code:`UNEXPECTED_RESPONSE`,message:`The Messaging API responded without the expected body.`,status:e.status})):k(n.data)}},M=class{messages;constructor(e){this.messages=e}async send(e,t){let{to:n,...r}=e;return this.messages.send({...r,to:typeof n==`string`?{email:n}:n},t)}async batch(e,t){return this.messages.batch(e.map(({to:e,...t})=>({...t,to:typeof e==`string`?{email:e}:e})),t)}},N=class e{fetchPage;messages;nextCursor;constructor(e,t){this.fetchPage=t,this.messages=e.messages,this.nextCursor=e.nextCursor}get hasMore(){return this.nextCursor!==null}async next(){return this.nextCursor===null?{data:new e({messages:[],nextCursor:null},this.fetchPage),error:null}:this.fetchPage(this.nextCursor)}async*[Symbol.asyncIterator](){let e=this;for(;;){for(let t of e.messages)yield t;if(!e.hasMore)return;let{data:t,error:n}=await e.next();if(n)throw n;e=t}}};function P(e){if(e!==void 0)return e instanceof Date?e.toISOString():e}function de(e){return{status:e.status,channel:e.channel,to:e.to,search:e.search,scheduled:e.scheduled,createdAfter:P(e.createdAfter),createdBefore:P(e.createdBefore),limit:e.limit,cursor:e.cursor}}const F=24576;function fe(e){if(typeof e.toBase64==`function`)return e.toBase64();let t=globalThis.Buffer;if(t)return t.from(e.buffer,e.byteOffset,e.byteLength).toString(`base64`);let n=``;for(let t=0;t<e.length;t+=F){let r=e.subarray(t,t+F),i=``;for(let e=0;e<r.length;e+=1)i+=String.fromCharCode(r[e]);n+=btoa(i)}return n}function pe(e){let t=e.endsWith(`==`)?2:+!!e.endsWith(`=`);return e.length/4*3-t}function I(e){return typeof Blob<`u`&&e instanceof Blob}function L(e){return`email`in e&&e.email!==void 0?`email`:`whatsapp`in e&&e.whatsapp!==void 0?`whatsapp`:`sms`in e&&e.sms!==void 0?`sms`:`webpush`}function R(e){return typeof e==`string`?e.includes(`@`)?{email:e}:{whatsapp:e}:e}function z(e){let t=/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(e);if(!t)return null;let[n,r]=[Number(t[1]),Number(t[2])];return n===0||n===10||n===127||n===100&&r>=64&&r<=127||n===169&&r===254||n===172&&r>=16&&r<=31||n===192&&r===168||n===198&&(r===18||r===19)||n>=224}function B(e){if(!e.startsWith(`[`))return null;let t=e.slice(1,-1).toLowerCase(),n=/^::ffff:(\d+\.\d+\.\d+\.\d+)$/.exec(t);return n?.[1]?z(n[1])??!0:t===`::`||t===`::1`||t.startsWith(`::ffff:`)||/^f[cd]/.test(t)||/^fe[89ab]/.test(t)||t.startsWith(`ff`)}function me(e){try{return new URL(e)}catch{return null}}const he={pdf:`application/pdf`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,csv:`text/csv`,txt:`text/plain`,doc:`application/msword`,docx:`application/vnd.openxmlformats-officedocument.wordprocessingml.document`,xls:`application/vnd.ms-excel`,xlsx:`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,ppt:`application/vnd.ms-powerpoint`,pptx:`application/vnd.openxmlformats-officedocument.presentationml.presentation`,odt:`application/vnd.oasis.opendocument.text`,ods:`application/vnd.oasis.opendocument.spreadsheet`,zip:`application/zip`,ics:`text/calendar`,mp4:`video/mp4`,"3gp":`video/3gpp`,aac:`audio/aac`,m4a:`audio/mp4`,mp3:`audio/mpeg`,amr:`audio/amr`,ogg:`audio/ogg`,opus:`audio/ogg`};function V(e){return(e.split(`;`)[0]??``).trim().toLowerCase()}function H(e){let t=e.lastIndexOf(`.`);return t<=0||t===e.length-1?``:e.slice(t+1).toLowerCase()}function ge(e){let t=V(e);for(let e of h)if(g[e].includes(t))return e;return null}function _e(e){return he[H(e.trim())]}const ve=/^[a-z0-9][a-z0-9!#$&^_.+-]*\/[a-z0-9][a-z0-9!#$&^_.+-]*(\s*;.*)?$/i,ye=/^[A-Za-z0-9+/]*={0,2}$/,be=/[/\\\u0000-\u001f\u007f]/;var U=class{code;message;detail;constructor(e,t,n){this.code=e,this.message=t,this.detail=n}};function W(e,t,n=t){throw new U(e,t,n)}function xe(e,t){let n=e=>W(`ATTACHMENT_URL_NOT_ALLOWED`,`The attachment URL is not allowed: ${e}.`,`${t}.url ${e}`);e.length>2048&&n(`must be at most ${c} characters long`);let r=me(e)??n(`must be a valid URL`);r.protocol!==`https:`&&n(`must use https`),(r.username||r.password)&&n(`must not contain credentials`),r.port&&r.port!==`443`&&n(`must use the default port`);let i=r.hostname.toLowerCase().replace(/\.$/,``);(i===`localhost`||i.endsWith(`.localhost`)||i.endsWith(`.local`)||i.endsWith(`.internal`))&&n(`must not point to a local host`),!i.startsWith(`[`)&&!i.includes(`.`)&&n(`must use a fully qualified host name`),(z(i)||B(i))&&n(`must not point to a private address`)}async function Se(e,t){let n=e=>W(`ATTACHMENT_INVALID`,`The attachment is invalid.`,e);typeof e==`object`&&e||n(`${t} must be an object`);let{filename:r,disposition:i,contentId:a}=e;(typeof r!=`string`||r.trim()===``)&&n(`${t}.filename is required`),r.length>255&&n(`${t}.filename must be at most 255 characters long`),be.test(r)&&n(`${t}.filename must not contain path separators or control characters`);let o=`url`in e&&e.url!==void 0;o===(`content`in e&&e.content!==void 0)&&n(`${t} must have exactly one of url or content`),i!==void 0&&!d.includes(i)&&n(`${t}.disposition must be one of attachment, inline`),a!==void 0&&(typeof a!=`string`||a===``||a.length>255)&&n(`${t}.contentId must be a non-empty string of at most 255 characters`),i===`inline`&&(a??``).trim()===``&&n(`${t}.contentId is required for inline attachments`);let s={...i===void 0?{}:{disposition:i},...a===void 0?{}:{contentId:a}},c=e=>e===void 0||e.trim()===``?n(`${t}.contentType is required`):(ve.test(e)||n(`${t}.contentType must be a type/subtype MIME type`),e);if(o){let{url:i}=e;return typeof i==`string`?(xe(i,t),{body:{filename:r,contentType:c(e.contentType),url:i,...s},size:null}):n(`${t}.url must be a string`)}let{content:l}=e,u,f,p;if(typeof l==`string`)l.length%4==0&&ye.test(l)||n(`${t}.content must be valid base64`),u=l,f=pe(l);else{let e;if(l instanceof Uint8Array)e=l;else if(l instanceof ArrayBuffer)e=new Uint8Array(l);else if(ArrayBuffer.isView(l))e=new Uint8Array(l.buffer,l.byteOffset,l.byteLength);else if(I(l))p=l.type||void 0,e=new Uint8Array(await l.arrayBuffer());else return n(`${t}.content must be a Uint8Array, ArrayBuffer, Blob or base64 string`);u=fe(e),f=e.byteLength}return{body:{filename:r,contentType:c(e.contentType??p??_e(r)),content:u,...s},size:f}}function Ce(e,t,n){if(e===`email`){t.length>10&&W(`ATTACHMENTS_LIMIT_EXCEEDED`,`An email accepts at most 10 attachments.`);let e=0;t.forEach(({body:t,size:n},r)=>{let i=`attachments.${r}`;p.includes(V(t.contentType))||W(`ATTACHMENT_CONTENT_TYPE_NOT_ALLOWED`,`The attachment content type is not allowed for email.`,`${i}.contentType ${V(t.contentType)} is not allowed`),m.includes(H(t.filename.trim()))&&W(`ATTACHMENT_CONTENT_TYPE_NOT_ALLOWED`,`The attachment file extension is not allowed.`,`${i}.filename has a blocked extension`),e+=n??0}),e>20971520&&W(`ATTACHMENT_TOO_LARGE`,`Email attachments must add up to at most ${r} bytes.`);return}t.length>1&&W(`ATTACHMENTS_LIMIT_EXCEEDED`,`A WhatsApp message accepts at most 1 attachment.`);let[i]=t;if(!i)return;let a=`attachments.0`;(i.body.disposition!==void 0||i.body.contentId!==void 0)&&W(`ATTACHMENT_INVALID`,`The attachment is invalid.`,`${a}.disposition and contentId are email-only`);let o=ge(i.body.contentType);o||W(`ATTACHMENT_CONTENT_TYPE_NOT_ALLOWED`,`The attachment content type is not allowed for WhatsApp.`,`${a}.contentType ${V(i.body.contentType)} is not allowed`);let c=_[o];i.size!==null&&i.size>c&&W(`ATTACHMENT_TOO_LARGE`,`WhatsApp ${o} attachments must be at most ${c} bytes.`),n!==void 0&&o===`audio`&&W(`WHATSAPP_CAPTION_INVALID`,`WhatsApp audio does not accept a caption.`,`content must be empty for audio attachments`),n!==void 0&&n.length>1024&&W(`WHATSAPP_CAPTION_INVALID`,`A WhatsApp caption must be at most ${s} characters long.`,`content must be at most ${s} characters long`)}async function we(e,t,n=``){try{let n=L(e.to);n!==`email`&&n!==`whatsapp`&&W(`ATTACHMENTS_NOT_SUPPORTED_FOR_CHANNEL`,`Attachments are not supported for the ${n} channel.`),e.providerTemplate!==void 0&&W(`ATTACHMENTS_PROVIDER_TEMPLATE_CONFLICT`,`Attachments cannot be combined with providerTemplate.`),Array.isArray(t)||W(`ATTACHMENT_INVALID`,`The attachment is invalid.`,`attachments must be an array`);let r=[];for(let[e,n]of t.entries())r.push(await Se(n,`attachments.${e}`));return Ce(n,r,e.content),k(r.map(({body:e})=>e))}catch(e){if(!(e instanceof U))throw e;return A(new y({code:e.code,message:e.message,status:400,errors:[`${n}${e.detail}`]}))}}function Te(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>e!==void 0))}async function G(e,t=``){let{to:n,sendAt:r,attachments:i,...a}=e,{idempotencyKey:o,...s}=a,c=R(n),l;if(i!==void 0&&i.length>0){let e=await we({to:c,content:s.content,providerTemplate:s.providerTemplate},i,t);if(e.error)return A(e.error);l=e.data}return k(Te({...s,to:c,sendAt:P(r),attachments:l}))}var K=class{http;constructor(e){this.http=e}async send(e,t){let n=await G(e);return n.error?A(n.error):this.http.request({method:`POST`,path:`/messages`,body:n.data,...e.idempotencyKey===void 0?{}:{idempotencyKey:e.idempotencyKey},...t?{options:t}:{}})}async batch(e,t){let{idempotencyKey:n,...r}=t??{},i=[];for(let[t,n]of e.entries()){let e=await G(n,`${t}.`);if(e.error)return A(e.error);i.push(e.data)}return this.http.request({method:`POST`,path:`/messages/batch`,body:i,...n===void 0?{}:{idempotencyKey:n},...t?{options:r}:{}})}async create(e,t){return this.send(e,t)}async retry(e,t,n){return this.http.request({method:`POST`,path:`/messages/${encodeURIComponent(e)}/retry`,idempotencyKey:t.idempotencyKey,...n?{options:n}:{}})}async get(e,t){return this.http.request({method:`GET`,path:`/messages/${encodeURIComponent(e)}`,...t?{options:t}:{}})}async retrieve(e,t){return this.get(e,t)}async list(e={},t){let{data:n,error:r}=await this.http.request({method:`GET`,path:`/messages`,query:de(e),...t?{options:t}:{}});return r?{data:null,error:r}:{data:new N(n,n=>this.list({...e,cursor:n},t)),error:null}}},q=class{messages;constructor(e){this.messages=e}async send(e,t){let{to:n,...r}=e;return this.messages.send({...r,to:typeof n==`string`?{sms:n}:n},t)}async batch(e,t){return this.messages.batch(e.map(({to:e,...t})=>({...t,to:typeof e==`string`?{sms:e}:e})),t)}},J=class{messages;http;constructor(e,t){this.messages=e,this.http=t}async createSubscriptionToken(e,t){return this.http.request({method:`POST`,path:`/webpush/subscription-tokens`,body:e,...t?{options:t}:{}})}async send(e,t){let{to:n,...r}=e;return this.messages.send({...r,to:{webpush:typeof n==`string`?{recipientId:n}:n}},t)}async batch(e,t){return this.messages.batch(e.map(({to:e,...t})=>({...t,to:{webpush:typeof e==`string`?{recipientId:e}:e}})),t)}},Y=class{messages;constructor(e){this.messages=e}async send(e,t){let{to:n,...r}=e;return this.messages.send({...r,to:typeof n==`string`?{whatsapp:n}:n},t)}async batch(e,t){return this.messages.batch(e.map(({to:e,...t})=>({...t,to:typeof e==`string`?{whatsapp:e}:e})),t)}},X=class{http;constructor(e){this.http=e}list(e={},t){return this.http.request({method:`GET`,path:`/whatsapp-templates`,query:{senderId:e.senderId},...t?{options:t}:{}})}get(e,t){return this.http.request({method:`GET`,path:`/whatsapp-templates/${encodeURIComponent(e)}`,...t?{options:t}:{}})}create(e,t){return this.http.request({method:`POST`,path:`/whatsapp-templates`,body:e,...t?{options:t}:{}})}update(e,t,n){return this.http.request({method:`PATCH`,path:`/whatsapp-templates/${encodeURIComponent(e)}`,body:t,...n?{options:n}:{}})}submit(e,t,n){return this.http.request({method:`POST`,path:`/whatsapp-templates/${encodeURIComponent(e)}/submit`,body:t,...n?{options:n}:{}})}sync(e,t){return this.http.request({method:`POST`,path:`/whatsapp-templates/sync`,body:e,...t?{options:t}:{}})}};function Ee(e){return(globalThis.process?.env?.[e])?.trim()||void 0}const De=`https://api.messaging.rockfeller.com.br`;var Z=class{messages;emails;whatsapp;whatsappTemplates;sms;webPush;constructor(e){let t=typeof e==`string`?{secret:e}:e,n=t.secret?.trim();if(!n)throw Error("Messaging: `secret` é obrigatório. Use a API key do projeto, por exemplo new Messaging({ secret: process.env.MESSAGING_API_KEY }).");let r=new ue({secret:n,baseUrl:(t.baseUrl??Ee(`MESSAGING_BASE_URL`)??`https://api.messaging.rockfeller.com.br`).replace(/\/+$/,``),timeout:t.timeout??3e4,maxRetries:t.maxRetries??2,headers:t.headers??{},fetch:t.fetch??((e,t)=>globalThis.fetch(e,t))});this.messages=new K(r),this.emails=new M(this.messages),this.whatsapp=new Y(this.messages),this.whatsappTemplates=new X(r),this.sms=new q(this.messages),this.webPush=new J(this.messages,r)}};const Oe=25,ke=100,Ae=100,je=262144,Me=1600,Ne=65536,Pe=998,Fe=[`email`,`whatsapp`,`sms`,`webpush`],Q=[`resend`,`unosend`,`twilio`,`meta`,`evolution`],Ie=[`normal`,`low`],Le=[`accepted`,`canceled`,`processing`,`sent`,`delivered`,`complained`,`bounced`,`suppressed`,`failed`],Re=[`pending`,`canceled`,`processing`,`sent`,`delivered`,`complained`,`bounced`,`suppressed`,`failed`],ze=[`delivered`,`complained`],Be=[`bounced`,`suppressed`,`failed`],$=[`canceled`,`delivered`,`complained`,`bounced`,`suppressed`,`failed`];function Ve(e){return $.includes(e)}const He=[`sent`,`failed`,`unknown`],Ue=[`email.sent`,`email.delivered`,`email.delivery_delayed`,`email.opened`,`email.clicked`,`email.bounced`,`email.complained`,`email.failed`,`email.suppressed`,`whatsapp.sent`,`whatsapp.delivered`,`whatsapp.read`,`whatsapp.failed`,`sms.sent`,`sms.delivered`,`sms.failed`,`sms.bounced`,`webpush.sent`,`webpush.failed`,`webpush.expired`],We=[`MARKETING`,`UTILITY`],Ge=[`DRAFT`,`SUBMITTING`,`SUBMISSION_UNKNOWN`,`PENDING`,`APPROVED`,`REJECTED`,`PAUSED`,`DISABLED`,`DELETED`];export{l as ATTACHMENT_FILENAME_MAX_LENGTH,c as ATTACHMENT_URL_MAX_LENGTH,b as AuthenticationError,m as BLOCKED_ATTACHMENT_EXTENSIONS,T as ConnectionError,De as DEFAULT_BASE_URL,le as DEFAULT_MAX_RETRIES,ce as DEFAULT_TIMEOUT_MS,n as EMAIL_ATTACHMENTS_MAX_COUNT,r as EMAIL_ATTACHMENTS_MAX_TOTAL_BYTES,p as EMAIL_ATTACHMENT_CONTENT_TYPES,d as EMAIL_ATTACHMENT_DISPOSITIONS,M as Emails,u as MESSAGE_ATTACHMENT_SOURCES,He as MESSAGE_ATTEMPT_OUTCOMES,Ae as MESSAGE_BATCH_MAX_SIZE,je as MESSAGE_BODY_MAX_BYTES,ze as MESSAGE_DELIVERED_STATUSES,Re as MESSAGE_DELIVERY_STATUSES,$ as MESSAGE_DELIVERY_TERMINAL_STATUSES,Ue as MESSAGE_EVENT_TYPES,Ne as MESSAGE_JSON_MAX_BYTES,Oe as MESSAGE_LIST_DEFAULT_LIMIT,ke as MESSAGE_LIST_MAX_LIMIT,Ie as MESSAGE_PRIORITIES,Le as MESSAGE_STATUSES,Pe as MESSAGE_SUBJECT_MAX_LENGTH,Be as MESSAGE_UNDELIVERED_STATUSES,ee as MESSAGING_ERROR_CODES,K as Messages,N as MessagesPage,Z as Messaging,Z as default,v as MessagingError,S as NotFoundError,Fe as PROVIDER_CHANNELS,Q as PROVIDER_IDS,x as PermissionError,C as RateLimitError,Me as SMS_CONTENT_MAX_LENGTH,w as ServerError,q as Sms,E as TimeoutError,j as VERSION,y as ValidationError,i as WHATSAPP_ATTACHMENTS_MAX_COUNT,s as WHATSAPP_CAPTION_MAX_LENGTH,a as WHATSAPP_IMAGE_MAX_BYTES,h as WHATSAPP_MEDIA_KINDS,o as WHATSAPP_MEDIA_MAX_BYTES,_ as WHATSAPP_MEDIA_MAX_BYTES_BY_KIND,g as WHATSAPP_MEDIA_TYPES,We as WHATSAPP_TEMPLATE_CATEGORIES,Ge as WHATSAPP_TEMPLATE_STATUSES,J as WebPush,Y as WhatsApp,X as WhatsAppTemplates,A as failure,te as isMessagingError,Ve as isTerminalDeliveryStatus,k as success};
@@ -0,0 +1,45 @@
1
+ // src/modules/telemetry/shared/config/env.ts
2
+ function readEnv(...names) {
3
+ for (const name of names) {
4
+ const value = process.env[name]?.trim();
5
+ if (value) return value;
6
+ }
7
+ }
8
+
9
+ // src/modules/telemetry/shared/state/sdk.ts
10
+ const telemetryGlobal = globalThis;
11
+ let shutdownPromise;
12
+ function isTelemetryRegistered() {
13
+ return Boolean(telemetryGlobal.__rockTelemetrySdk);
14
+ }
15
+ function shutdownTelemetry() {
16
+ if (!telemetryGlobal.__rockTelemetrySdk) return Promise.resolve();
17
+ shutdownPromise ??= telemetryGlobal.__rockTelemetrySdk.shutdown();
18
+ return shutdownPromise;
19
+ }
20
+
21
+ Object.defineProperty(exports, "isTelemetryRegistered", {
22
+ enumerable: true,
23
+ get: function () {
24
+ return isTelemetryRegistered;
25
+ }
26
+ });
27
+ Object.defineProperty(exports, "readEnv", {
28
+ enumerable: true,
29
+ get: function () {
30
+ return readEnv;
31
+ }
32
+ });
33
+ Object.defineProperty(exports, "shutdownTelemetry", {
34
+ enumerable: true,
35
+ get: function () {
36
+ return shutdownTelemetry;
37
+ }
38
+ });
39
+ Object.defineProperty(exports, "telemetryGlobal", {
40
+ enumerable: true,
41
+ get: function () {
42
+ return telemetryGlobal;
43
+ }
44
+ });
45
+ //# sourceMappingURL=sdk-B2Lp3JCz.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk-B2Lp3JCz.cjs","names":[],"sources":["../src/modules/telemetry/shared/config/env.ts","../src/modules/telemetry/shared/state/sdk.ts"],"mappings":";AAUA,SAAgB,QAAQ,GAAG,OAAqC;CAC/D,KAAK,MAAM,QAAQ,OAAO;EACzB,MAAM,QAAQ,QAAQ,IAAI,KAAK,EAAE,KAAK;EACtC,IAAI,OAAO,OAAO;CACnB;AAED;;;ACLA,MAAa,kBAAkB;AAK/B,IAAI;AAOJ,SAAgB,wBAAiC;CAChD,OAAO,QAAQ,gBAAgB,kBAAkB;AAClD;AAEA,SAAgB,oBAAmC;CAClD,IAAI,CAAC,gBAAgB,oBAAoB,OAAO,QAAQ,QAAQ;CAChE,oBAAoB,gBAAgB,mBAAmB,SAAS;CAChE,OAAO;AACR"}
@@ -0,0 +1,22 @@
1
+ // src/modules/telemetry/shared/config/env.ts
2
+ function readEnv(...names) {
3
+ for (const name of names) {
4
+ const value = process.env[name]?.trim();
5
+ if (value) return value;
6
+ }
7
+ }
8
+
9
+ // src/modules/telemetry/shared/state/sdk.ts
10
+ const telemetryGlobal = globalThis;
11
+ let shutdownPromise;
12
+ function isTelemetryRegistered() {
13
+ return Boolean(telemetryGlobal.__rockTelemetrySdk);
14
+ }
15
+ function shutdownTelemetry() {
16
+ if (!telemetryGlobal.__rockTelemetrySdk) return Promise.resolve();
17
+ shutdownPromise ??= telemetryGlobal.__rockTelemetrySdk.shutdown();
18
+ return shutdownPromise;
19
+ }
20
+
21
+ export { readEnv as i, shutdownTelemetry as n, telemetryGlobal as r, isTelemetryRegistered as t };
22
+ //# sourceMappingURL=sdk-IGOHpAeG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk-IGOHpAeG.js","names":[],"sources":["../src/modules/telemetry/shared/config/env.ts","../src/modules/telemetry/shared/state/sdk.ts"],"mappings":";AAUA,SAAgB,QAAQ,GAAG,OAAqC;CAC/D,KAAK,MAAM,QAAQ,OAAO;EACzB,MAAM,QAAQ,QAAQ,IAAI,KAAK,EAAE,KAAK;EACtC,IAAI,OAAO,OAAO;CACnB;AAED;;;ACLA,MAAa,kBAAkB;AAK/B,IAAI;AAOJ,SAAgB,wBAAiC;CAChD,OAAO,QAAQ,gBAAgB,kBAAkB;AAClD;AAEA,SAAgB,oBAAmC;CAClD,IAAI,CAAC,gBAAgB,oBAAoB,OAAO,QAAQ,QAAQ;CAChE,oBAAoB,gBAAgB,mBAAmB,SAAS;CAChE,OAAO;AACR"}
@@ -1,5 +1,4 @@
1
- import { t as rockfeller } from "../index-CYT1PFzo.cjs";
2
- import { d as SchoolList, f as SchoolMembership, i as TeamMember, l as Permission, n as TeamInvitation, p as SchoolPermissions, t as Page, u as School } from "../team-CJVAg4HH.cjs";
1
+ import { _ as SchoolList, c as TeamInvitation, g as School, h as Permission, s as Page, t as rockfeller, u as TeamMember, v as SchoolMembership, y as SchoolPermissions } from "../index-BDYdEWl2.cjs";
3
2
  import { BetterAuthClientPlugin } from "better-auth/client";
4
3
  interface SignInWithRockfellerInput {
5
4
  /** Para onde voltar depois do login. */
@@ -1,5 +1,4 @@
1
- import { t as rockfeller } from "../index-B3UOHsA9.js";
2
- import { d as SchoolList, f as SchoolMembership, i as TeamMember, l as Permission, n as TeamInvitation, p as SchoolPermissions, t as Page, u as School } from "../team-CJVAg4HH.js";
1
+ import { _ as SchoolList, c as TeamInvitation, g as School, h as Permission, s as Page, t as rockfeller, u as TeamMember, v as SchoolMembership, y as SchoolPermissions } from "../index-BDYdEWl2.js";
3
2
  import { BetterAuthClientPlugin } from "better-auth/client";
4
3
  interface SignInWithRockfellerInput {
5
4
  /** Para onde voltar depois do login. */
@@ -1,3 +1,2 @@
1
- import { _ as WEBHOOK_EVENT_TYPES, a as RockfellerWebhookInput, c as DEFAULT_ISSUER, d as WebhookEvent, f as WebhookEventData, g as WebhookUserField, h as WebhookUser, i as RockfellerWebhookHooks, l as PROVIDER_ID, m as WebhookMembershipData, n as RockfellerOptions, o as RockfellerWebhookOptions, p as WebhookEventType, r as RockfellerSessionEndedInput, s as ProfileTab, t as rockfeller, u as TEAM_PROVIDER_ID, v as WebhookVerificationError, y as verifyWebhook } from "../index-CYT1PFzo.cjs";
2
- import { C as RockfellerError, S as Timezone, T as RockfellerErrorCode, _ as HourCycle, a as TeamMembersQuery, b as ReducedMotion, c as TeamRoleOrigin, d as SchoolList, f as SchoolMembership, g as Contrast, h as SchoolType, i as TeamMember, l as Permission, m as SchoolRef, n as TeamInvitation, o as TeamRole, p as SchoolPermissions, r as TeamInvitationInput, s as TeamRoleKey, t as Page, u as School, v as Preferences, w as isRockfellerError, x as Theme, y as PreferencesPatch } from "../team-CJVAg4HH.cjs";
1
+ import { A as isRockfellerError, B as WebhookUser, C as HourCycle, D as Theme, E as ReducedMotion, F as TEAM_PROVIDER_ID, H as WEBHOOK_EVENT_TYPES, I as WebhookEvent, L as WebhookEventData, M as ProfileTab, N as DEFAULT_ISSUER, O as Timezone, P as PROVIDER_ID, R as WebhookEventType, S as Contrast, T as PreferencesPatch, U as WebhookVerificationError, V as WebhookUserField, W as verifyWebhook, _ as SchoolList, a as RockfellerWebhookInput, b as SchoolRef, c as TeamInvitation, d as TeamMembersQuery, f as TeamRole, g as School, h as Permission, i as RockfellerWebhookHooks, j as RockfellerErrorCode, k as RockfellerError, l as TeamInvitationInput, m as TeamRoleOrigin, n as RockfellerOptions, o as RockfellerWebhookOptions, p as TeamRoleKey, r as RockfellerSessionEndedInput, s as Page, t as rockfeller, u as TeamMember, v as SchoolMembership, w as Preferences, x as SchoolType, y as SchoolPermissions, z as WebhookMembershipData } from "../index-BDYdEWl2.cjs";
3
2
  export { type Contrast, DEFAULT_ISSUER, type HourCycle, PROVIDER_ID, type Page, type Permission, type Preferences, type PreferencesPatch, type ProfileTab, type ReducedMotion, RockfellerError, RockfellerErrorCode, type RockfellerOptions, type RockfellerSessionEndedInput, type RockfellerWebhookHooks, type RockfellerWebhookInput, type RockfellerWebhookOptions, type School, type SchoolList, type SchoolMembership, type SchoolPermissions, type SchoolRef, type SchoolType, TEAM_PROVIDER_ID, type TeamInvitation, type TeamInvitationInput, type TeamMember, type TeamMembersQuery, type TeamRole, type TeamRoleKey, type TeamRoleOrigin, type Theme, type Timezone, WEBHOOK_EVENT_TYPES, type WebhookEvent, type WebhookEventData, type WebhookEventType, type WebhookMembershipData, type WebhookUser, type WebhookUserField, WebhookVerificationError, isRockfellerError, rockfeller, verifyWebhook };
@@ -1,3 +1,2 @@
1
- import { _ as WEBHOOK_EVENT_TYPES, a as RockfellerWebhookInput, c as DEFAULT_ISSUER, d as WebhookEvent, f as WebhookEventData, g as WebhookUserField, h as WebhookUser, i as RockfellerWebhookHooks, l as PROVIDER_ID, m as WebhookMembershipData, n as RockfellerOptions, o as RockfellerWebhookOptions, p as WebhookEventType, r as RockfellerSessionEndedInput, s as ProfileTab, t as rockfeller, u as TEAM_PROVIDER_ID, v as WebhookVerificationError, y as verifyWebhook } from "../index-B3UOHsA9.js";
2
- import { C as RockfellerError, S as Timezone, T as RockfellerErrorCode, _ as HourCycle, a as TeamMembersQuery, b as ReducedMotion, c as TeamRoleOrigin, d as SchoolList, f as SchoolMembership, g as Contrast, h as SchoolType, i as TeamMember, l as Permission, m as SchoolRef, n as TeamInvitation, o as TeamRole, p as SchoolPermissions, r as TeamInvitationInput, s as TeamRoleKey, t as Page, u as School, v as Preferences, w as isRockfellerError, x as Theme, y as PreferencesPatch } from "../team-CJVAg4HH.js";
1
+ import { A as isRockfellerError, B as WebhookUser, C as HourCycle, D as Theme, E as ReducedMotion, F as TEAM_PROVIDER_ID, H as WEBHOOK_EVENT_TYPES, I as WebhookEvent, L as WebhookEventData, M as ProfileTab, N as DEFAULT_ISSUER, O as Timezone, P as PROVIDER_ID, R as WebhookEventType, S as Contrast, T as PreferencesPatch, U as WebhookVerificationError, V as WebhookUserField, W as verifyWebhook, _ as SchoolList, a as RockfellerWebhookInput, b as SchoolRef, c as TeamInvitation, d as TeamMembersQuery, f as TeamRole, g as School, h as Permission, i as RockfellerWebhookHooks, j as RockfellerErrorCode, k as RockfellerError, l as TeamInvitationInput, m as TeamRoleOrigin, n as RockfellerOptions, o as RockfellerWebhookOptions, p as TeamRoleKey, r as RockfellerSessionEndedInput, s as Page, t as rockfeller, u as TeamMember, v as SchoolMembership, w as Preferences, x as SchoolType, y as SchoolPermissions, z as WebhookMembershipData } from "../index-BDYdEWl2.js";
3
2
  export { type Contrast, DEFAULT_ISSUER, type HourCycle, PROVIDER_ID, type Page, type Permission, type Preferences, type PreferencesPatch, type ProfileTab, type ReducedMotion, RockfellerError, RockfellerErrorCode, type RockfellerOptions, type RockfellerSessionEndedInput, type RockfellerWebhookHooks, type RockfellerWebhookInput, type RockfellerWebhookOptions, type School, type SchoolList, type SchoolMembership, type SchoolPermissions, type SchoolRef, type SchoolType, TEAM_PROVIDER_ID, type TeamInvitation, type TeamInvitationInput, type TeamMember, type TeamMembersQuery, type TeamRole, type TeamRoleKey, type TeamRoleOrigin, type Theme, type Timezone, WEBHOOK_EVENT_TYPES, type WebhookEvent, type WebhookEventData, type WebhookEventType, type WebhookMembershipData, type WebhookUser, type WebhookUserField, WebhookVerificationError, isRockfellerError, rockfeller, verifyWebhook };
@@ -1,5 +1,5 @@
1
- import { p as SchoolPermissions } from "../team-CJVAg4HH.cjs";
2
- import { d as Authorization, h as VerifiedToken, p as TokenVerifier } from "../index-Cj-10Q5F.cjs";
1
+ import { y as SchoolPermissions } from "../index-BDYdEWl2.cjs";
2
+ import { d as Authorization, h as VerifiedToken, p as TokenVerifier } from "../index--EJQTnHy.cjs";
3
3
  import { CanActivate, DynamicModule, ExecutionContext, ModuleMetadata } from "@nestjs/common";
4
4
  import { Reflector } from "@nestjs/core";
5
5
  /** Libera a rota do guard (health check, webhooks...). */
@@ -1,5 +1,5 @@
1
- import { p as SchoolPermissions } from "../team-CJVAg4HH.js";
2
- import { d as Authorization, h as VerifiedToken, p as TokenVerifier } from "../index-C1KmT8dQ.js";
1
+ import { y as SchoolPermissions } from "../index-BDYdEWl2.js";
2
+ import { d as Authorization, h as VerifiedToken, p as TokenVerifier } from "../index-u3ArUXO0.js";
3
3
  import { CanActivate, DynamicModule, ExecutionContext, ModuleMetadata } from "@nestjs/common";
4
4
  import { Reflector } from "@nestjs/core";
5
5
  /** Libera a rota do guard (health check, webhooks...). */
@@ -1,3 +1,3 @@
1
- import { C as RockfellerError, S as Timezone, T as RockfellerErrorCode, _ as HourCycle, a as TeamMembersQuery, b as ReducedMotion, c as TeamRoleOrigin, d as SchoolList, f as SchoolMembership, g as Contrast, h as SchoolType, i as TeamMember, l as Permission, m as SchoolRef, n as TeamInvitation, o as TeamRole, p as SchoolPermissions, r as TeamInvitationInput, s as TeamRoleKey, t as Page, u as School, v as Preferences, w as isRockfellerError, x as Theme, y as PreferencesPatch } from "../team-CJVAg4HH.cjs";
2
- import { _ as assertWritable, a as TokenExchangerOptions, c as Preferences$1, d as Authorization, f as AuthorizationOptions, g as InvalidTokenError, h as VerifiedToken, i as TokenExchanger, l as PreferencesOptions, m as TokenVerifierOptions, n as ExchangedToken, o as TokenExchangeError, p as TokenVerifier, r as TokenExchangeInput, s as createPreferences, t as createTokenExchanger, u as createAuthorization, v as createTokenVerifier } from "../index-Cj-10Q5F.cjs";
1
+ import { A as isRockfellerError, C as HourCycle, D as Theme, E as ReducedMotion, O as Timezone, S as Contrast, T as PreferencesPatch, _ as SchoolList, b as SchoolRef, c as TeamInvitation, d as TeamMembersQuery, f as TeamRole, g as School, h as Permission, j as RockfellerErrorCode, k as RockfellerError, l as TeamInvitationInput, m as TeamRoleOrigin, p as TeamRoleKey, s as Page, u as TeamMember, v as SchoolMembership, w as Preferences, x as SchoolType, y as SchoolPermissions } from "../index-BDYdEWl2.cjs";
2
+ import { _ as assertWritable, a as TokenExchangerOptions, c as Preferences$1, d as Authorization, f as AuthorizationOptions, g as InvalidTokenError, h as VerifiedToken, i as TokenExchanger, l as PreferencesOptions, m as TokenVerifierOptions, n as ExchangedToken, o as TokenExchangeError, p as TokenVerifier, r as TokenExchangeInput, s as createPreferences, t as createTokenExchanger, u as createAuthorization, v as createTokenVerifier } from "../index--EJQTnHy.cjs";
3
3
  export { type Authorization, type AuthorizationOptions, type Contrast, type ExchangedToken, type HourCycle, InvalidTokenError, type Page, type Permission, type Preferences, type Preferences$1 as PreferencesClient, type PreferencesOptions, type PreferencesPatch, type ReducedMotion, RockfellerError, RockfellerErrorCode, type School, type SchoolList, type SchoolMembership, type SchoolPermissions, type SchoolRef, type SchoolType, type TeamInvitation, type TeamInvitationInput, type TeamMember, type TeamMembersQuery, type TeamRole, type TeamRoleKey, type TeamRoleOrigin, type Theme, type Timezone, TokenExchangeError, type TokenExchangeInput, type TokenExchanger, type TokenExchangerOptions, type TokenVerifier, type TokenVerifierOptions, type VerifiedToken, assertWritable, createAuthorization, createPreferences, createTokenExchanger, createTokenVerifier, isRockfellerError };
@@ -1,3 +1,3 @@
1
- import { C as RockfellerError, S as Timezone, T as RockfellerErrorCode, _ as HourCycle, a as TeamMembersQuery, b as ReducedMotion, c as TeamRoleOrigin, d as SchoolList, f as SchoolMembership, g as Contrast, h as SchoolType, i as TeamMember, l as Permission, m as SchoolRef, n as TeamInvitation, o as TeamRole, p as SchoolPermissions, r as TeamInvitationInput, s as TeamRoleKey, t as Page, u as School, v as Preferences, w as isRockfellerError, x as Theme, y as PreferencesPatch } from "../team-CJVAg4HH.js";
2
- import { _ as assertWritable, a as TokenExchangerOptions, c as Preferences$1, d as Authorization, f as AuthorizationOptions, g as InvalidTokenError, h as VerifiedToken, i as TokenExchanger, l as PreferencesOptions, m as TokenVerifierOptions, n as ExchangedToken, o as TokenExchangeError, p as TokenVerifier, r as TokenExchangeInput, s as createPreferences, t as createTokenExchanger, u as createAuthorization, v as createTokenVerifier } from "../index-C1KmT8dQ.js";
1
+ import { A as isRockfellerError, C as HourCycle, D as Theme, E as ReducedMotion, O as Timezone, S as Contrast, T as PreferencesPatch, _ as SchoolList, b as SchoolRef, c as TeamInvitation, d as TeamMembersQuery, f as TeamRole, g as School, h as Permission, j as RockfellerErrorCode, k as RockfellerError, l as TeamInvitationInput, m as TeamRoleOrigin, p as TeamRoleKey, s as Page, u as TeamMember, v as SchoolMembership, w as Preferences, x as SchoolType, y as SchoolPermissions } from "../index-BDYdEWl2.js";
2
+ import { _ as assertWritable, a as TokenExchangerOptions, c as Preferences$1, d as Authorization, f as AuthorizationOptions, g as InvalidTokenError, h as VerifiedToken, i as TokenExchanger, l as PreferencesOptions, m as TokenVerifierOptions, n as ExchangedToken, o as TokenExchangeError, p as TokenVerifier, r as TokenExchangeInput, s as createPreferences, t as createTokenExchanger, u as createAuthorization, v as createTokenVerifier } from "../index-u3ArUXO0.js";
3
3
  export { type Authorization, type AuthorizationOptions, type Contrast, type ExchangedToken, type HourCycle, InvalidTokenError, type Page, type Permission, type Preferences, type Preferences$1 as PreferencesClient, type PreferencesOptions, type PreferencesPatch, type ReducedMotion, RockfellerError, RockfellerErrorCode, type School, type SchoolList, type SchoolMembership, type SchoolPermissions, type SchoolRef, type SchoolType, type TeamInvitation, type TeamInvitationInput, type TeamMember, type TeamMembersQuery, type TeamRole, type TeamRoleKey, type TeamRoleOrigin, type Theme, type Timezone, TokenExchangeError, type TokenExchangeInput, type TokenExchanger, type TokenExchangerOptions, type TokenVerifier, type TokenVerifierOptions, type VerifiedToken, assertWritable, createAuthorization, createPreferences, createTokenExchanger, createTokenVerifier, isRockfellerError };
@@ -0,0 +1,11 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_telemetry_mock = require("../telemetry.mock-BSsx7L6S.cjs");
3
+ const require_dispatcher = require("../dispatcher-BsD7cO2w.cjs");
4
+ const require_core = require("../core-BidJDmSN.cjs");
5
+
6
+ exports.Telemetry = require_core.Telemetry;
7
+ exports.TelemetryContext = require_core.TelemetryContext;
8
+ exports.TelemetryError = require_dispatcher.TelemetryError;
9
+ exports.Trace = require_core.Trace;
10
+ exports.createTelemetry = require_core.createTelemetry;
11
+ exports.createTelemetryMock = require_telemetry_mock.createTelemetryMock;
@@ -0,0 +1,4 @@
1
+ import { C as TelemetryRequestContext, S as TelemetryOptions, _ as Telemetry, b as TelemetryHttpErrorContext, f as AuthTelemetryContext, g as MetricAttributes, h as JobOptions, m as DependencyOptions, p as CaptureExceptionOptions, v as TelemetryAttributes, w as TelemetrySpan, x as TelemetryHttpErrorResponse, y as TelemetryFetchOptions } from "../adapters-DM59AJfR.cjs";
2
+ import { t as createTelemetryMock } from "../telemetry.mock-C1wXuf-M.cjs";
3
+ import { a as TelemetryErrorCode, i as TelemetryError, o as TelemetryErrorOptions, r as Trace, s as createTelemetry, t as TelemetryContext } from "../index-B3aVdDMV.cjs";
4
+ export { type AuthTelemetryContext, type CaptureExceptionOptions, type DependencyOptions, type JobOptions, type MetricAttributes, Telemetry, type TelemetryAttributes, TelemetryContext, TelemetryError, type TelemetryErrorCode, type TelemetryErrorOptions, type TelemetryFetchOptions, type TelemetryHttpErrorContext, type TelemetryHttpErrorResponse, type TelemetryOptions, type TelemetryRequestContext, type TelemetrySpan, Trace, createTelemetry, createTelemetryMock };
@@ -0,0 +1,4 @@
1
+ import { C as TelemetryRequestContext, S as TelemetryOptions, _ as Telemetry, b as TelemetryHttpErrorContext, f as AuthTelemetryContext, g as MetricAttributes, h as JobOptions, m as DependencyOptions, p as CaptureExceptionOptions, v as TelemetryAttributes, w as TelemetrySpan, x as TelemetryHttpErrorResponse, y as TelemetryFetchOptions } from "../adapters-DM59AJfR.js";
2
+ import { t as createTelemetryMock } from "../telemetry.mock-CdaxofJ7.js";
3
+ import { a as TelemetryErrorCode, i as TelemetryError, o as TelemetryErrorOptions, r as Trace, s as createTelemetry, t as TelemetryContext } from "../index-ByS2IC02.js";
4
+ export { type AuthTelemetryContext, type CaptureExceptionOptions, type DependencyOptions, type JobOptions, type MetricAttributes, Telemetry, type TelemetryAttributes, TelemetryContext, TelemetryError, type TelemetryErrorCode, type TelemetryErrorOptions, type TelemetryFetchOptions, type TelemetryHttpErrorContext, type TelemetryHttpErrorResponse, type TelemetryOptions, type TelemetryRequestContext, type TelemetrySpan, Trace, createTelemetry, createTelemetryMock };
@@ -0,0 +1,5 @@
1
+ import { t as createTelemetryMock } from "../telemetry.mock-BZRpy63c.js";
2
+ import { n as TelemetryError } from "../dispatcher-DA_l1Vkv.js";
3
+ import { a as Telemetry, c as TelemetryContext, n as createTelemetry, t as Trace } from "../core-C-EFrEd6.js";
4
+
5
+ export { Telemetry, TelemetryContext, TelemetryError, Trace, createTelemetry, createTelemetryMock };