@nhtio/lucid-resourceful 0.1.0-master-71781cfd → 0.1.0-master-1570171e

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/index.mjs CHANGED
@@ -1147,6 +1147,13 @@ function withResourceful(options = {}) {
1147
1147
  };
1148
1148
  Object.entries(resourcefulModelMetaSchema.properties).forEach(
1149
1149
  ([propertyKey, propertyMeta]) => {
1150
+ const resolvedColumnName = getFieldKey(
1151
+ propertyKey,
1152
+ propertyMeta.lucidDefinitions
1153
+ );
1154
+ if (null === resolvedColumnName) {
1155
+ return;
1156
+ }
1150
1157
  switch (propertyMeta.kind) {
1151
1158
  case "column": {
1152
1159
  ret.properties[propertyKey] = this.$resourcefulModelColumnMetaToOpenApiSchema(
@@ -1499,7 +1506,7 @@ function withResourceful(options = {}) {
1499
1506
  ]) {
1500
1507
  await scopeCallback(ctx, app, query);
1501
1508
  }
1502
- const columnsToSelect = validatedMethodOptions.fields.filter((field) => allowedFieldsMap.has(field)).map((field) => this.$keys.serializedToColumns.get(field));
1509
+ const columnsToSelect = validatedMethodOptions.fields.filter((field) => allowedFieldsMap.has(field)).map((field) => this.$keys.serializedToColumns.get(field)).filter((column2) => !!column2);
1503
1510
  const countQuery = query.clone();
1504
1511
  const recordsQuery = query.clone();
1505
1512
  countQuery.count("*", "total");
@@ -2813,7 +2820,7 @@ var objectInspect = function inspect_(obj, options, depth, seen) {
2813
2820
  var ys = arrObjKeys(obj, inspect2);
2814
2821
  var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;
2815
2822
  var protoTag = obj instanceof Object ? "" : "null prototype";
2816
- var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr$1(obj), 8, -1) : protoTag ? "Object" : "";
2823
+ var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? "Object" : "";
2817
2824
  var constructorTag = isPlainObject || typeof obj.constructor !== "function" ? "" : obj.constructor.name ? obj.constructor.name + " " : "";
2818
2825
  var tag = constructorTag + (stringTag || protoTag ? "[" + $join.call($concat$1.call([], stringTag || [], protoTag || []), ": ") + "] " : "");
2819
2826
  if (ys.length === 0) {
@@ -2838,25 +2845,25 @@ function canTrustToString(obj) {
2838
2845
  return !toStringTag || !(typeof obj === "object" && (toStringTag in obj || typeof obj[toStringTag] !== "undefined"));
2839
2846
  }
2840
2847
  function isArray$3(obj) {
2841
- return toStr$1(obj) === "[object Array]" && canTrustToString(obj);
2848
+ return toStr(obj) === "[object Array]" && canTrustToString(obj);
2842
2849
  }
2843
2850
  function isDate(obj) {
2844
- return toStr$1(obj) === "[object Date]" && canTrustToString(obj);
2851
+ return toStr(obj) === "[object Date]" && canTrustToString(obj);
2845
2852
  }
2846
2853
  function isRegExp$1(obj) {
2847
- return toStr$1(obj) === "[object RegExp]" && canTrustToString(obj);
2854
+ return toStr(obj) === "[object RegExp]" && canTrustToString(obj);
2848
2855
  }
2849
2856
  function isError(obj) {
2850
- return toStr$1(obj) === "[object Error]" && canTrustToString(obj);
2857
+ return toStr(obj) === "[object Error]" && canTrustToString(obj);
2851
2858
  }
2852
2859
  function isString(obj) {
2853
- return toStr$1(obj) === "[object String]" && canTrustToString(obj);
2860
+ return toStr(obj) === "[object String]" && canTrustToString(obj);
2854
2861
  }
2855
2862
  function isNumber(obj) {
2856
- return toStr$1(obj) === "[object Number]" && canTrustToString(obj);
2863
+ return toStr(obj) === "[object Number]" && canTrustToString(obj);
2857
2864
  }
2858
2865
  function isBoolean(obj) {
2859
- return toStr$1(obj) === "[object Boolean]" && canTrustToString(obj);
2866
+ return toStr(obj) === "[object Boolean]" && canTrustToString(obj);
2860
2867
  }
2861
2868
  function isSymbol(obj) {
2862
2869
  if (hasShammedSymbols) {
@@ -2892,7 +2899,7 @@ var hasOwn$1 = Object.prototype.hasOwnProperty || function(key) {
2892
2899
  function has$3(obj, key) {
2893
2900
  return hasOwn$1.call(obj, key);
2894
2901
  }
2895
- function toStr$1(obj) {
2902
+ function toStr(obj) {
2896
2903
  return objectToString.call(obj);
2897
2904
  }
2898
2905
  function nameOf(f) {
@@ -3201,7 +3208,7 @@ var syntax = SyntaxError;
3201
3208
  var uri = URIError;
3202
3209
  var abs$1 = Math.abs;
3203
3210
  var floor$1 = Math.floor;
3204
- var max$2 = Math.max;
3211
+ var max$1 = Math.max;
3205
3212
  var min$1 = Math.min;
3206
3213
  var pow$1 = Math.pow;
3207
3214
  var round$1 = Math.round;
@@ -3330,78 +3337,99 @@ function requireObject_getPrototypeOf() {
3330
3337
  Object_getPrototypeOf = $Object2.getPrototypeOf || null;
3331
3338
  return Object_getPrototypeOf;
3332
3339
  }
3333
- var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
3334
- var toStr = Object.prototype.toString;
3335
- var max$1 = Math.max;
3336
- var funcType = "[object Function]";
3337
- var concatty = function concatty2(a2, b) {
3338
- var arr = [];
3339
- for (var i = 0; i < a2.length; i += 1) {
3340
- arr[i] = a2[i];
3341
- }
3342
- for (var j = 0; j < b.length; j += 1) {
3343
- arr[j + a2.length] = b[j];
3344
- }
3345
- return arr;
3346
- };
3347
- var slicy = function slicy2(arrLike, offset) {
3348
- var arr = [];
3349
- for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
3350
- arr[j] = arrLike[i];
3351
- }
3352
- return arr;
3353
- };
3354
- var joiny = function(arr, joiner) {
3355
- var str = "";
3356
- for (var i = 0; i < arr.length; i += 1) {
3357
- str += arr[i];
3358
- if (i + 1 < arr.length) {
3359
- str += joiner;
3340
+ var implementation;
3341
+ var hasRequiredImplementation;
3342
+ function requireImplementation() {
3343
+ if (hasRequiredImplementation) return implementation;
3344
+ hasRequiredImplementation = 1;
3345
+ var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
3346
+ var toStr2 = Object.prototype.toString;
3347
+ var max2 = Math.max;
3348
+ var funcType = "[object Function]";
3349
+ var concatty = function concatty2(a2, b) {
3350
+ var arr = [];
3351
+ for (var i = 0; i < a2.length; i += 1) {
3352
+ arr[i] = a2[i];
3360
3353
  }
3361
- }
3362
- return str;
3363
- };
3364
- var implementation$1 = function bind(that) {
3365
- var target = this;
3366
- if (typeof target !== "function" || toStr.apply(target) !== funcType) {
3367
- throw new TypeError(ERROR_MESSAGE + target);
3368
- }
3369
- var args = slicy(arguments, 1);
3370
- var bound;
3371
- var binder = function() {
3372
- if (this instanceof bound) {
3373
- var result = target.apply(
3374
- this,
3375
- concatty(args, arguments)
3376
- );
3377
- if (Object(result) === result) {
3378
- return result;
3354
+ for (var j = 0; j < b.length; j += 1) {
3355
+ arr[j + a2.length] = b[j];
3356
+ }
3357
+ return arr;
3358
+ };
3359
+ var slicy = function slicy2(arrLike, offset) {
3360
+ var arr = [];
3361
+ for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
3362
+ arr[j] = arrLike[i];
3363
+ }
3364
+ return arr;
3365
+ };
3366
+ var joiny = function(arr, joiner) {
3367
+ var str = "";
3368
+ for (var i = 0; i < arr.length; i += 1) {
3369
+ str += arr[i];
3370
+ if (i + 1 < arr.length) {
3371
+ str += joiner;
3379
3372
  }
3380
- return this;
3381
3373
  }
3382
- return target.apply(
3383
- that,
3384
- concatty(args, arguments)
3385
- );
3374
+ return str;
3386
3375
  };
3387
- var boundLength = max$1(0, target.length - args.length);
3388
- var boundArgs = [];
3389
- for (var i = 0; i < boundLength; i++) {
3390
- boundArgs[i] = "$" + i;
3391
- }
3392
- bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
3393
- if (target.prototype) {
3394
- var Empty = function Empty2() {
3376
+ implementation = function bind2(that) {
3377
+ var target = this;
3378
+ if (typeof target !== "function" || toStr2.apply(target) !== funcType) {
3379
+ throw new TypeError(ERROR_MESSAGE + target);
3380
+ }
3381
+ var args = slicy(arguments, 1);
3382
+ var bound;
3383
+ var binder = function() {
3384
+ if (this instanceof bound) {
3385
+ var result = target.apply(
3386
+ this,
3387
+ concatty(args, arguments)
3388
+ );
3389
+ if (Object(result) === result) {
3390
+ return result;
3391
+ }
3392
+ return this;
3393
+ }
3394
+ return target.apply(
3395
+ that,
3396
+ concatty(args, arguments)
3397
+ );
3395
3398
  };
3396
- Empty.prototype = target.prototype;
3397
- bound.prototype = new Empty();
3398
- Empty.prototype = null;
3399
- }
3400
- return bound;
3401
- };
3402
- var implementation = implementation$1;
3403
- var functionBind = Function.prototype.bind || implementation;
3404
- var functionCall = Function.prototype.call;
3399
+ var boundLength = max2(0, target.length - args.length);
3400
+ var boundArgs = [];
3401
+ for (var i = 0; i < boundLength; i++) {
3402
+ boundArgs[i] = "$" + i;
3403
+ }
3404
+ bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
3405
+ if (target.prototype) {
3406
+ var Empty = function Empty2() {
3407
+ };
3408
+ Empty.prototype = target.prototype;
3409
+ bound.prototype = new Empty();
3410
+ Empty.prototype = null;
3411
+ }
3412
+ return bound;
3413
+ };
3414
+ return implementation;
3415
+ }
3416
+ var functionBind;
3417
+ var hasRequiredFunctionBind;
3418
+ function requireFunctionBind() {
3419
+ if (hasRequiredFunctionBind) return functionBind;
3420
+ hasRequiredFunctionBind = 1;
3421
+ var implementation2 = requireImplementation();
3422
+ functionBind = Function.prototype.bind || implementation2;
3423
+ return functionBind;
3424
+ }
3425
+ var functionCall;
3426
+ var hasRequiredFunctionCall;
3427
+ function requireFunctionCall() {
3428
+ if (hasRequiredFunctionCall) return functionCall;
3429
+ hasRequiredFunctionCall = 1;
3430
+ functionCall = Function.prototype.call;
3431
+ return functionCall;
3432
+ }
3405
3433
  var functionApply;
3406
3434
  var hasRequiredFunctionApply;
3407
3435
  function requireFunctionApply() {
@@ -3411,14 +3439,14 @@ function requireFunctionApply() {
3411
3439
  return functionApply;
3412
3440
  }
3413
3441
  var reflectApply = typeof Reflect !== "undefined" && Reflect && Reflect.apply;
3414
- var bind$2 = functionBind;
3442
+ var bind$2 = requireFunctionBind();
3415
3443
  var $apply$1 = requireFunctionApply();
3416
- var $call$2 = functionCall;
3444
+ var $call$2 = requireFunctionCall();
3417
3445
  var $reflectApply = reflectApply;
3418
3446
  var actualApply = $reflectApply || bind$2.call($call$2, $apply$1);
3419
- var bind$1 = functionBind;
3447
+ var bind$1 = requireFunctionBind();
3420
3448
  var $TypeError$4 = type;
3421
- var $call$1 = functionCall;
3449
+ var $call$1 = requireFunctionCall();
3422
3450
  var $actualApply = actualApply;
3423
3451
  var callBindApplyHelpers = function callBindBasic(args) {
3424
3452
  if (args.length < 1 || typeof args[0] !== "function") {
@@ -3484,8 +3512,8 @@ function requireHasown() {
3484
3512
  hasRequiredHasown = 1;
3485
3513
  var call = Function.prototype.call;
3486
3514
  var $hasOwn = Object.prototype.hasOwnProperty;
3487
- var bind3 = functionBind;
3488
- hasown = bind3.call(call, $hasOwn);
3515
+ var bind2 = requireFunctionBind();
3516
+ hasown = bind2.call(call, $hasOwn);
3489
3517
  return hasown;
3490
3518
  }
3491
3519
  var undefined$1;
@@ -3499,7 +3527,7 @@ var $TypeError$3 = type;
3499
3527
  var $URIError = uri;
3500
3528
  var abs = abs$1;
3501
3529
  var floor = floor$1;
3502
- var max = max$2;
3530
+ var max = max$1;
3503
3531
  var min = min$1;
3504
3532
  var pow = pow$1;
3505
3533
  var round = round$1;
@@ -3533,7 +3561,7 @@ var getProto = requireGetProto();
3533
3561
  var $ObjectGPO = requireObject_getPrototypeOf();
3534
3562
  var $ReflectGPO = requireReflect_getPrototypeOf();
3535
3563
  var $apply = requireFunctionApply();
3536
- var $call = functionCall;
3564
+ var $call = requireFunctionCall();
3537
3565
  var needsEval = {};
3538
3566
  var TypedArray = typeof Uint8Array === "undefined" || !getProto ? undefined$1 : getProto(Uint8Array);
3539
3567
  var INTRINSICS = {
@@ -3704,13 +3732,13 @@ var LEGACY_ALIASES = {
3704
3732
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
3705
3733
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
3706
3734
  };
3707
- var bind2 = functionBind;
3735
+ var bind = requireFunctionBind();
3708
3736
  var hasOwn = requireHasown();
3709
- var $concat = bind2.call($call, Array.prototype.concat);
3710
- var $spliceApply = bind2.call($apply, Array.prototype.splice);
3711
- var $replace = bind2.call($call, String.prototype.replace);
3712
- var $strSlice = bind2.call($call, String.prototype.slice);
3713
- var $exec = bind2.call($call, RegExp.prototype.exec);
3737
+ var $concat = bind.call($call, Array.prototype.concat);
3738
+ var $spliceApply = bind.call($apply, Array.prototype.splice);
3739
+ var $replace = bind.call($call, String.prototype.replace);
3740
+ var $strSlice = bind.call($call, String.prototype.slice);
3741
+ var $exec = bind.call($call, RegExp.prototype.exec);
3714
3742
  var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g;
3715
3743
  var reEscapeChar = /\\(\\)?/g;
3716
3744
  var stringToPath = function stringToPath2(string) {
@@ -12723,7 +12751,7 @@ function resourcefulHasManyThrough(model, options = {}) {
12723
12751
  map.set(propertyKey, opts);
12724
12752
  };
12725
12753
  }
12726
- const version = "0.1.0-master-71781cfd";
12754
+ const version = "0.1.0-master-1570171e";
12727
12755
  export {
12728
12756
  k as definitions,
12729
12757
  w as errors,