@xylex-group/athena 2.10.0 → 2.11.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 (42) hide show
  1. package/README.md +112 -28
  2. package/dist/browser.cjs +38 -1
  3. package/dist/browser.cjs.map +1 -1
  4. package/dist/browser.d.cts +3 -3
  5. package/dist/browser.d.ts +3 -3
  6. package/dist/browser.js +38 -1
  7. package/dist/browser.js.map +1 -1
  8. package/dist/cli/index.cjs +38 -1
  9. package/dist/cli/index.cjs.map +1 -1
  10. package/dist/cli/index.js +38 -1
  11. package/dist/cli/index.js.map +1 -1
  12. package/dist/{client-BYii6dU9.d.ts → client-DD_UeF3Q.d.ts} +2 -0
  13. package/dist/{client-B7EQ_hPV.d.cts → client-WqBuu60O.d.cts} +2 -0
  14. package/dist/index.cjs +38 -1
  15. package/dist/index.cjs.map +1 -1
  16. package/dist/index.d.cts +2 -2
  17. package/dist/index.d.ts +2 -2
  18. package/dist/index.js +38 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/{module-DC96HJa3.d.cts → module-BFMyVmwX.d.cts} +1 -1
  21. package/dist/{module-DbHlxpeR.d.ts → module-DRkIHtY-.d.ts} +1 -1
  22. package/dist/next/client.cjs +38 -1
  23. package/dist/next/client.cjs.map +1 -1
  24. package/dist/next/client.d.cts +2 -2
  25. package/dist/next/client.d.ts +2 -2
  26. package/dist/next/client.js +38 -1
  27. package/dist/next/client.js.map +1 -1
  28. package/dist/next/server.cjs +38 -1
  29. package/dist/next/server.cjs.map +1 -1
  30. package/dist/next/server.d.cts +2 -2
  31. package/dist/next/server.d.ts +2 -2
  32. package/dist/next/server.js +38 -1
  33. package/dist/next/server.js.map +1 -1
  34. package/dist/react.cjs +1 -1
  35. package/dist/react.cjs.map +1 -1
  36. package/dist/react.d.cts +1 -1
  37. package/dist/react.d.ts +1 -1
  38. package/dist/react.js +1 -1
  39. package/dist/react.js.map +1 -1
  40. package/dist/{shared-BMVGMnti.d.cts → shared-B1ueL-Ox.d.cts} +1 -1
  41. package/dist/{shared-DRptGBWP.d.ts → shared-GPAprhBb.d.ts} +1 -1
  42. package/package.json +2 -2
@@ -1,5 +1,5 @@
1
- import { an as AthenaAuthSessionResponse, bI as AthenaClientSessionLike, cA as AthenaSdkClientWithStorage, cz as AthenaSdkClientWithAuth } from '../client-B7EQ_hPV.cjs';
2
- import { A as AthenaAdapterBaseOptions, b as AthenaServerRequestOptions, a as AthenaAdapterExperimentalOptions } from '../shared-BMVGMnti.cjs';
1
+ import { an as AthenaAuthSessionResponse, bI as AthenaClientSessionLike, cA as AthenaSdkClientWithStorage, cz as AthenaSdkClientWithAuth } from '../client-WqBuu60O.cjs';
2
+ import { A as AthenaAdapterBaseOptions, b as AthenaServerRequestOptions, a as AthenaAdapterExperimentalOptions } from '../shared-B1ueL-Ox.cjs';
3
3
  import '../types-BeZIHduP.cjs';
4
4
 
