bruce-models 0.9.8 → 1.0.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.
@@ -1184,7 +1184,7 @@
1184
1184
  */
1185
1185
  class Api$$1 extends AbstractApi {
1186
1186
  constructor(env) {
1187
- super("SSID");
1187
+ super("x-sessionid");
1188
1188
  this.baseUrl = "";
1189
1189
  this.env = env !== null && env !== void 0 ? env : exports.Api.EEnv.PROD;
1190
1190
  this.setBaseUrl();
@@ -1545,6 +1545,11 @@
1545
1545
  }
1546
1546
  Entity.SetValue = SetValue;
1547
1547
  function GetValue(data, path) {
1548
+ var _a;
1549
+ // Backwards compatibility.
1550
+ if (path.length == 1 && path[0] == "ID") {
1551
+ return (_a = data.Bruce) === null || _a === void 0 ? void 0 : _a.ID;
1552
+ }
1548
1553
  let curData = data;
1549
1554
  for (let i = 0; i < path.length; i++) {
1550
1555
  const step = path[i];
@@ -3905,6 +3910,33 @@
3905
3910
  });
3906
3911
  }
3907
3912
  ClientFile.Upload = Upload;
3913
+ /**
3914
+ * Uploads a temp file.
3915
+ * This will return a temp file id which can be used in various endpoints.
3916
+ * @param api
3917
+ * @param file
3918
+ * @param reqParams
3919
+ * @returns
3920
+ */
3921
+ function UploadTemp(api, file, reqParams) {
3922
+ return __awaiter(this, void 0, void 0, function* () {
3923
+ if (!file) {
3924
+ throw ("File is required.");
3925
+ }
3926
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
3927
+ try {
3928
+ const params = exports.Api.PrepReqParams(reqParams);
3929
+ const data = yield api.UPLOAD("file/uploadTemp", file, params);
3930
+ res(data["TempFile.ID"]);
3931
+ }
3932
+ catch (e) {
3933
+ rej(e);
3934
+ }
3935
+ }));
3936
+ return prom;
3937
+ });
3938
+ }
3939
+ ClientFile.UploadTemp = UploadTemp;
3908
3940
  let Filter;
3909
3941
  (function (Filter) {
3910
3942
  let V1;