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.
@@ -1204,7 +1204,7 @@ var GlobalApi;
1204
1204
  */
1205
1205
  class Api$$1 extends AbstractApi {
1206
1206
  constructor(env) {
1207
- super("SSID");
1207
+ super("x-sessionid");
1208
1208
  this.baseUrl = "";
1209
1209
  this.env = env !== null && env !== void 0 ? env : Api.EEnv.PROD;
1210
1210
  this.setBaseUrl();
@@ -1574,6 +1574,11 @@ var Entity;
1574
1574
  }
1575
1575
  Entity.SetValue = SetValue;
1576
1576
  function GetValue(data, path) {
1577
+ var _a;
1578
+ // Backwards compatibility.
1579
+ if (path.length == 1 && path[0] == "ID") {
1580
+ return (_a = data.Bruce) === null || _a === void 0 ? void 0 : _a.ID;
1581
+ }
1577
1582
  let curData = data;
1578
1583
  for (let i = 0; i < path.length; i++) {
1579
1584
  const step = path[i];
@@ -4033,6 +4038,33 @@ var ClientFile;
4033
4038
  });
4034
4039
  }
4035
4040
  ClientFile.Upload = Upload;
4041
+ /**
4042
+ * Uploads a temp file.
4043
+ * This will return a temp file id which can be used in various endpoints.
4044
+ * @param api
4045
+ * @param file
4046
+ * @param reqParams
4047
+ * @returns
4048
+ */
4049
+ function UploadTemp(api, file, reqParams) {
4050
+ return __awaiter(this, void 0, void 0, function* () {
4051
+ if (!file) {
4052
+ throw ("File is required.");
4053
+ }
4054
+ const prom = new Promise((res, rej) => __awaiter(this, void 0, void 0, function* () {
4055
+ try {
4056
+ const params = Api.PrepReqParams(reqParams);
4057
+ const data = yield api.UPLOAD("file/uploadTemp", file, params);
4058
+ res(data["TempFile.ID"]);
4059
+ }
4060
+ catch (e) {
4061
+ rej(e);
4062
+ }
4063
+ }));
4064
+ return prom;
4065
+ });
4066
+ }
4067
+ ClientFile.UploadTemp = UploadTemp;
4036
4068
  let Filter;
4037
4069
  (function (Filter) {
4038
4070
  let V1;