swiftbase-admin-sdk 1.0.3 → 1.0.4

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.
package/dist/index.cjs CHANGED
@@ -4613,13 +4613,39 @@ function parseListBuckets(xml) {
4613
4613
  }
4614
4614
  return buckets;
4615
4615
  }
4616
- function parseListObjects(xml) {
4617
- const nameMatch = xml.match(/<Name>(.*?)<\/Name>/);
4618
- const prefixMatch = xml.match(/<Prefix>(.*?)<\/Prefix>/);
4619
- const maxKeysMatch = xml.match(/<MaxKeys>(.*?)<\/MaxKeys>/);
4620
- const isTruncatedMatch = xml.match(/<IsTruncated>(.*?)<\/IsTruncated>/);
4616
+ function parseListObjects(text) {
4617
+ const trimmed = text.trim();
4618
+ if (trimmed.startsWith("[") || trimmed.startsWith("{")) {
4619
+ try {
4620
+ const parsed = JSON.parse(trimmed);
4621
+ const items = Array.isArray(parsed) ? parsed : parsed.contents || [];
4622
+ const contents2 = items.map((item) => {
4623
+ const pathPrefix = item.path && item.path !== "/" ? item.path.replace(/\/$/, "") + "/" : "";
4624
+ const key = item.key || (item.name ? `${pathPrefix}${item.name}` : "");
4625
+ return {
4626
+ key,
4627
+ lastModified: item.modified || item.lastModified,
4628
+ etag: item.etag,
4629
+ size: item.size || 0
4630
+ };
4631
+ });
4632
+ return {
4633
+ name: "",
4634
+ prefix: "",
4635
+ maxKeys: contents2.length,
4636
+ isTruncated: false,
4637
+ contents: contents2,
4638
+ commonPrefixes: []
4639
+ };
4640
+ } catch (e) {
4641
+ }
4642
+ }
4643
+ const nameMatch = text.match(/<Name>(.*?)<\/Name>/);
4644
+ const prefixMatch = text.match(/<Prefix>(.*?)<\/Prefix>/);
4645
+ const maxKeysMatch = text.match(/<MaxKeys>(.*?)<\/MaxKeys>/);
4646
+ const isTruncatedMatch = text.match(/<IsTruncated>(.*?)<\/IsTruncated>/);
4621
4647
  const contents = [];
4622
- const contentMatches = xml.matchAll(/<Contents>([\s\S]*?)<\/Contents>/g);
4648
+ const contentMatches = text.matchAll(/<Contents>([\s\S]*?)<\/Contents>/g);
4623
4649
  for (const match of contentMatches) {
4624
4650
  const content = match[1];
4625
4651
  const keyMatch = content.match(/<Key>(.*?)<\/Key>/);
@@ -4636,11 +4662,11 @@ function parseListObjects(xml) {
4636
4662
  }
4637
4663
  }
4638
4664
  const commonPrefixes = [];
4639
- const cpMatches = xml.matchAll(/<CommonPrefixes>([\s\S]*?)<\/CommonPrefixes>/g);
4665
+ const cpMatches = text.matchAll(/<CommonPrefixes>([\s\S]*?)<\/CommonPrefixes>/g);
4640
4666
  for (const match of cpMatches) {
4641
- const prefixMatch2 = match[1].match(/<Prefix>(.*?)<\/Prefix>/);
4642
- if (prefixMatch2) {
4643
- commonPrefixes.push(prefixMatch2[1]);
4667
+ const pMatch = match[1].match(/<Prefix>(.*?)<\/Prefix>/);
4668
+ if (pMatch) {
4669
+ commonPrefixes.push(pMatch[1]);
4644
4670
  }
4645
4671
  }
4646
4672
  return {
@@ -4809,7 +4835,11 @@ var ai = {
4809
4835
  create: (options) => __async(null, null, function* () {
4810
4836
  return yield makeRequest("post" /* POST */, "/api/ai/chat/completions", void 0, {
4811
4837
  model: options.model || "gemini-3.5-flash",
4812
- messages: options.messages
4838
+ messages: options.messages,
4839
+ tools: options.tools,
4840
+ tool_choice: options.tool_choice,
4841
+ temperature: options.temperature,
4842
+ max_tokens: options.max_tokens
4813
4843
  });
4814
4844
  })
4815
4845
  }