@opexa/portal-sdk 0.59.7 → 0.59.9

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
@@ -4041,6 +4041,17 @@ var AccountService = class {
4041
4041
  data: res.data.memberVerificationRequestAutomaticApprovalEnabled
4042
4042
  };
4043
4043
  }
4044
+ async file(variables) {
4045
+ const res = await this.client.request(
4046
+ FILE_QUERY,
4047
+ variables
4048
+ );
4049
+ if (!res.ok) return res;
4050
+ return {
4051
+ ok: true,
4052
+ data: res.data.node
4053
+ };
4054
+ }
4044
4055
  };
4045
4056
 
4046
4057
  // src/utils/status-code-to-operation-error.ts
@@ -9069,6 +9080,7 @@ var Sdk = class {
9069
9080
  logs
9070
9081
  };
9071
9082
  this.collectMetaDetails();
9083
+ this.initMarketDomain();
9072
9084
  }
9073
9085
  _fetch = null;
9074
9086
  _middleware;
@@ -9113,9 +9125,8 @@ var Sdk = class {
9113
9125
  const searchParams = new URLSearchParams(window.location.search);
9114
9126
  const hostname = window.location.hostname;
9115
9127
  const market = searchParams.get("market");
9116
- const marketPattern = /^[a-zA-Z0-9]{3,10}(-[a-zA-Z0-9]{3,10}){0,2}$/;
9117
9128
  const adClickId = this.adManager.clickId;
9118
- if (market && marketPattern.test(market)) {
9129
+ if (market) {
9119
9130
  sessionStorage.setItem("domain", `${hostname}/${market}`);
9120
9131
  } else if (adClickId) {
9121
9132
  sessionStorage.setItem("domain", `${hostname}/meta-ads`);
@@ -10803,6 +10814,17 @@ var Sdk = class {
10803
10814
  data: res.data ? this.transformer.transform.file(res.data) : null
10804
10815
  };
10805
10816
  }
10817
+ /**
10818
+ * Similar to `file` query but uses the account service.
10819
+ */
10820
+ async _file(id) {
10821
+ const res = await this.accountService.file({ id });
10822
+ if (!res.ok) return res;
10823
+ return {
10824
+ ok: true,
10825
+ data: res.data ? this.transformer.transform.file(res.data) : null
10826
+ };
10827
+ }
10806
10828
  async uploadImageFile(input) {
10807
10829
  const id = input.id ?? objectId.ObjectId.generate(ObjectType.File).toString();
10808
10830
  const res = await this.fileService.uploadPrivateImageFile({