@sdflc/backend-helpers 1.0.43 → 1.0.44

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.
@@ -160,9 +160,9 @@ var BaseGateway = /** @class */ (function () {
160
160
  };
161
161
  BaseGateway.prototype.transformOnCreate = function (params) {
162
162
  return __awaiter(this, void 0, void 0, function () {
163
- var _a, hasCreatedAt, hasCreatedBy, hasSpace, hasVersion, hasLang, localizationForField;
163
+ var _a, hasCreatedAt, hasCreatedBy, hasSpace, hasVersion, hasLang, localizationForField, hasUserId;
164
164
  return __generator(this, function (_b) {
165
- _a = this.config, hasCreatedAt = _a.hasCreatedAt, hasCreatedBy = _a.hasCreatedBy, hasSpace = _a.hasSpace, hasVersion = _a.hasVersion, hasLang = _a.hasLang, localizationForField = _a.localizationForField;
165
+ _a = this.config, hasCreatedAt = _a.hasCreatedAt, hasCreatedBy = _a.hasCreatedBy, hasSpace = _a.hasSpace, hasVersion = _a.hasVersion, hasLang = _a.hasLang, localizationForField = _a.localizationForField, hasUserId = _a.hasUserId;
166
166
  if (hasCreatedAt) {
167
167
  params[constants_1.FIELDS.CREATED_AT] = this.dateTime.dbFormat(this.dateTimeNow);
168
168
  }
@@ -171,6 +171,11 @@ var BaseGateway = /** @class */ (function () {
171
171
  params[constants_1.FIELDS.CREATED_BY] = this.getContext().userId;
172
172
  }
173
173
  }
174
+ if (hasUserId) {
175
+ if (params[constants_1.FIELDS.USER_ID] === undefined) {
176
+ params[constants_1.FIELDS.USER_ID] = this.getContext().userId;
177
+ }
178
+ }
174
179
  if (hasSpace) {
175
180
  params[constants_1.FIELDS.SPACE_ID] = this.getContext().spaceId;
176
181
  }
@@ -18,6 +18,7 @@ export interface BaseGatewayPropsInterface extends CacheInterface {
18
18
  hasSpace?: boolean;
19
19
  hasVersion?: boolean;
20
20
  hasLang?: boolean;
21
+ hasUserId?: boolean;
21
22
  localizationForField?: string;
22
23
  defaultSorting?: SortItemInterface[];
23
24
  fieldForKeyword?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdflc/backend-helpers",
3
- "version": "1.0.43",
3
+ "version": "1.0.44",
4
4
  "description": "Set of helper functions and classes to simplify building backend apps within @sdflc ecosystem",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",