5
5
  interface AthenaServerClientOptions extends AthenaAdapterBaseOptions, AthenaServerRequestOptions {
@@ -1,5 +1,5 @@
1
- import { an as AthenaAuthSessionResponse, bI as AthenaClientSessionLike, cA as AthenaSdkClientWithStorage, cz as AthenaSdkClientWithAuth } from '../client-BYii6dU9.js';
2
- import { A as AthenaAdapterBaseOptions, b as AthenaServerRequestOptions, a as AthenaAdapterExperimentalOptions } from '../shared-DRptGBWP.js';
1
+ import { an as AthenaAuthSessionResponse, bI as AthenaClientSessionLike, cA as AthenaSdkClientWithStorage, cz as AthenaSdkClientWithAuth } from '../client-DD_UeF3Q.js';
2
+ import { A as AthenaAdapterBaseOptions, b as AthenaServerRequestOptions, a as AthenaAdapterExperimentalOptions } from '../shared-GPAprhBb.js';
3
3
  import '../types-BeZIHduP.js';
4
4
 
5
5
  interface AthenaServerClientOptions extends AthenaAdapterBaseOptions, AthenaServerRequestOptions {
@@ -160,7 +160,7 @@ var getSessionCookie = (request2, config) => {
160
160
 
161
161
  // package.json
162
162
  var package_default = {
163
- version: "2.10.0"
163
+ version: "2.11.0"
164
164
  };
165
165
 
166
166
  // src/sdk-version.ts
@@ -1150,6 +1150,21 @@ function copyDefinedField(target, source, targetKey, sourceKey) {
1150
1150
  target[targetKey] = value;
1151
1151
  }
1152
1152
  }
1153
+ function normalizeEmailTemplateAttachmentsValue(value) {
1154
+ if (typeof value === "string" || value == null) {
1155
+ return value;
1156
+ }
1157
+ if (Array.isArray(value)) {
1158
+ return value.map((item) => normalizeEmailTemplateAttachmentsValue(item));
1159
+ }
1160
+ if (typeof value !== "object") {
1161
+ return value;
1162
+ }
1163
+ const attachment = { ...value };
1164
+ copyDefinedField(attachment, attachment, "file_url", "fileUrl");
1165
+ delete attachment.fileUrl;
1166
+ return attachment;
1167
+ }
1153
1168
  function normalizeAdminEmailTemplatePayload(payload) {
1154
1169
  const normalized = { ...payload };
1155
1170
  copyDefinedField(normalized, payload, "template_key", "templateKey");
@@ -1160,6 +1175,17 @@ function normalizeAdminEmailTemplatePayload(payload) {
1160
1175
  copyDefinedField(normalized, payload, "variable_bindings", "variableBindings");
1161
1176
  copyDefinedField(normalized, payload, "attachment_failure_mode", "attachmentFailureMode");
1162
1177
  copyDefinedField(normalized, payload, "is_active", "isActive");
1178
+ if (Object.hasOwn(payload, "attachments")) {
1179
+ normalized.attachments = normalizeEmailTemplateAttachmentsValue(payload.attachments);
1180
+ }
1181
+ delete normalized.templateKey;
1182
+ delete normalized.eventType;
1183
+ delete normalized.subjectTemplate;
1184
+ delete normalized.textTemplate;
1185
+ delete normalized.htmlTemplate;
1186
+ delete normalized.variableBindings;
1187
+ delete normalized.attachmentFailureMode;
1188
+ delete normalized.isActive;
1163
1189
  return normalized;
1164
1190
  }
1165
1191
  function toReactEmailTemplateCompatibilityInput(input) {
@@ -1183,6 +1209,17 @@ function normalizeAdminEmailTemplateSendPayload(payload) {
1183
1209
  copyDefinedField(normalized, payload, "user_id", "userId");
1184
1210
  copyDefinedField(normalized, payload, "organization_id", "organizationId");
1185
1211
  copyDefinedField(normalized, payload, "session_token", "sessionToken");
1212
+ copyDefinedField(normalized, payload, "attachment_failure_mode", "attachmentFailureMode");
1213
+ if (Object.hasOwn(payload, "attachments")) {
1214
+ normalized.attachments = normalizeEmailTemplateAttachmentsValue(payload.attachments);
1215
+ }
1216
+ delete normalized.templateId;
1217
+ delete normalized.recipientEmail;
1218
+ delete normalized.renderVariables;
1219
+ delete normalized.userId;
1220
+ delete normalized.organizationId;
1221
+ delete normalized.sessionToken;
1222
+ delete normalized.attachmentFailureMode;
1186
1223
  return normalized;
1187
1224
  }
1188
1225
  function toSessionGuardFailure(sessionResult) {