@labdigital/commercetools-mock 0.10.0 → 0.11.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.
- package/dist/index.d.ts +353 -188
- package/dist/index.global.js +1007 -876
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +348 -217
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +348 -217
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/ctMock.ts +15 -9
- package/src/helpers.ts +1 -1
- package/src/lib/projectionSearchFilter.ts +3 -2
- package/src/priceSelector.test.ts +1 -3
- package/src/product-projection-search.ts +1 -3
- package/src/projectAPI.test.ts +7 -0
- package/src/projectAPI.ts +17 -22
- package/src/repositories/abstract.ts +31 -24
- package/src/repositories/cart-discount.ts +3 -4
- package/src/repositories/cart.ts +20 -15
- package/src/repositories/category.ts +6 -7
- package/src/repositories/channel.ts +4 -5
- package/src/repositories/custom-object.ts +9 -13
- package/src/repositories/customer-group.ts +3 -4
- package/src/repositories/customer.ts +4 -5
- package/src/repositories/discount-code.ts +4 -5
- package/src/repositories/errors.ts +1 -3
- package/src/repositories/extension.ts +7 -8
- package/src/repositories/helpers.ts +2 -2
- package/src/repositories/index.ts +19 -3
- package/src/repositories/inventory-entry.ts +4 -5
- package/src/repositories/my-order.ts +2 -2
- package/src/repositories/order-edit.ts +39 -0
- package/src/repositories/order.test.ts +16 -11
- package/src/repositories/order.ts +15 -8
- package/src/repositories/payment.ts +6 -7
- package/src/repositories/product-discount.ts +4 -24
- package/src/repositories/product-projection.ts +11 -5
- package/src/repositories/product-selection.ts +40 -0
- package/src/repositories/product-type.ts +11 -28
- package/src/repositories/product.ts +117 -10
- package/src/repositories/project.ts +9 -8
- package/src/repositories/quote-request.ts +28 -0
- package/src/repositories/quote.ts +28 -0
- package/src/repositories/review.ts +34 -0
- package/src/repositories/shipping-method.ts +10 -11
- package/src/repositories/shopping-list.ts +4 -4
- package/src/repositories/staged-quote.ts +29 -0
- package/src/repositories/standalone-price.ts +36 -0
- package/src/repositories/state.ts +15 -8
- package/src/repositories/store.ts +11 -27
- package/src/repositories/subscription.ts +3 -4
- package/src/repositories/tax-category.ts +5 -22
- package/src/repositories/type.ts +12 -13
- package/src/repositories/zone.ts +4 -5
- package/src/server.ts +4 -4
- package/src/services/abstract.ts +3 -5
- package/src/services/cart-discount.ts +1 -1
- package/src/services/cart.test.ts +1 -1
- package/src/services/cart.ts +40 -33
- package/src/services/category.ts +1 -1
- package/src/services/channel.ts +1 -1
- package/src/services/custom-object.test.ts +1 -1
- package/src/services/custom-object.ts +2 -2
- package/src/services/customer-group.ts +1 -1
- package/src/services/customer.test.ts +1 -1
- package/src/services/customer.ts +3 -3
- package/src/services/discount-code.ts +1 -1
- package/src/services/extension.ts +1 -1
- package/src/services/inventory-entry.test.ts +1 -1
- package/src/services/inventory-entry.ts +1 -1
- package/src/services/my-cart.test.ts +2 -0
- package/src/services/my-cart.ts +1 -1
- package/src/services/my-customer.ts +1 -1
- package/src/services/my-order.ts +1 -1
- package/src/services/my-payment.ts +1 -1
- package/src/services/order.test.ts +24 -20
- package/src/services/order.ts +2 -2
- package/src/services/payment.ts +1 -1
- package/src/services/product-discount.ts +1 -17
- package/src/services/product-projection.test.ts +1 -1
- package/src/services/product-projection.ts +2 -2
- package/src/services/product-type.ts +1 -17
- package/src/services/product.test.ts +63 -2
- package/src/services/product.ts +1 -1
- package/src/services/project.ts +4 -5
- package/src/services/shipping-method.ts +1 -1
- package/src/services/shopping-list.ts +1 -1
- package/src/services/state.ts +1 -1
- package/src/services/store.ts +2 -18
- package/src/services/subscription.ts +1 -1
- package/src/services/tax-category.ts +1 -17
- package/src/services/type.ts +1 -1
- package/src/services/zone.ts +1 -1
- package/src/storage/abstract.ts +82 -0
- package/src/{storage.ts → storage/in-memory.ts} +57 -118
- package/src/storage/index.ts +2 -0
- package/src/types.ts +48 -119
package/dist/index.global.js
CHANGED
|
@@ -36771,549 +36771,118 @@ ${this.pendingMocks().join("\n")}`
|
|
|
36771
36771
|
}
|
|
36772
36772
|
});
|
|
36773
36773
|
|
|
36774
|
-
// node_modules/.pnpm/
|
|
36775
|
-
var
|
|
36776
|
-
"node_modules/.pnpm/
|
|
36774
|
+
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/rng.js
|
|
36775
|
+
var require_rng = __commonJS({
|
|
36776
|
+
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/rng.js"(exports) {
|
|
36777
36777
|
"use strict";
|
|
36778
|
-
Object.defineProperty(exports, "__esModule", {
|
|
36779
|
-
|
|
36780
|
-
|
|
36781
|
-
|
|
36782
|
-
|
|
36783
|
-
|
|
36784
|
-
|
|
36785
|
-
|
|
36778
|
+
Object.defineProperty(exports, "__esModule", {
|
|
36779
|
+
value: true
|
|
36780
|
+
});
|
|
36781
|
+
exports.default = rng;
|
|
36782
|
+
var _crypto = _interopRequireDefault(__require("crypto"));
|
|
36783
|
+
function _interopRequireDefault(obj) {
|
|
36784
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
36785
|
+
}
|
|
36786
|
+
var rnds8Pool = new Uint8Array(256);
|
|
36787
|
+
var poolPtr = rnds8Pool.length;
|
|
36788
|
+
function rng() {
|
|
36789
|
+
if (poolPtr > rnds8Pool.length - 16) {
|
|
36790
|
+
_crypto.default.randomFillSync(rnds8Pool);
|
|
36791
|
+
poolPtr = 0;
|
|
36786
36792
|
}
|
|
36787
|
-
|
|
36788
|
-
|
|
36789
|
-
};
|
|
36790
|
-
return LexerState2;
|
|
36791
|
-
}();
|
|
36792
|
-
exports.default = LexerState;
|
|
36793
|
+
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
36794
|
+
}
|
|
36793
36795
|
}
|
|
36794
36796
|
});
|
|
36795
36797
|
|
|
36796
|
-
// node_modules/.pnpm/
|
|
36797
|
-
var
|
|
36798
|
-
"node_modules/.pnpm/
|
|
36798
|
+
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/regex.js
|
|
36799
|
+
var require_regex = __commonJS({
|
|
36800
|
+
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/regex.js"(exports) {
|
|
36799
36801
|
"use strict";
|
|
36800
|
-
|
|
36801
|
-
|
|
36802
|
-
|
|
36803
|
-
|
|
36804
|
-
|
|
36805
|
-
|
|
36806
|
-
d[p] = b[p];
|
|
36807
|
-
};
|
|
36808
|
-
return function(d, b) {
|
|
36809
|
-
extendStatics(d, b);
|
|
36810
|
-
function __() {
|
|
36811
|
-
this.constructor = d;
|
|
36812
|
-
}
|
|
36813
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
36814
|
-
};
|
|
36815
|
-
}();
|
|
36816
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36817
|
-
var Token = function() {
|
|
36818
|
-
function Token2(type, match, groups, start, end, lexer) {
|
|
36819
|
-
this.type = type;
|
|
36820
|
-
this.match = match;
|
|
36821
|
-
this.groups = groups;
|
|
36822
|
-
this.start = start;
|
|
36823
|
-
this.end = end;
|
|
36824
|
-
this.lexer = lexer;
|
|
36825
|
-
}
|
|
36826
|
-
Token2.prototype.strpos = function() {
|
|
36827
|
-
var start = this.lexer.strpos(this.start);
|
|
36828
|
-
var end = this.lexer.strpos(this.end);
|
|
36829
|
-
return { start, end };
|
|
36830
|
-
};
|
|
36831
|
-
Token2.prototype.isEof = function() {
|
|
36832
|
-
return false;
|
|
36833
|
-
};
|
|
36834
|
-
return Token2;
|
|
36835
|
-
}();
|
|
36836
|
-
exports.default = Token;
|
|
36837
|
-
var EOFToken = function(_super) {
|
|
36838
|
-
__extends(EOFToken2, _super);
|
|
36839
|
-
function EOFToken2(lexer) {
|
|
36840
|
-
var _this = this;
|
|
36841
|
-
var end = lexer.source.length;
|
|
36842
|
-
_this = _super.call(this, null, "(eof)", [], end, end, lexer) || this;
|
|
36843
|
-
return _this;
|
|
36844
|
-
}
|
|
36845
|
-
EOFToken2.prototype.isEof = function() {
|
|
36846
|
-
return true;
|
|
36847
|
-
};
|
|
36848
|
-
return EOFToken2;
|
|
36849
|
-
}(Token);
|
|
36850
|
-
exports.EOFToken = EOFToken;
|
|
36851
|
-
exports.EOF = function(lexer) {
|
|
36852
|
-
return new EOFToken(lexer);
|
|
36853
|
-
};
|
|
36802
|
+
Object.defineProperty(exports, "__esModule", {
|
|
36803
|
+
value: true
|
|
36804
|
+
});
|
|
36805
|
+
exports.default = void 0;
|
|
36806
|
+
var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
36807
|
+
exports.default = _default;
|
|
36854
36808
|
}
|
|
36855
36809
|
});
|
|
36856
36810
|
|
|
36857
|
-
// node_modules/.pnpm/
|
|
36858
|
-
var
|
|
36859
|
-
"node_modules/.pnpm/
|
|
36811
|
+
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/validate.js
|
|
36812
|
+
var require_validate = __commonJS({
|
|
36813
|
+
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/validate.js"(exports) {
|
|
36860
36814
|
"use strict";
|
|
36861
|
-
Object.defineProperty(exports, "__esModule", {
|
|
36862
|
-
|
|
36863
|
-
|
|
36815
|
+
Object.defineProperty(exports, "__esModule", {
|
|
36816
|
+
value: true
|
|
36817
|
+
});
|
|
36818
|
+
exports.default = void 0;
|
|
36819
|
+
var _regex = _interopRequireDefault(require_regex());
|
|
36820
|
+
function _interopRequireDefault(obj) {
|
|
36821
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
36864
36822
|
}
|
|
36865
|
-
function
|
|
36866
|
-
|
|
36867
|
-
regex = toRegExp(regex);
|
|
36868
|
-
if (!regex.source.startsWith("^"))
|
|
36869
|
-
return new RegExp("^" + regex.source, regex.flags);
|
|
36870
|
-
else
|
|
36871
|
-
return regex;
|
|
36823
|
+
function validate2(uuid2) {
|
|
36824
|
+
return typeof uuid2 === "string" && _regex.default.test(uuid2);
|
|
36872
36825
|
}
|
|
36873
|
-
|
|
36874
|
-
|
|
36875
|
-
|
|
36876
|
-
|
|
36877
|
-
|
|
36878
|
-
|
|
36879
|
-
|
|
36880
|
-
|
|
36826
|
+
var _default = validate2;
|
|
36827
|
+
exports.default = _default;
|
|
36828
|
+
}
|
|
36829
|
+
});
|
|
36830
|
+
|
|
36831
|
+
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/stringify.js
|
|
36832
|
+
var require_stringify5 = __commonJS({
|
|
36833
|
+
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/stringify.js"(exports) {
|
|
36834
|
+
"use strict";
|
|
36835
|
+
Object.defineProperty(exports, "__esModule", {
|
|
36836
|
+
value: true
|
|
36837
|
+
});
|
|
36838
|
+
exports.default = void 0;
|
|
36839
|
+
var _validate = _interopRequireDefault(require_validate());
|
|
36840
|
+
function _interopRequireDefault(obj) {
|
|
36841
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
36881
36842
|
}
|
|
36882
|
-
var
|
|
36883
|
-
|
|
36884
|
-
|
|
36843
|
+
var byteToHex = [];
|
|
36844
|
+
for (let i = 0; i < 256; ++i) {
|
|
36845
|
+
byteToHex.push((i + 256).toString(16).substr(1));
|
|
36846
|
+
}
|
|
36847
|
+
function stringify2(arr, offset = 0) {
|
|
36848
|
+
const uuid2 = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
36849
|
+
if (!(0, _validate.default)(uuid2)) {
|
|
36850
|
+
throw TypeError("Stringified UUID is invalid");
|
|
36885
36851
|
}
|
|
36886
|
-
|
|
36887
|
-
|
|
36888
|
-
|
|
36889
|
-
|
|
36890
|
-
if (enabled === void 0) {
|
|
36891
|
-
enabled = true;
|
|
36892
|
-
}
|
|
36893
|
-
this.tokenTypes.filter(function(t) {
|
|
36894
|
-
return t.type == type;
|
|
36895
|
-
}).forEach(function(t) {
|
|
36896
|
-
return t.enabled = enabled;
|
|
36897
|
-
});
|
|
36898
|
-
return this;
|
|
36899
|
-
};
|
|
36900
|
-
TokenTypes2.prototype.isEnabled = function(type) {
|
|
36901
|
-
var ttypes = this.tokenTypes.filter(function(tt) {
|
|
36902
|
-
return tt.type == type;
|
|
36903
|
-
});
|
|
36904
|
-
if (ttypes.length == 0)
|
|
36905
|
-
throw new Error("Token of type " + type + " does not exists");
|
|
36906
|
-
return ttypes[0].enabled;
|
|
36907
|
-
};
|
|
36908
|
-
TokenTypes2.prototype.peek = function(source, position) {
|
|
36909
|
-
var s = source.substr(position);
|
|
36910
|
-
return first(this.tokenTypes.filter(function(tt) {
|
|
36911
|
-
return tt.enabled;
|
|
36912
|
-
}), function(tt) {
|
|
36913
|
-
tt.regex.lastIndex = 0;
|
|
36914
|
-
return tt.regex.exec(s);
|
|
36915
|
-
});
|
|
36916
|
-
};
|
|
36917
|
-
TokenTypes2.prototype.token = function(type, pattern, skip) {
|
|
36918
|
-
if (skip === void 0) {
|
|
36919
|
-
skip = false;
|
|
36920
|
-
}
|
|
36921
|
-
this.tokenTypes.push({
|
|
36922
|
-
type,
|
|
36923
|
-
regex: normalize(pattern),
|
|
36924
|
-
enabled: true,
|
|
36925
|
-
skip
|
|
36926
|
-
});
|
|
36927
|
-
return this;
|
|
36928
|
-
};
|
|
36929
|
-
return TokenTypes2;
|
|
36930
|
-
}();
|
|
36931
|
-
exports.default = TokenTypes;
|
|
36852
|
+
return uuid2;
|
|
36853
|
+
}
|
|
36854
|
+
var _default = stringify2;
|
|
36855
|
+
exports.default = _default;
|
|
36932
36856
|
}
|
|
36933
36857
|
});
|
|
36934
36858
|
|
|
36935
|
-
// node_modules/.pnpm/
|
|
36936
|
-
var
|
|
36937
|
-
"node_modules/.pnpm/
|
|
36859
|
+
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/v1.js
|
|
36860
|
+
var require_v1 = __commonJS({
|
|
36861
|
+
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/v1.js"(exports) {
|
|
36938
36862
|
"use strict";
|
|
36939
|
-
Object.defineProperty(exports, "__esModule", {
|
|
36940
|
-
|
|
36941
|
-
|
|
36942
|
-
|
|
36943
|
-
|
|
36944
|
-
|
|
36945
|
-
|
|
36946
|
-
|
|
36947
|
-
|
|
36948
|
-
|
|
36949
|
-
|
|
36950
|
-
|
|
36951
|
-
|
|
36952
|
-
|
|
36953
|
-
|
|
36954
|
-
|
|
36955
|
-
|
|
36956
|
-
|
|
36957
|
-
|
|
36958
|
-
|
|
36959
|
-
|
|
36960
|
-
|
|
36961
|
-
|
|
36962
|
-
enumerable: true,
|
|
36963
|
-
configurable: true
|
|
36964
|
-
});
|
|
36965
|
-
Object.defineProperty(Lexer2.prototype, "source", {
|
|
36966
|
-
get: function() {
|
|
36967
|
-
return this._state.source;
|
|
36968
|
-
},
|
|
36969
|
-
set: function(s) {
|
|
36970
|
-
this._state = new lexer_state_1.default(s);
|
|
36971
|
-
},
|
|
36972
|
-
enumerable: true,
|
|
36973
|
-
configurable: true
|
|
36974
|
-
});
|
|
36975
|
-
Lexer2.prototype.attachTo = function(other) {
|
|
36976
|
-
this._state = other._state;
|
|
36977
|
-
};
|
|
36978
|
-
Lexer2.prototype.disable = function(type) {
|
|
36979
|
-
this._tokenTypes.disable(type);
|
|
36980
|
-
return this;
|
|
36981
|
-
};
|
|
36982
|
-
Lexer2.prototype.enable = function(type, enabled) {
|
|
36983
|
-
this._tokenTypes.enable(type, enabled);
|
|
36984
|
-
return this;
|
|
36985
|
-
};
|
|
36986
|
-
Lexer2.prototype.expect = function(type) {
|
|
36987
|
-
var t = this.next();
|
|
36988
|
-
if (t.type != type) {
|
|
36989
|
-
var pos = t.strpos();
|
|
36990
|
-
throw new Error("Expected " + type + (t ? ", got " + t.type : "") + " at " + pos.start.line + ":" + pos.start.column);
|
|
36991
|
-
}
|
|
36992
|
-
return t;
|
|
36993
|
-
};
|
|
36994
|
-
Lexer2.prototype.isEnabled = function(tokenType) {
|
|
36995
|
-
return this._tokenTypes.isEnabled(tokenType);
|
|
36996
|
-
};
|
|
36997
|
-
Lexer2.prototype.next = function() {
|
|
36998
|
-
try {
|
|
36999
|
-
var t = this.peek();
|
|
37000
|
-
this._state.position = t.end;
|
|
37001
|
-
return t;
|
|
37002
|
-
} catch (e) {
|
|
37003
|
-
this._state.position = e.end;
|
|
37004
|
-
throw e;
|
|
37005
|
-
}
|
|
37006
|
-
};
|
|
37007
|
-
Lexer2.prototype.peek = function(position) {
|
|
37008
|
-
var _this = this;
|
|
37009
|
-
if (position === void 0) {
|
|
37010
|
-
position = this._state.position;
|
|
37011
|
-
}
|
|
37012
|
-
var read = function(i) {
|
|
37013
|
-
if (i === void 0) {
|
|
37014
|
-
i = position;
|
|
37015
|
-
}
|
|
37016
|
-
if (i >= _this._state.source.length)
|
|
37017
|
-
return token_1.EOF(_this);
|
|
37018
|
-
var n = _this._tokenTypes.peek(_this._state.source, i);
|
|
37019
|
-
return n ? n.item.skip ? read(i + n.result[0].length) : new token_1.default(n.item.type, n.result[0], n.result.map(function(x) {
|
|
37020
|
-
return x;
|
|
37021
|
-
}), i, i + n.result[0].length, _this) : null;
|
|
37022
|
-
};
|
|
37023
|
-
var t = read();
|
|
37024
|
-
if (t)
|
|
37025
|
-
return t;
|
|
37026
|
-
var unexpected = this._state.source.substring(position, position + 1);
|
|
37027
|
-
try {
|
|
37028
|
-
this.peek(position + 1);
|
|
37029
|
-
} catch (e2) {
|
|
37030
|
-
unexpected += e2.unexpected;
|
|
37031
|
-
}
|
|
37032
|
-
var _a = this.strpos(position), line = _a.line, column = _a.column;
|
|
37033
|
-
var e = new Error("Unexpected input: " + unexpected + " at (" + line + ":" + column + ")");
|
|
37034
|
-
e.unexpected = unexpected;
|
|
37035
|
-
e.end = position + unexpected.length;
|
|
37036
|
-
throw e;
|
|
37037
|
-
};
|
|
37038
|
-
Lexer2.prototype.strpos = function(i) {
|
|
37039
|
-
var lines = this._state.source.substring(0, i).split(/\r?\n/);
|
|
37040
|
-
if (!Array.isArray(lines))
|
|
37041
|
-
lines = [lines];
|
|
37042
|
-
var line = lines.length;
|
|
37043
|
-
var column = lines[lines.length - 1].length + 1;
|
|
37044
|
-
return { line, column };
|
|
37045
|
-
};
|
|
37046
|
-
Lexer2.prototype.toArray = function() {
|
|
37047
|
-
var oldState = this._state.copy();
|
|
37048
|
-
this._state.position = 0;
|
|
37049
|
-
var tkns = [];
|
|
37050
|
-
var t;
|
|
37051
|
-
while (!(t = this.next()).isEof())
|
|
37052
|
-
tkns.push(t);
|
|
37053
|
-
this._state = oldState;
|
|
37054
|
-
return tkns;
|
|
37055
|
-
};
|
|
37056
|
-
Lexer2.prototype.token = function(type, pattern, skip) {
|
|
37057
|
-
this._tokenTypes.token(type, pattern, skip);
|
|
37058
|
-
return this;
|
|
37059
|
-
};
|
|
37060
|
-
Lexer2.prototype.keyword = function(kwd) {
|
|
37061
|
-
return this.token(kwd, new RegExp(kwd + "(?=\\W|$)"));
|
|
37062
|
-
};
|
|
37063
|
-
Lexer2.prototype.operator = function(op) {
|
|
37064
|
-
var sOp = new String(op).valueOf();
|
|
37065
|
-
return this.token(op, sOp);
|
|
37066
|
-
};
|
|
37067
|
-
return Lexer2;
|
|
37068
|
-
}();
|
|
37069
|
-
exports.default = Lexer;
|
|
37070
|
-
}
|
|
37071
|
-
});
|
|
37072
|
-
|
|
37073
|
-
// node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/index.js
|
|
37074
|
-
var require_perplex = __commonJS({
|
|
37075
|
-
"node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/index.js"(exports, module) {
|
|
37076
|
-
module.exports = require_lexer();
|
|
37077
|
-
}
|
|
37078
|
-
});
|
|
37079
|
-
|
|
37080
|
-
// node_modules/.pnpm/pratt@0.7.0/node_modules/pratt/lib/index.js
|
|
37081
|
-
var require_lib5 = __commonJS({
|
|
37082
|
-
"node_modules/.pnpm/pratt@0.7.0/node_modules/pratt/lib/index.js"(exports) {
|
|
37083
|
-
"use strict";
|
|
37084
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37085
|
-
var createStop = function() {
|
|
37086
|
-
var stopCalled = false;
|
|
37087
|
-
return Object.assign(function(x) {
|
|
37088
|
-
stopCalled = true;
|
|
37089
|
-
return x;
|
|
37090
|
-
}, {
|
|
37091
|
-
isStopped: function() {
|
|
37092
|
-
return stopCalled;
|
|
37093
|
-
}
|
|
37094
|
-
});
|
|
37095
|
-
};
|
|
37096
|
-
var Parser3 = function() {
|
|
37097
|
-
function Parser4(lexer) {
|
|
37098
|
-
this.lexer = lexer;
|
|
37099
|
-
this._nuds = /* @__PURE__ */ new Map();
|
|
37100
|
-
this._leds = /* @__PURE__ */ new Map();
|
|
37101
|
-
this._bps = /* @__PURE__ */ new Map();
|
|
37102
|
-
}
|
|
37103
|
-
Parser4.prototype._type = function(tokenOrType) {
|
|
37104
|
-
return tokenOrType && typeof tokenOrType.isEof == "function" ? tokenOrType.type : tokenOrType;
|
|
37105
|
-
};
|
|
37106
|
-
Parser4.prototype.builder = function() {
|
|
37107
|
-
return new ParserBuilder(this);
|
|
37108
|
-
};
|
|
37109
|
-
Parser4.prototype.bp = function(tokenOrType) {
|
|
37110
|
-
if (tokenOrType == null)
|
|
37111
|
-
return Number.NEGATIVE_INFINITY;
|
|
37112
|
-
if (tokenOrType && typeof tokenOrType.isEof == "function" && tokenOrType.isEof())
|
|
37113
|
-
return Number.NEGATIVE_INFINITY;
|
|
37114
|
-
var type = this._type(tokenOrType);
|
|
37115
|
-
var bp = this._bps.has(type) ? this._bps.get(type) : Number.POSITIVE_INFINITY;
|
|
37116
|
-
return typeof bp == "function" ? bp() : bp;
|
|
37117
|
-
};
|
|
37118
|
-
Parser4.prototype.nud = function(info) {
|
|
37119
|
-
var fn = this._nuds.get(info.token.type);
|
|
37120
|
-
if (!fn) {
|
|
37121
|
-
var start = info.token.strpos().start;
|
|
37122
|
-
throw new Error("Unexpected token: " + info.token.match + " (at " + start.line + ":" + start.column + ")");
|
|
37123
|
-
}
|
|
37124
|
-
return fn(info);
|
|
37125
|
-
};
|
|
37126
|
-
Parser4.prototype.led = function(info) {
|
|
37127
|
-
var fn = this._leds.get(info.token.type);
|
|
37128
|
-
if (!fn) {
|
|
37129
|
-
var start = info.token.strpos().start;
|
|
37130
|
-
throw new Error("Unexpected token: " + info.token.match + " (at " + start.line + ":" + start.column + ")");
|
|
37131
|
-
}
|
|
37132
|
-
return fn(info);
|
|
37133
|
-
};
|
|
37134
|
-
Parser4.prototype.parse = function(opts) {
|
|
37135
|
-
var _this = this;
|
|
37136
|
-
if (opts === void 0) {
|
|
37137
|
-
opts = { terminals: [0] };
|
|
37138
|
-
}
|
|
37139
|
-
var stop = opts.stop = opts.stop || createStop();
|
|
37140
|
-
var check = function() {
|
|
37141
|
-
if (stop.isStopped())
|
|
37142
|
-
return false;
|
|
37143
|
-
var t = _this.lexer.peek();
|
|
37144
|
-
var bp = _this.bp(t);
|
|
37145
|
-
return opts.terminals.reduce(function(canContinue, rbpOrType) {
|
|
37146
|
-
if (!canContinue)
|
|
37147
|
-
return false;
|
|
37148
|
-
if (typeof rbpOrType == "number")
|
|
37149
|
-
return rbpOrType < bp;
|
|
37150
|
-
if (typeof rbpOrType == "string")
|
|
37151
|
-
return t.type != rbpOrType;
|
|
37152
|
-
}, true);
|
|
37153
|
-
};
|
|
37154
|
-
var mkinfo = function(token) {
|
|
37155
|
-
var bp = _this.bp(token);
|
|
37156
|
-
return { token, bp, stop, ctx: opts.ctx, options: opts };
|
|
37157
|
-
};
|
|
37158
|
-
if (!opts.terminals)
|
|
37159
|
-
opts.terminals = [0];
|
|
37160
|
-
if (opts.terminals.length == 0)
|
|
37161
|
-
opts.terminals.push(0);
|
|
37162
|
-
var left = this.nud(mkinfo(this.lexer.next()));
|
|
37163
|
-
while (check()) {
|
|
37164
|
-
var operator = this.lexer.next();
|
|
37165
|
-
left = this.led(Object.assign(mkinfo(operator), { left }));
|
|
37166
|
-
}
|
|
37167
|
-
return left;
|
|
37168
|
-
};
|
|
37169
|
-
return Parser4;
|
|
37170
|
-
}();
|
|
37171
|
-
exports.Parser = Parser3;
|
|
37172
|
-
var ParserBuilder = function() {
|
|
37173
|
-
function ParserBuilder2(parser) {
|
|
37174
|
-
this._parser = parser;
|
|
37175
|
-
}
|
|
37176
|
-
ParserBuilder2.prototype.nud = function(tokenType, bp, fn) {
|
|
37177
|
-
this._parser._nuds.set(tokenType, fn);
|
|
37178
|
-
this.bp(tokenType, bp);
|
|
37179
|
-
return this;
|
|
37180
|
-
};
|
|
37181
|
-
ParserBuilder2.prototype.led = function(tokenType, bp, fn) {
|
|
37182
|
-
this._parser._leds.set(tokenType, fn);
|
|
37183
|
-
this.bp(tokenType, bp);
|
|
37184
|
-
return this;
|
|
37185
|
-
};
|
|
37186
|
-
ParserBuilder2.prototype.either = function(tokenType, bp, fn) {
|
|
37187
|
-
return this.nud(tokenType, bp, function(inf) {
|
|
37188
|
-
return fn(Object.assign(inf, { left: null }));
|
|
37189
|
-
}).led(tokenType, bp, fn);
|
|
37190
|
-
};
|
|
37191
|
-
ParserBuilder2.prototype.bp = function(tokenType, bp) {
|
|
37192
|
-
this._parser._bps.set(tokenType, bp);
|
|
37193
|
-
return this;
|
|
37194
|
-
};
|
|
37195
|
-
ParserBuilder2.prototype.build = function() {
|
|
37196
|
-
return this._parser;
|
|
37197
|
-
};
|
|
37198
|
-
return ParserBuilder2;
|
|
37199
|
-
}();
|
|
37200
|
-
exports.ParserBuilder = ParserBuilder;
|
|
37201
|
-
exports.default = Parser3;
|
|
37202
|
-
}
|
|
37203
|
-
});
|
|
37204
|
-
|
|
37205
|
-
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/rng.js
|
|
37206
|
-
var require_rng = __commonJS({
|
|
37207
|
-
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/rng.js"(exports) {
|
|
37208
|
-
"use strict";
|
|
37209
|
-
Object.defineProperty(exports, "__esModule", {
|
|
37210
|
-
value: true
|
|
37211
|
-
});
|
|
37212
|
-
exports.default = rng;
|
|
37213
|
-
var _crypto = _interopRequireDefault(__require("crypto"));
|
|
37214
|
-
function _interopRequireDefault(obj) {
|
|
37215
|
-
return obj && obj.__esModule ? obj : { default: obj };
|
|
37216
|
-
}
|
|
37217
|
-
var rnds8Pool = new Uint8Array(256);
|
|
37218
|
-
var poolPtr = rnds8Pool.length;
|
|
37219
|
-
function rng() {
|
|
37220
|
-
if (poolPtr > rnds8Pool.length - 16) {
|
|
37221
|
-
_crypto.default.randomFillSync(rnds8Pool);
|
|
37222
|
-
poolPtr = 0;
|
|
37223
|
-
}
|
|
37224
|
-
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
37225
|
-
}
|
|
37226
|
-
}
|
|
37227
|
-
});
|
|
37228
|
-
|
|
37229
|
-
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/regex.js
|
|
37230
|
-
var require_regex = __commonJS({
|
|
37231
|
-
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/regex.js"(exports) {
|
|
37232
|
-
"use strict";
|
|
37233
|
-
Object.defineProperty(exports, "__esModule", {
|
|
37234
|
-
value: true
|
|
37235
|
-
});
|
|
37236
|
-
exports.default = void 0;
|
|
37237
|
-
var _default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
37238
|
-
exports.default = _default;
|
|
37239
|
-
}
|
|
37240
|
-
});
|
|
37241
|
-
|
|
37242
|
-
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/validate.js
|
|
37243
|
-
var require_validate = __commonJS({
|
|
37244
|
-
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/validate.js"(exports) {
|
|
37245
|
-
"use strict";
|
|
37246
|
-
Object.defineProperty(exports, "__esModule", {
|
|
37247
|
-
value: true
|
|
37248
|
-
});
|
|
37249
|
-
exports.default = void 0;
|
|
37250
|
-
var _regex = _interopRequireDefault(require_regex());
|
|
37251
|
-
function _interopRequireDefault(obj) {
|
|
37252
|
-
return obj && obj.__esModule ? obj : { default: obj };
|
|
37253
|
-
}
|
|
37254
|
-
function validate2(uuid2) {
|
|
37255
|
-
return typeof uuid2 === "string" && _regex.default.test(uuid2);
|
|
37256
|
-
}
|
|
37257
|
-
var _default = validate2;
|
|
37258
|
-
exports.default = _default;
|
|
37259
|
-
}
|
|
37260
|
-
});
|
|
37261
|
-
|
|
37262
|
-
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/stringify.js
|
|
37263
|
-
var require_stringify5 = __commonJS({
|
|
37264
|
-
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/stringify.js"(exports) {
|
|
37265
|
-
"use strict";
|
|
37266
|
-
Object.defineProperty(exports, "__esModule", {
|
|
37267
|
-
value: true
|
|
37268
|
-
});
|
|
37269
|
-
exports.default = void 0;
|
|
37270
|
-
var _validate = _interopRequireDefault(require_validate());
|
|
37271
|
-
function _interopRequireDefault(obj) {
|
|
37272
|
-
return obj && obj.__esModule ? obj : { default: obj };
|
|
37273
|
-
}
|
|
37274
|
-
var byteToHex = [];
|
|
37275
|
-
for (let i = 0; i < 256; ++i) {
|
|
37276
|
-
byteToHex.push((i + 256).toString(16).substr(1));
|
|
37277
|
-
}
|
|
37278
|
-
function stringify2(arr, offset = 0) {
|
|
37279
|
-
const uuid2 = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
37280
|
-
if (!(0, _validate.default)(uuid2)) {
|
|
37281
|
-
throw TypeError("Stringified UUID is invalid");
|
|
37282
|
-
}
|
|
37283
|
-
return uuid2;
|
|
37284
|
-
}
|
|
37285
|
-
var _default = stringify2;
|
|
37286
|
-
exports.default = _default;
|
|
37287
|
-
}
|
|
37288
|
-
});
|
|
37289
|
-
|
|
37290
|
-
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/v1.js
|
|
37291
|
-
var require_v1 = __commonJS({
|
|
37292
|
-
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/v1.js"(exports) {
|
|
37293
|
-
"use strict";
|
|
37294
|
-
Object.defineProperty(exports, "__esModule", {
|
|
37295
|
-
value: true
|
|
37296
|
-
});
|
|
37297
|
-
exports.default = void 0;
|
|
37298
|
-
var _rng = _interopRequireDefault(require_rng());
|
|
37299
|
-
var _stringify = _interopRequireDefault(require_stringify5());
|
|
37300
|
-
function _interopRequireDefault(obj) {
|
|
37301
|
-
return obj && obj.__esModule ? obj : { default: obj };
|
|
37302
|
-
}
|
|
37303
|
-
var _nodeId;
|
|
37304
|
-
var _clockseq;
|
|
37305
|
-
var _lastMSecs = 0;
|
|
37306
|
-
var _lastNSecs = 0;
|
|
37307
|
-
function v12(options, buf, offset) {
|
|
37308
|
-
let i = buf && offset || 0;
|
|
37309
|
-
const b = buf || new Array(16);
|
|
37310
|
-
options = options || {};
|
|
37311
|
-
let node = options.node || _nodeId;
|
|
37312
|
-
let clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq;
|
|
37313
|
-
if (node == null || clockseq == null) {
|
|
37314
|
-
const seedBytes = options.random || (options.rng || _rng.default)();
|
|
37315
|
-
if (node == null) {
|
|
37316
|
-
node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
|
36863
|
+
Object.defineProperty(exports, "__esModule", {
|
|
36864
|
+
value: true
|
|
36865
|
+
});
|
|
36866
|
+
exports.default = void 0;
|
|
36867
|
+
var _rng = _interopRequireDefault(require_rng());
|
|
36868
|
+
var _stringify = _interopRequireDefault(require_stringify5());
|
|
36869
|
+
function _interopRequireDefault(obj) {
|
|
36870
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
36871
|
+
}
|
|
36872
|
+
var _nodeId;
|
|
36873
|
+
var _clockseq;
|
|
36874
|
+
var _lastMSecs = 0;
|
|
36875
|
+
var _lastNSecs = 0;
|
|
36876
|
+
function v12(options, buf, offset) {
|
|
36877
|
+
let i = buf && offset || 0;
|
|
36878
|
+
const b = buf || new Array(16);
|
|
36879
|
+
options = options || {};
|
|
36880
|
+
let node = options.node || _nodeId;
|
|
36881
|
+
let clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq;
|
|
36882
|
+
if (node == null || clockseq == null) {
|
|
36883
|
+
const seedBytes = options.random || (options.rng || _rng.default)();
|
|
36884
|
+
if (node == null) {
|
|
36885
|
+
node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
|
|
37317
36886
|
}
|
|
37318
36887
|
if (clockseq == null) {
|
|
37319
36888
|
clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383;
|
|
@@ -37537,159 +37106,590 @@ ${this.pendingMocks().join("\n")}`
|
|
|
37537
37106
|
}
|
|
37538
37107
|
});
|
|
37539
37108
|
|
|
37540
|
-
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/sha1.js
|
|
37541
|
-
var require_sha1 = __commonJS({
|
|
37542
|
-
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/sha1.js"(exports) {
|
|
37109
|
+
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/sha1.js
|
|
37110
|
+
var require_sha1 = __commonJS({
|
|
37111
|
+
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/sha1.js"(exports) {
|
|
37112
|
+
"use strict";
|
|
37113
|
+
Object.defineProperty(exports, "__esModule", {
|
|
37114
|
+
value: true
|
|
37115
|
+
});
|
|
37116
|
+
exports.default = void 0;
|
|
37117
|
+
var _crypto = _interopRequireDefault(__require("crypto"));
|
|
37118
|
+
function _interopRequireDefault(obj) {
|
|
37119
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
37120
|
+
}
|
|
37121
|
+
function sha1(bytes) {
|
|
37122
|
+
if (Array.isArray(bytes)) {
|
|
37123
|
+
bytes = Buffer.from(bytes);
|
|
37124
|
+
} else if (typeof bytes === "string") {
|
|
37125
|
+
bytes = Buffer.from(bytes, "utf8");
|
|
37126
|
+
}
|
|
37127
|
+
return _crypto.default.createHash("sha1").update(bytes).digest();
|
|
37128
|
+
}
|
|
37129
|
+
var _default = sha1;
|
|
37130
|
+
exports.default = _default;
|
|
37131
|
+
}
|
|
37132
|
+
});
|
|
37133
|
+
|
|
37134
|
+
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/v5.js
|
|
37135
|
+
var require_v5 = __commonJS({
|
|
37136
|
+
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/v5.js"(exports) {
|
|
37137
|
+
"use strict";
|
|
37138
|
+
Object.defineProperty(exports, "__esModule", {
|
|
37139
|
+
value: true
|
|
37140
|
+
});
|
|
37141
|
+
exports.default = void 0;
|
|
37142
|
+
var _v = _interopRequireDefault(require_v35());
|
|
37143
|
+
var _sha = _interopRequireDefault(require_sha1());
|
|
37144
|
+
function _interopRequireDefault(obj) {
|
|
37145
|
+
return obj && obj.__esModule ? obj : { default: obj };
|
|
37146
|
+
}
|
|
37147
|
+
var v52 = (0, _v.default)("v5", 80, _sha.default);
|
|
37148
|
+
var _default = v52;
|
|
37149
|
+
exports.default = _default;
|
|
37150
|
+
}
|
|
37151
|
+
});
|
|
37152
|
+
|
|
37153
|
+
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/nil.js
|
|
37154
|
+
var require_nil = __commonJS({
|
|
37155
|
+
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/nil.js"(exports) {
|
|
37156
|
+
"use strict";
|
|
37157
|
+
Object.defineProperty(exports, "__esModule", {
|
|
37158
|
+
value: true
|
|
37159
|
+
});
|
|
37160
|
+
exports.default = void 0;
|
|
37161
|
+
var _default = "00000000-0000-0000-0000-000000000000";
|
|
37162
|
+
exports.default = _default;
|
|
37163
|
+
}
|
|
37164
|
+
});
|
|
37165
|
+
|
|
37166
|
+
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/version.js
|
|
37167
|
+
var require_version = __commonJS({
|
|
37168
|
+
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/version.js"(exports) {
|
|
37543
37169
|
"use strict";
|
|
37544
37170
|
Object.defineProperty(exports, "__esModule", {
|
|
37545
37171
|
value: true
|
|
37546
37172
|
});
|
|
37547
37173
|
exports.default = void 0;
|
|
37548
|
-
var
|
|
37174
|
+
var _validate = _interopRequireDefault(require_validate());
|
|
37549
37175
|
function _interopRequireDefault(obj) {
|
|
37550
37176
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
37551
37177
|
}
|
|
37552
|
-
function
|
|
37553
|
-
if (
|
|
37554
|
-
|
|
37555
|
-
} else if (typeof bytes === "string") {
|
|
37556
|
-
bytes = Buffer.from(bytes, "utf8");
|
|
37178
|
+
function version2(uuid2) {
|
|
37179
|
+
if (!(0, _validate.default)(uuid2)) {
|
|
37180
|
+
throw TypeError("Invalid UUID");
|
|
37557
37181
|
}
|
|
37558
|
-
return
|
|
37182
|
+
return parseInt(uuid2.substr(14, 1), 16);
|
|
37559
37183
|
}
|
|
37560
|
-
var _default =
|
|
37184
|
+
var _default = version2;
|
|
37561
37185
|
exports.default = _default;
|
|
37562
37186
|
}
|
|
37563
37187
|
});
|
|
37564
37188
|
|
|
37565
|
-
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/
|
|
37566
|
-
var
|
|
37567
|
-
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/
|
|
37189
|
+
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/index.js
|
|
37190
|
+
var require_dist = __commonJS({
|
|
37191
|
+
"node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/dist/index.js"(exports) {
|
|
37568
37192
|
"use strict";
|
|
37569
37193
|
Object.defineProperty(exports, "__esModule", {
|
|
37570
37194
|
value: true
|
|
37571
37195
|
});
|
|
37572
|
-
exports
|
|
37573
|
-
|
|
37574
|
-
|
|
37196
|
+
Object.defineProperty(exports, "v1", {
|
|
37197
|
+
enumerable: true,
|
|
37198
|
+
get: function() {
|
|
37199
|
+
return _v.default;
|
|
37200
|
+
}
|
|
37201
|
+
});
|
|
37202
|
+
Object.defineProperty(exports, "v3", {
|
|
37203
|
+
enumerable: true,
|
|
37204
|
+
get: function() {
|
|
37205
|
+
return _v2.default;
|
|
37206
|
+
}
|
|
37207
|
+
});
|
|
37208
|
+
Object.defineProperty(exports, "v4", {
|
|
37209
|
+
enumerable: true,
|
|
37210
|
+
get: function() {
|
|
37211
|
+
return _v3.default;
|
|
37212
|
+
}
|
|
37213
|
+
});
|
|
37214
|
+
Object.defineProperty(exports, "v5", {
|
|
37215
|
+
enumerable: true,
|
|
37216
|
+
get: function() {
|
|
37217
|
+
return _v4.default;
|
|
37218
|
+
}
|
|
37219
|
+
});
|
|
37220
|
+
Object.defineProperty(exports, "NIL", {
|
|
37221
|
+
enumerable: true,
|
|
37222
|
+
get: function() {
|
|
37223
|
+
return _nil.default;
|
|
37224
|
+
}
|
|
37225
|
+
});
|
|
37226
|
+
Object.defineProperty(exports, "version", {
|
|
37227
|
+
enumerable: true,
|
|
37228
|
+
get: function() {
|
|
37229
|
+
return _version.default;
|
|
37230
|
+
}
|
|
37231
|
+
});
|
|
37232
|
+
Object.defineProperty(exports, "validate", {
|
|
37233
|
+
enumerable: true,
|
|
37234
|
+
get: function() {
|
|
37235
|
+
return _validate.default;
|
|
37236
|
+
}
|
|
37237
|
+
});
|
|
37238
|
+
Object.defineProperty(exports, "stringify", {
|
|
37239
|
+
enumerable: true,
|
|
37240
|
+
get: function() {
|
|
37241
|
+
return _stringify.default;
|
|
37242
|
+
}
|
|
37243
|
+
});
|
|
37244
|
+
Object.defineProperty(exports, "parse", {
|
|
37245
|
+
enumerable: true,
|
|
37246
|
+
get: function() {
|
|
37247
|
+
return _parse.default;
|
|
37248
|
+
}
|
|
37249
|
+
});
|
|
37250
|
+
var _v = _interopRequireDefault(require_v1());
|
|
37251
|
+
var _v2 = _interopRequireDefault(require_v3());
|
|
37252
|
+
var _v3 = _interopRequireDefault(require_v4());
|
|
37253
|
+
var _v4 = _interopRequireDefault(require_v5());
|
|
37254
|
+
var _nil = _interopRequireDefault(require_nil());
|
|
37255
|
+
var _version = _interopRequireDefault(require_version());
|
|
37256
|
+
var _validate = _interopRequireDefault(require_validate());
|
|
37257
|
+
var _stringify = _interopRequireDefault(require_stringify5());
|
|
37258
|
+
var _parse = _interopRequireDefault(require_parse5());
|
|
37575
37259
|
function _interopRequireDefault(obj) {
|
|
37576
37260
|
return obj && obj.__esModule ? obj : { default: obj };
|
|
37577
37261
|
}
|
|
37578
|
-
var v52 = (0, _v.default)("v5", 80, _sha.default);
|
|
37579
|
-
var _default = v52;
|
|
37580
|
-
exports.default = _default;
|
|
37581
37262
|
}
|
|
37582
37263
|
});
|
|
37583
37264
|
|
|
37584
|
-
// node_modules/.pnpm/
|
|
37585
|
-
var
|
|
37586
|
-
"node_modules/.pnpm/
|
|
37265
|
+
// node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/lib/lexer-state.js
|
|
37266
|
+
var require_lexer_state = __commonJS({
|
|
37267
|
+
"node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/lib/lexer-state.js"(exports) {
|
|
37268
|
+
"use strict";
|
|
37269
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37270
|
+
var LexerState = function() {
|
|
37271
|
+
function LexerState2(source, position) {
|
|
37272
|
+
if (position === void 0) {
|
|
37273
|
+
position = 0;
|
|
37274
|
+
}
|
|
37275
|
+
this.source = source;
|
|
37276
|
+
this.position = position;
|
|
37277
|
+
}
|
|
37278
|
+
LexerState2.prototype.copy = function() {
|
|
37279
|
+
return new LexerState2(this.source, this.position);
|
|
37280
|
+
};
|
|
37281
|
+
return LexerState2;
|
|
37282
|
+
}();
|
|
37283
|
+
exports.default = LexerState;
|
|
37284
|
+
}
|
|
37285
|
+
});
|
|
37286
|
+
|
|
37287
|
+
// node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/lib/token.js
|
|
37288
|
+
var require_token = __commonJS({
|
|
37289
|
+
"node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/lib/token.js"(exports) {
|
|
37290
|
+
"use strict";
|
|
37291
|
+
var __extends = exports && exports.__extends || function() {
|
|
37292
|
+
var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
|
|
37293
|
+
d.__proto__ = b;
|
|
37294
|
+
} || function(d, b) {
|
|
37295
|
+
for (var p in b)
|
|
37296
|
+
if (b.hasOwnProperty(p))
|
|
37297
|
+
d[p] = b[p];
|
|
37298
|
+
};
|
|
37299
|
+
return function(d, b) {
|
|
37300
|
+
extendStatics(d, b);
|
|
37301
|
+
function __() {
|
|
37302
|
+
this.constructor = d;
|
|
37303
|
+
}
|
|
37304
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
37305
|
+
};
|
|
37306
|
+
}();
|
|
37307
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37308
|
+
var Token = function() {
|
|
37309
|
+
function Token2(type, match, groups, start, end, lexer) {
|
|
37310
|
+
this.type = type;
|
|
37311
|
+
this.match = match;
|
|
37312
|
+
this.groups = groups;
|
|
37313
|
+
this.start = start;
|
|
37314
|
+
this.end = end;
|
|
37315
|
+
this.lexer = lexer;
|
|
37316
|
+
}
|
|
37317
|
+
Token2.prototype.strpos = function() {
|
|
37318
|
+
var start = this.lexer.strpos(this.start);
|
|
37319
|
+
var end = this.lexer.strpos(this.end);
|
|
37320
|
+
return { start, end };
|
|
37321
|
+
};
|
|
37322
|
+
Token2.prototype.isEof = function() {
|
|
37323
|
+
return false;
|
|
37324
|
+
};
|
|
37325
|
+
return Token2;
|
|
37326
|
+
}();
|
|
37327
|
+
exports.default = Token;
|
|
37328
|
+
var EOFToken = function(_super) {
|
|
37329
|
+
__extends(EOFToken2, _super);
|
|
37330
|
+
function EOFToken2(lexer) {
|
|
37331
|
+
var _this = this;
|
|
37332
|
+
var end = lexer.source.length;
|
|
37333
|
+
_this = _super.call(this, null, "(eof)", [], end, end, lexer) || this;
|
|
37334
|
+
return _this;
|
|
37335
|
+
}
|
|
37336
|
+
EOFToken2.prototype.isEof = function() {
|
|
37337
|
+
return true;
|
|
37338
|
+
};
|
|
37339
|
+
return EOFToken2;
|
|
37340
|
+
}(Token);
|
|
37341
|
+
exports.EOFToken = EOFToken;
|
|
37342
|
+
exports.EOF = function(lexer) {
|
|
37343
|
+
return new EOFToken(lexer);
|
|
37344
|
+
};
|
|
37345
|
+
}
|
|
37346
|
+
});
|
|
37347
|
+
|
|
37348
|
+
// node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/lib/token-types.js
|
|
37349
|
+
var require_token_types = __commonJS({
|
|
37350
|
+
"node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/lib/token-types.js"(exports) {
|
|
37351
|
+
"use strict";
|
|
37352
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37353
|
+
function toRegExp(str) {
|
|
37354
|
+
return new RegExp(str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"));
|
|
37355
|
+
}
|
|
37356
|
+
function normalize(regex) {
|
|
37357
|
+
if (typeof regex === "string")
|
|
37358
|
+
regex = toRegExp(regex);
|
|
37359
|
+
if (!regex.source.startsWith("^"))
|
|
37360
|
+
return new RegExp("^" + regex.source, regex.flags);
|
|
37361
|
+
else
|
|
37362
|
+
return regex;
|
|
37363
|
+
}
|
|
37364
|
+
function first(arr, predicate) {
|
|
37365
|
+
var i = 0;
|
|
37366
|
+
for (var _i = 0, arr_1 = arr; _i < arr_1.length; _i++) {
|
|
37367
|
+
var item = arr_1[_i];
|
|
37368
|
+
var result = predicate(item, i++);
|
|
37369
|
+
if (result)
|
|
37370
|
+
return { item, result };
|
|
37371
|
+
}
|
|
37372
|
+
}
|
|
37373
|
+
var TokenTypes = function() {
|
|
37374
|
+
function TokenTypes2() {
|
|
37375
|
+
this.tokenTypes = [];
|
|
37376
|
+
}
|
|
37377
|
+
TokenTypes2.prototype.disable = function(type) {
|
|
37378
|
+
return this.enable(type, false);
|
|
37379
|
+
};
|
|
37380
|
+
TokenTypes2.prototype.enable = function(type, enabled) {
|
|
37381
|
+
if (enabled === void 0) {
|
|
37382
|
+
enabled = true;
|
|
37383
|
+
}
|
|
37384
|
+
this.tokenTypes.filter(function(t) {
|
|
37385
|
+
return t.type == type;
|
|
37386
|
+
}).forEach(function(t) {
|
|
37387
|
+
return t.enabled = enabled;
|
|
37388
|
+
});
|
|
37389
|
+
return this;
|
|
37390
|
+
};
|
|
37391
|
+
TokenTypes2.prototype.isEnabled = function(type) {
|
|
37392
|
+
var ttypes = this.tokenTypes.filter(function(tt) {
|
|
37393
|
+
return tt.type == type;
|
|
37394
|
+
});
|
|
37395
|
+
if (ttypes.length == 0)
|
|
37396
|
+
throw new Error("Token of type " + type + " does not exists");
|
|
37397
|
+
return ttypes[0].enabled;
|
|
37398
|
+
};
|
|
37399
|
+
TokenTypes2.prototype.peek = function(source, position) {
|
|
37400
|
+
var s = source.substr(position);
|
|
37401
|
+
return first(this.tokenTypes.filter(function(tt) {
|
|
37402
|
+
return tt.enabled;
|
|
37403
|
+
}), function(tt) {
|
|
37404
|
+
tt.regex.lastIndex = 0;
|
|
37405
|
+
return tt.regex.exec(s);
|
|
37406
|
+
});
|
|
37407
|
+
};
|
|
37408
|
+
TokenTypes2.prototype.token = function(type, pattern, skip) {
|
|
37409
|
+
if (skip === void 0) {
|
|
37410
|
+
skip = false;
|
|
37411
|
+
}
|
|
37412
|
+
this.tokenTypes.push({
|
|
37413
|
+
type,
|
|
37414
|
+
regex: normalize(pattern),
|
|
37415
|
+
enabled: true,
|
|
37416
|
+
skip
|
|
37417
|
+
});
|
|
37418
|
+
return this;
|
|
37419
|
+
};
|
|
37420
|
+
return TokenTypes2;
|
|
37421
|
+
}();
|
|
37422
|
+
exports.default = TokenTypes;
|
|
37423
|
+
}
|
|
37424
|
+
});
|
|
37425
|
+
|
|
37426
|
+
// node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/lib/lexer.js
|
|
37427
|
+
var require_lexer = __commonJS({
|
|
37428
|
+
"node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/lib/lexer.js"(exports) {
|
|
37587
37429
|
"use strict";
|
|
37588
|
-
Object.defineProperty(exports, "__esModule", {
|
|
37589
|
-
|
|
37590
|
-
|
|
37591
|
-
|
|
37592
|
-
|
|
37593
|
-
exports.
|
|
37430
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37431
|
+
var lexer_state_1 = require_lexer_state();
|
|
37432
|
+
exports.LexerState = lexer_state_1.default;
|
|
37433
|
+
var token_1 = require_token();
|
|
37434
|
+
exports.Token = token_1.default;
|
|
37435
|
+
exports.EOF = token_1.EOF;
|
|
37436
|
+
var token_types_1 = require_token_types();
|
|
37437
|
+
exports.TokenTypes = token_types_1.default;
|
|
37438
|
+
var Lexer = function() {
|
|
37439
|
+
function Lexer2(source) {
|
|
37440
|
+
if (source === void 0) {
|
|
37441
|
+
source = "";
|
|
37442
|
+
}
|
|
37443
|
+
this._state = new lexer_state_1.default(source);
|
|
37444
|
+
this._tokenTypes = new token_types_1.default();
|
|
37445
|
+
}
|
|
37446
|
+
Object.defineProperty(Lexer2.prototype, "position", {
|
|
37447
|
+
get: function() {
|
|
37448
|
+
return this._state.position;
|
|
37449
|
+
},
|
|
37450
|
+
set: function(i) {
|
|
37451
|
+
this._state.position = i;
|
|
37452
|
+
},
|
|
37453
|
+
enumerable: true,
|
|
37454
|
+
configurable: true
|
|
37455
|
+
});
|
|
37456
|
+
Object.defineProperty(Lexer2.prototype, "source", {
|
|
37457
|
+
get: function() {
|
|
37458
|
+
return this._state.source;
|
|
37459
|
+
},
|
|
37460
|
+
set: function(s) {
|
|
37461
|
+
this._state = new lexer_state_1.default(s);
|
|
37462
|
+
},
|
|
37463
|
+
enumerable: true,
|
|
37464
|
+
configurable: true
|
|
37465
|
+
});
|
|
37466
|
+
Lexer2.prototype.attachTo = function(other) {
|
|
37467
|
+
this._state = other._state;
|
|
37468
|
+
};
|
|
37469
|
+
Lexer2.prototype.disable = function(type) {
|
|
37470
|
+
this._tokenTypes.disable(type);
|
|
37471
|
+
return this;
|
|
37472
|
+
};
|
|
37473
|
+
Lexer2.prototype.enable = function(type, enabled) {
|
|
37474
|
+
this._tokenTypes.enable(type, enabled);
|
|
37475
|
+
return this;
|
|
37476
|
+
};
|
|
37477
|
+
Lexer2.prototype.expect = function(type) {
|
|
37478
|
+
var t = this.next();
|
|
37479
|
+
if (t.type != type) {
|
|
37480
|
+
var pos = t.strpos();
|
|
37481
|
+
throw new Error("Expected " + type + (t ? ", got " + t.type : "") + " at " + pos.start.line + ":" + pos.start.column);
|
|
37482
|
+
}
|
|
37483
|
+
return t;
|
|
37484
|
+
};
|
|
37485
|
+
Lexer2.prototype.isEnabled = function(tokenType) {
|
|
37486
|
+
return this._tokenTypes.isEnabled(tokenType);
|
|
37487
|
+
};
|
|
37488
|
+
Lexer2.prototype.next = function() {
|
|
37489
|
+
try {
|
|
37490
|
+
var t = this.peek();
|
|
37491
|
+
this._state.position = t.end;
|
|
37492
|
+
return t;
|
|
37493
|
+
} catch (e) {
|
|
37494
|
+
this._state.position = e.end;
|
|
37495
|
+
throw e;
|
|
37496
|
+
}
|
|
37497
|
+
};
|
|
37498
|
+
Lexer2.prototype.peek = function(position) {
|
|
37499
|
+
var _this = this;
|
|
37500
|
+
if (position === void 0) {
|
|
37501
|
+
position = this._state.position;
|
|
37502
|
+
}
|
|
37503
|
+
var read = function(i) {
|
|
37504
|
+
if (i === void 0) {
|
|
37505
|
+
i = position;
|
|
37506
|
+
}
|
|
37507
|
+
if (i >= _this._state.source.length)
|
|
37508
|
+
return token_1.EOF(_this);
|
|
37509
|
+
var n = _this._tokenTypes.peek(_this._state.source, i);
|
|
37510
|
+
return n ? n.item.skip ? read(i + n.result[0].length) : new token_1.default(n.item.type, n.result[0], n.result.map(function(x) {
|
|
37511
|
+
return x;
|
|
37512
|
+
}), i, i + n.result[0].length, _this) : null;
|
|
37513
|
+
};
|
|
37514
|
+
var t = read();
|
|
37515
|
+
if (t)
|
|
37516
|
+
return t;
|
|
37517
|
+
var unexpected = this._state.source.substring(position, position + 1);
|
|
37518
|
+
try {
|
|
37519
|
+
this.peek(position + 1);
|
|
37520
|
+
} catch (e2) {
|
|
37521
|
+
unexpected += e2.unexpected;
|
|
37522
|
+
}
|
|
37523
|
+
var _a = this.strpos(position), line = _a.line, column = _a.column;
|
|
37524
|
+
var e = new Error("Unexpected input: " + unexpected + " at (" + line + ":" + column + ")");
|
|
37525
|
+
e.unexpected = unexpected;
|
|
37526
|
+
e.end = position + unexpected.length;
|
|
37527
|
+
throw e;
|
|
37528
|
+
};
|
|
37529
|
+
Lexer2.prototype.strpos = function(i) {
|
|
37530
|
+
var lines = this._state.source.substring(0, i).split(/\r?\n/);
|
|
37531
|
+
if (!Array.isArray(lines))
|
|
37532
|
+
lines = [lines];
|
|
37533
|
+
var line = lines.length;
|
|
37534
|
+
var column = lines[lines.length - 1].length + 1;
|
|
37535
|
+
return { line, column };
|
|
37536
|
+
};
|
|
37537
|
+
Lexer2.prototype.toArray = function() {
|
|
37538
|
+
var oldState = this._state.copy();
|
|
37539
|
+
this._state.position = 0;
|
|
37540
|
+
var tkns = [];
|
|
37541
|
+
var t;
|
|
37542
|
+
while (!(t = this.next()).isEof())
|
|
37543
|
+
tkns.push(t);
|
|
37544
|
+
this._state = oldState;
|
|
37545
|
+
return tkns;
|
|
37546
|
+
};
|
|
37547
|
+
Lexer2.prototype.token = function(type, pattern, skip) {
|
|
37548
|
+
this._tokenTypes.token(type, pattern, skip);
|
|
37549
|
+
return this;
|
|
37550
|
+
};
|
|
37551
|
+
Lexer2.prototype.keyword = function(kwd) {
|
|
37552
|
+
return this.token(kwd, new RegExp(kwd + "(?=\\W|$)"));
|
|
37553
|
+
};
|
|
37554
|
+
Lexer2.prototype.operator = function(op) {
|
|
37555
|
+
var sOp = new String(op).valueOf();
|
|
37556
|
+
return this.token(op, sOp);
|
|
37557
|
+
};
|
|
37558
|
+
return Lexer2;
|
|
37559
|
+
}();
|
|
37560
|
+
exports.default = Lexer;
|
|
37594
37561
|
}
|
|
37595
37562
|
});
|
|
37596
37563
|
|
|
37597
|
-
// node_modules/.pnpm/
|
|
37598
|
-
var
|
|
37599
|
-
"node_modules/.pnpm/
|
|
37600
|
-
|
|
37601
|
-
Object.defineProperty(exports, "__esModule", {
|
|
37602
|
-
value: true
|
|
37603
|
-
});
|
|
37604
|
-
exports.default = void 0;
|
|
37605
|
-
var _validate = _interopRequireDefault(require_validate());
|
|
37606
|
-
function _interopRequireDefault(obj) {
|
|
37607
|
-
return obj && obj.__esModule ? obj : { default: obj };
|
|
37608
|
-
}
|
|
37609
|
-
function version2(uuid2) {
|
|
37610
|
-
if (!(0, _validate.default)(uuid2)) {
|
|
37611
|
-
throw TypeError("Invalid UUID");
|
|
37612
|
-
}
|
|
37613
|
-
return parseInt(uuid2.substr(14, 1), 16);
|
|
37614
|
-
}
|
|
37615
|
-
var _default = version2;
|
|
37616
|
-
exports.default = _default;
|
|
37564
|
+
// node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/index.js
|
|
37565
|
+
var require_perplex = __commonJS({
|
|
37566
|
+
"node_modules/.pnpm/perplex@0.11.0/node_modules/perplex/index.js"(exports, module) {
|
|
37567
|
+
module.exports = require_lexer();
|
|
37617
37568
|
}
|
|
37618
37569
|
});
|
|
37619
37570
|
|
|
37620
|
-
// node_modules/.pnpm/
|
|
37621
|
-
var
|
|
37622
|
-
"node_modules/.pnpm/
|
|
37571
|
+
// node_modules/.pnpm/pratt@0.7.0/node_modules/pratt/lib/index.js
|
|
37572
|
+
var require_lib5 = __commonJS({
|
|
37573
|
+
"node_modules/.pnpm/pratt@0.7.0/node_modules/pratt/lib/index.js"(exports) {
|
|
37623
37574
|
"use strict";
|
|
37624
|
-
Object.defineProperty(exports, "__esModule", {
|
|
37625
|
-
|
|
37626
|
-
|
|
37627
|
-
|
|
37628
|
-
|
|
37629
|
-
|
|
37630
|
-
|
|
37631
|
-
|
|
37632
|
-
|
|
37633
|
-
|
|
37634
|
-
|
|
37635
|
-
|
|
37636
|
-
|
|
37637
|
-
|
|
37638
|
-
|
|
37639
|
-
|
|
37640
|
-
|
|
37641
|
-
|
|
37642
|
-
return _v3.default;
|
|
37643
|
-
}
|
|
37644
|
-
});
|
|
37645
|
-
Object.defineProperty(exports, "v5", {
|
|
37646
|
-
enumerable: true,
|
|
37647
|
-
get: function() {
|
|
37648
|
-
return _v4.default;
|
|
37649
|
-
}
|
|
37650
|
-
});
|
|
37651
|
-
Object.defineProperty(exports, "NIL", {
|
|
37652
|
-
enumerable: true,
|
|
37653
|
-
get: function() {
|
|
37654
|
-
return _nil.default;
|
|
37655
|
-
}
|
|
37656
|
-
});
|
|
37657
|
-
Object.defineProperty(exports, "version", {
|
|
37658
|
-
enumerable: true,
|
|
37659
|
-
get: function() {
|
|
37660
|
-
return _version.default;
|
|
37661
|
-
}
|
|
37662
|
-
});
|
|
37663
|
-
Object.defineProperty(exports, "validate", {
|
|
37664
|
-
enumerable: true,
|
|
37665
|
-
get: function() {
|
|
37666
|
-
return _validate.default;
|
|
37667
|
-
}
|
|
37668
|
-
});
|
|
37669
|
-
Object.defineProperty(exports, "stringify", {
|
|
37670
|
-
enumerable: true,
|
|
37671
|
-
get: function() {
|
|
37672
|
-
return _stringify.default;
|
|
37575
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37576
|
+
var createStop = function() {
|
|
37577
|
+
var stopCalled = false;
|
|
37578
|
+
return Object.assign(function(x) {
|
|
37579
|
+
stopCalled = true;
|
|
37580
|
+
return x;
|
|
37581
|
+
}, {
|
|
37582
|
+
isStopped: function() {
|
|
37583
|
+
return stopCalled;
|
|
37584
|
+
}
|
|
37585
|
+
});
|
|
37586
|
+
};
|
|
37587
|
+
var Parser3 = function() {
|
|
37588
|
+
function Parser4(lexer) {
|
|
37589
|
+
this.lexer = lexer;
|
|
37590
|
+
this._nuds = /* @__PURE__ */ new Map();
|
|
37591
|
+
this._leds = /* @__PURE__ */ new Map();
|
|
37592
|
+
this._bps = /* @__PURE__ */ new Map();
|
|
37673
37593
|
}
|
|
37674
|
-
|
|
37675
|
-
|
|
37676
|
-
|
|
37677
|
-
|
|
37678
|
-
return
|
|
37594
|
+
Parser4.prototype._type = function(tokenOrType) {
|
|
37595
|
+
return tokenOrType && typeof tokenOrType.isEof == "function" ? tokenOrType.type : tokenOrType;
|
|
37596
|
+
};
|
|
37597
|
+
Parser4.prototype.builder = function() {
|
|
37598
|
+
return new ParserBuilder(this);
|
|
37599
|
+
};
|
|
37600
|
+
Parser4.prototype.bp = function(tokenOrType) {
|
|
37601
|
+
if (tokenOrType == null)
|
|
37602
|
+
return Number.NEGATIVE_INFINITY;
|
|
37603
|
+
if (tokenOrType && typeof tokenOrType.isEof == "function" && tokenOrType.isEof())
|
|
37604
|
+
return Number.NEGATIVE_INFINITY;
|
|
37605
|
+
var type = this._type(tokenOrType);
|
|
37606
|
+
var bp = this._bps.has(type) ? this._bps.get(type) : Number.POSITIVE_INFINITY;
|
|
37607
|
+
return typeof bp == "function" ? bp() : bp;
|
|
37608
|
+
};
|
|
37609
|
+
Parser4.prototype.nud = function(info) {
|
|
37610
|
+
var fn = this._nuds.get(info.token.type);
|
|
37611
|
+
if (!fn) {
|
|
37612
|
+
var start = info.token.strpos().start;
|
|
37613
|
+
throw new Error("Unexpected token: " + info.token.match + " (at " + start.line + ":" + start.column + ")");
|
|
37614
|
+
}
|
|
37615
|
+
return fn(info);
|
|
37616
|
+
};
|
|
37617
|
+
Parser4.prototype.led = function(info) {
|
|
37618
|
+
var fn = this._leds.get(info.token.type);
|
|
37619
|
+
if (!fn) {
|
|
37620
|
+
var start = info.token.strpos().start;
|
|
37621
|
+
throw new Error("Unexpected token: " + info.token.match + " (at " + start.line + ":" + start.column + ")");
|
|
37622
|
+
}
|
|
37623
|
+
return fn(info);
|
|
37624
|
+
};
|
|
37625
|
+
Parser4.prototype.parse = function(opts) {
|
|
37626
|
+
var _this = this;
|
|
37627
|
+
if (opts === void 0) {
|
|
37628
|
+
opts = { terminals: [0] };
|
|
37629
|
+
}
|
|
37630
|
+
var stop = opts.stop = opts.stop || createStop();
|
|
37631
|
+
var check = function() {
|
|
37632
|
+
if (stop.isStopped())
|
|
37633
|
+
return false;
|
|
37634
|
+
var t = _this.lexer.peek();
|
|
37635
|
+
var bp = _this.bp(t);
|
|
37636
|
+
return opts.terminals.reduce(function(canContinue, rbpOrType) {
|
|
37637
|
+
if (!canContinue)
|
|
37638
|
+
return false;
|
|
37639
|
+
if (typeof rbpOrType == "number")
|
|
37640
|
+
return rbpOrType < bp;
|
|
37641
|
+
if (typeof rbpOrType == "string")
|
|
37642
|
+
return t.type != rbpOrType;
|
|
37643
|
+
}, true);
|
|
37644
|
+
};
|
|
37645
|
+
var mkinfo = function(token) {
|
|
37646
|
+
var bp = _this.bp(token);
|
|
37647
|
+
return { token, bp, stop, ctx: opts.ctx, options: opts };
|
|
37648
|
+
};
|
|
37649
|
+
if (!opts.terminals)
|
|
37650
|
+
opts.terminals = [0];
|
|
37651
|
+
if (opts.terminals.length == 0)
|
|
37652
|
+
opts.terminals.push(0);
|
|
37653
|
+
var left = this.nud(mkinfo(this.lexer.next()));
|
|
37654
|
+
while (check()) {
|
|
37655
|
+
var operator = this.lexer.next();
|
|
37656
|
+
left = this.led(Object.assign(mkinfo(operator), { left }));
|
|
37657
|
+
}
|
|
37658
|
+
return left;
|
|
37659
|
+
};
|
|
37660
|
+
return Parser4;
|
|
37661
|
+
}();
|
|
37662
|
+
exports.Parser = Parser3;
|
|
37663
|
+
var ParserBuilder = function() {
|
|
37664
|
+
function ParserBuilder2(parser) {
|
|
37665
|
+
this._parser = parser;
|
|
37679
37666
|
}
|
|
37680
|
-
|
|
37681
|
-
|
|
37682
|
-
|
|
37683
|
-
|
|
37684
|
-
|
|
37685
|
-
|
|
37686
|
-
|
|
37687
|
-
|
|
37688
|
-
|
|
37689
|
-
|
|
37690
|
-
|
|
37691
|
-
|
|
37692
|
-
|
|
37667
|
+
ParserBuilder2.prototype.nud = function(tokenType, bp, fn) {
|
|
37668
|
+
this._parser._nuds.set(tokenType, fn);
|
|
37669
|
+
this.bp(tokenType, bp);
|
|
37670
|
+
return this;
|
|
37671
|
+
};
|
|
37672
|
+
ParserBuilder2.prototype.led = function(tokenType, bp, fn) {
|
|
37673
|
+
this._parser._leds.set(tokenType, fn);
|
|
37674
|
+
this.bp(tokenType, bp);
|
|
37675
|
+
return this;
|
|
37676
|
+
};
|
|
37677
|
+
ParserBuilder2.prototype.either = function(tokenType, bp, fn) {
|
|
37678
|
+
return this.nud(tokenType, bp, function(inf) {
|
|
37679
|
+
return fn(Object.assign(inf, { left: null }));
|
|
37680
|
+
}).led(tokenType, bp, fn);
|
|
37681
|
+
};
|
|
37682
|
+
ParserBuilder2.prototype.bp = function(tokenType, bp) {
|
|
37683
|
+
this._parser._bps.set(tokenType, bp);
|
|
37684
|
+
return this;
|
|
37685
|
+
};
|
|
37686
|
+
ParserBuilder2.prototype.build = function() {
|
|
37687
|
+
return this._parser;
|
|
37688
|
+
};
|
|
37689
|
+
return ParserBuilder2;
|
|
37690
|
+
}();
|
|
37691
|
+
exports.ParserBuilder = ParserBuilder;
|
|
37692
|
+
exports.default = Parser3;
|
|
37693
37693
|
}
|
|
37694
37694
|
});
|
|
37695
37695
|
|
|
@@ -44942,9 +44942,67 @@ ${this.pendingMocks().join("\n")}`
|
|
|
44942
44942
|
var import_supertest = __toESM(require_supertest());
|
|
44943
44943
|
var import_morgan = __toESM(require_morgan());
|
|
44944
44944
|
|
|
44945
|
-
// src/storage.ts
|
|
44945
|
+
// src/storage/abstract.ts
|
|
44946
|
+
var AbstractStorage = class {
|
|
44947
|
+
};
|
|
44948
|
+
|
|
44949
|
+
// src/storage/in-memory.ts
|
|
44946
44950
|
var import_assert = __toESM(__require("assert"));
|
|
44947
44951
|
|
|
44952
|
+
// src/exceptions.ts
|
|
44953
|
+
var CommercetoolsError = class extends Error {
|
|
44954
|
+
constructor(info, statusCode = 400) {
|
|
44955
|
+
super(info.message);
|
|
44956
|
+
this.info = info;
|
|
44957
|
+
this.statusCode = statusCode || 500;
|
|
44958
|
+
}
|
|
44959
|
+
};
|
|
44960
|
+
|
|
44961
|
+
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/wrapper.mjs
|
|
44962
|
+
var import_dist = __toESM(require_dist(), 1);
|
|
44963
|
+
var v1 = import_dist.default.v1;
|
|
44964
|
+
var v3 = import_dist.default.v3;
|
|
44965
|
+
var v4 = import_dist.default.v4;
|
|
44966
|
+
var v5 = import_dist.default.v5;
|
|
44967
|
+
var NIL = import_dist.default.NIL;
|
|
44968
|
+
var version = import_dist.default.version;
|
|
44969
|
+
var validate = import_dist.default.validate;
|
|
44970
|
+
var stringify = import_dist.default.stringify;
|
|
44971
|
+
var parse = import_dist.default.parse;
|
|
44972
|
+
|
|
44973
|
+
// src/helpers.ts
|
|
44974
|
+
var getBaseResourceProperties = () => ({
|
|
44975
|
+
id: v4(),
|
|
44976
|
+
createdAt: new Date().toISOString(),
|
|
44977
|
+
lastModifiedAt: new Date().toISOString(),
|
|
44978
|
+
version: 0
|
|
44979
|
+
});
|
|
44980
|
+
var nestedLookup = (obj, path) => {
|
|
44981
|
+
if (!path || path === "") {
|
|
44982
|
+
return obj;
|
|
44983
|
+
}
|
|
44984
|
+
const parts = path.split(".");
|
|
44985
|
+
let val = obj;
|
|
44986
|
+
for (let i = 0; i < parts.length; i++) {
|
|
44987
|
+
const part = parts[i];
|
|
44988
|
+
if (val == void 0) {
|
|
44989
|
+
return void 0;
|
|
44990
|
+
}
|
|
44991
|
+
val = val[part];
|
|
44992
|
+
}
|
|
44993
|
+
return val;
|
|
44994
|
+
};
|
|
44995
|
+
var QueryParamsAsArray = (input) => {
|
|
44996
|
+
if (input == void 0) {
|
|
44997
|
+
return [];
|
|
44998
|
+
}
|
|
44999
|
+
if (Array.isArray(input)) {
|
|
45000
|
+
return input;
|
|
45001
|
+
}
|
|
45002
|
+
return [input];
|
|
45003
|
+
};
|
|
45004
|
+
var cloneObject = (o) => JSON.parse(JSON.stringify(o));
|
|
45005
|
+
|
|
44948
45006
|
// src/lib/expandParser.ts
|
|
44949
45007
|
var parseExpandClause = (clause) => {
|
|
44950
45008
|
const result = {
|
|
@@ -45262,63 +45320,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
45262
45320
|
return result;
|
|
45263
45321
|
};
|
|
45264
45322
|
|
|
45265
|
-
// src/
|
|
45266
|
-
var CommercetoolsError = class extends Error {
|
|
45267
|
-
constructor(info, statusCode = 400) {
|
|
45268
|
-
super(info.message);
|
|
45269
|
-
this.info = info;
|
|
45270
|
-
this.statusCode = statusCode || 500;
|
|
45271
|
-
}
|
|
45272
|
-
};
|
|
45273
|
-
|
|
45274
|
-
// node_modules/.pnpm/uuid@8.3.2/node_modules/uuid/wrapper.mjs
|
|
45275
|
-
var import_dist = __toESM(require_dist(), 1);
|
|
45276
|
-
var v1 = import_dist.default.v1;
|
|
45277
|
-
var v3 = import_dist.default.v3;
|
|
45278
|
-
var v4 = import_dist.default.v4;
|
|
45279
|
-
var v5 = import_dist.default.v5;
|
|
45280
|
-
var NIL = import_dist.default.NIL;
|
|
45281
|
-
var version = import_dist.default.version;
|
|
45282
|
-
var validate = import_dist.default.validate;
|
|
45283
|
-
var stringify = import_dist.default.stringify;
|
|
45284
|
-
var parse = import_dist.default.parse;
|
|
45285
|
-
|
|
45286
|
-
// src/helpers.ts
|
|
45287
|
-
var getBaseResourceProperties = () => ({
|
|
45288
|
-
id: v4(),
|
|
45289
|
-
createdAt: new Date().toISOString(),
|
|
45290
|
-
lastModifiedAt: new Date().toISOString(),
|
|
45291
|
-
version: 0
|
|
45292
|
-
});
|
|
45293
|
-
var nestedLookup = (obj, path) => {
|
|
45294
|
-
if (!path || path === "") {
|
|
45295
|
-
return obj;
|
|
45296
|
-
}
|
|
45297
|
-
const parts = path.split(".");
|
|
45298
|
-
let val = obj;
|
|
45299
|
-
for (let i = 0; i < parts.length; i++) {
|
|
45300
|
-
const part = parts[i];
|
|
45301
|
-
if (val == void 0) {
|
|
45302
|
-
return void 0;
|
|
45303
|
-
}
|
|
45304
|
-
val = val[part];
|
|
45305
|
-
}
|
|
45306
|
-
return val;
|
|
45307
|
-
};
|
|
45308
|
-
var QueryParamsAsArray = (input) => {
|
|
45309
|
-
if (input == void 0) {
|
|
45310
|
-
return [];
|
|
45311
|
-
}
|
|
45312
|
-
if (Array.isArray(input)) {
|
|
45313
|
-
return input;
|
|
45314
|
-
}
|
|
45315
|
-
return [input];
|
|
45316
|
-
};
|
|
45317
|
-
var cloneObject = (o) => JSON.parse(JSON.stringify(o));
|
|
45318
|
-
|
|
45319
|
-
// src/storage.ts
|
|
45320
|
-
var AbstractStorage = class {
|
|
45321
|
-
};
|
|
45323
|
+
// src/storage/in-memory.ts
|
|
45322
45324
|
var InMemoryStorage = class extends AbstractStorage {
|
|
45323
45325
|
constructor() {
|
|
45324
45326
|
super(...arguments);
|
|
@@ -45414,13 +45416,15 @@ ${this.pendingMocks().join("\n")}`
|
|
|
45414
45416
|
"order-edit": /* @__PURE__ */ new Map(),
|
|
45415
45417
|
payment: /* @__PURE__ */ new Map(),
|
|
45416
45418
|
product: /* @__PURE__ */ new Map(),
|
|
45419
|
+
quote: /* @__PURE__ */ new Map(),
|
|
45420
|
+
"quote-request": /* @__PURE__ */ new Map(),
|
|
45417
45421
|
"product-discount": /* @__PURE__ */ new Map(),
|
|
45418
|
-
"product-price": /* @__PURE__ */ new Map(),
|
|
45419
45422
|
"product-selection": /* @__PURE__ */ new Map(),
|
|
45420
45423
|
"product-type": /* @__PURE__ */ new Map(),
|
|
45421
45424
|
"product-projection": /* @__PURE__ */ new Map(),
|
|
45422
45425
|
review: /* @__PURE__ */ new Map(),
|
|
45423
45426
|
"shipping-method": /* @__PURE__ */ new Map(),
|
|
45427
|
+
"staged-quote": /* @__PURE__ */ new Map(),
|
|
45424
45428
|
state: /* @__PURE__ */ new Map(),
|
|
45425
45429
|
store: /* @__PURE__ */ new Map(),
|
|
45426
45430
|
"shopping-list": /* @__PURE__ */ new Map(),
|
|
@@ -45492,7 +45496,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
45492
45496
|
if (!store) {
|
|
45493
45497
|
throw new Error("No type");
|
|
45494
45498
|
}
|
|
45495
|
-
let resources =
|
|
45499
|
+
let resources = this.all(projectKey, typeId);
|
|
45496
45500
|
if (params.where) {
|
|
45497
45501
|
try {
|
|
45498
45502
|
const filterFunc = parseQueryExpression(params.where);
|
|
@@ -45566,7 +45570,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
45566
45570
|
console.error(
|
|
45567
45571
|
`No resource found with typeId=${identifier.typeId}, id=${identifier.id}`
|
|
45568
45572
|
);
|
|
45569
|
-
return
|
|
45573
|
+
return null;
|
|
45570
45574
|
}
|
|
45571
45575
|
if (identifier.key) {
|
|
45572
45576
|
const store = this.forProjectKey(projectKey)[identifier.typeId];
|
|
@@ -45583,7 +45587,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
45583
45587
|
);
|
|
45584
45588
|
}
|
|
45585
45589
|
}
|
|
45586
|
-
return
|
|
45590
|
+
return null;
|
|
45587
45591
|
}
|
|
45588
45592
|
_resolveReference(projectKey, reference, expand) {
|
|
45589
45593
|
if (reference === void 0)
|
|
@@ -45750,14 +45754,14 @@ ${this.pendingMocks().join("\n")}`
|
|
|
45750
45754
|
|
|
45751
45755
|
// src/projectAPI.ts
|
|
45752
45756
|
var ProjectAPI = class {
|
|
45753
|
-
constructor(projectKey,
|
|
45757
|
+
constructor(projectKey, repositories, storage) {
|
|
45754
45758
|
this.projectKey = projectKey;
|
|
45755
45759
|
this._storage = storage;
|
|
45756
|
-
this.
|
|
45760
|
+
this._repositories = repositories;
|
|
45757
45761
|
}
|
|
45758
45762
|
add(typeId, resource) {
|
|
45759
|
-
const
|
|
45760
|
-
if (
|
|
45763
|
+
const repository = this._repositories[typeId];
|
|
45764
|
+
if (repository) {
|
|
45761
45765
|
this._storage.add(this.projectKey, typeId, {
|
|
45762
45766
|
...getBaseResourceProperties(),
|
|
45763
45767
|
...resource
|
|
@@ -45775,9 +45779,9 @@ ${this.pendingMocks().join("\n")}`
|
|
|
45775
45779
|
);
|
|
45776
45780
|
}
|
|
45777
45781
|
getRepository(typeId) {
|
|
45778
|
-
const
|
|
45779
|
-
if (
|
|
45780
|
-
return
|
|
45782
|
+
const repository = this._repositories[typeId];
|
|
45783
|
+
if (repository !== void 0) {
|
|
45784
|
+
return repository;
|
|
45781
45785
|
}
|
|
45782
45786
|
throw new Error("No such repository");
|
|
45783
45787
|
}
|
|
@@ -45946,13 +45950,13 @@ ${this.pendingMocks().join("\n")}`
|
|
|
45946
45950
|
if (!project) {
|
|
45947
45951
|
return response.status(404).send({});
|
|
45948
45952
|
}
|
|
45949
|
-
this.repository.processUpdateActions(
|
|
45953
|
+
const updatedResource = this.repository.processUpdateActions(
|
|
45950
45954
|
getRepositoryContext(request),
|
|
45951
45955
|
project,
|
|
45952
45956
|
updateRequest.version,
|
|
45953
45957
|
updateRequest.actions
|
|
45954
45958
|
);
|
|
45955
|
-
return response.status(200).send(
|
|
45959
|
+
return response.status(200).send(updatedResource);
|
|
45956
45960
|
}
|
|
45957
45961
|
};
|
|
45958
45962
|
|
|
@@ -46009,14 +46013,14 @@ ${this.pendingMocks().join("\n")}`
|
|
|
46009
46013
|
}
|
|
46010
46014
|
return result;
|
|
46011
46015
|
}
|
|
46012
|
-
postProcessResource(resource) {
|
|
46013
|
-
return resource;
|
|
46014
|
-
}
|
|
46015
46016
|
};
|
|
46016
46017
|
var AbstractResourceRepository = class extends AbstractRepository {
|
|
46017
46018
|
constructor(storage) {
|
|
46018
46019
|
super(storage);
|
|
46019
46020
|
}
|
|
46021
|
+
postProcessResource(resource) {
|
|
46022
|
+
return resource;
|
|
46023
|
+
}
|
|
46020
46024
|
query(context, params = {}) {
|
|
46021
46025
|
const result = this._storage.query(context.projectKey, this.getTypeId(), {
|
|
46022
46026
|
expand: params.expand,
|
|
@@ -46163,11 +46167,13 @@ ${this.pendingMocks().join("\n")}`
|
|
|
46163
46167
|
id: v4(),
|
|
46164
46168
|
productId: product.id,
|
|
46165
46169
|
productKey: product.key,
|
|
46166
|
-
name: product.masterData.current.name,
|
|
46167
46170
|
productSlug: product.masterData.current.slug,
|
|
46168
46171
|
productType: product.productType,
|
|
46172
|
+
name: product.masterData.current.name,
|
|
46169
46173
|
variant,
|
|
46170
46174
|
price,
|
|
46175
|
+
taxedPricePortions: [],
|
|
46176
|
+
perMethodTaxRate: [],
|
|
46171
46177
|
totalPrice: {
|
|
46172
46178
|
...price.value,
|
|
46173
46179
|
centAmount: price.value.centAmount * quantity
|
|
@@ -46314,15 +46320,17 @@ ${this.pendingMocks().join("\n")}`
|
|
|
46314
46320
|
id: v4(),
|
|
46315
46321
|
productId: product.id,
|
|
46316
46322
|
productKey: product.key,
|
|
46317
|
-
name: product.masterData.current.name,
|
|
46318
46323
|
productSlug: product.masterData.current.slug,
|
|
46319
46324
|
productType: product.productType,
|
|
46325
|
+
name: product.masterData.current.name,
|
|
46320
46326
|
variant,
|
|
46321
46327
|
price,
|
|
46322
46328
|
totalPrice: {
|
|
46323
46329
|
...price.value,
|
|
46324
46330
|
centAmount: price.value.centAmount * quant
|
|
46325
46331
|
},
|
|
46332
|
+
taxedPricePortions: [],
|
|
46333
|
+
perMethodTaxRate: [],
|
|
46326
46334
|
quantity: quant,
|
|
46327
46335
|
discountedPricePerQuantity: [],
|
|
46328
46336
|
lineItemMode: "Standard",
|
|
@@ -46347,21 +46355,23 @@ ${this.pendingMocks().join("\n")}`
|
|
|
46347
46355
|
const resource = {
|
|
46348
46356
|
...getBaseResourceProperties(),
|
|
46349
46357
|
cartState: "Active",
|
|
46350
|
-
|
|
46358
|
+
country: draft.country,
|
|
46351
46359
|
customLineItems: [],
|
|
46352
|
-
|
|
46353
|
-
|
|
46354
|
-
|
|
46355
|
-
currencyCode: draft.currency,
|
|
46356
|
-
fractionDigits: 0
|
|
46357
|
-
},
|
|
46360
|
+
lineItems,
|
|
46361
|
+
locale: draft.locale,
|
|
46362
|
+
taxCalculationMode: draft.taxCalculationMode ?? "LineItemLevel",
|
|
46358
46363
|
taxMode: draft.taxMode ?? "Platform",
|
|
46359
46364
|
taxRoundingMode: draft.taxRoundingMode ?? "HalfEven",
|
|
46360
|
-
|
|
46361
|
-
|
|
46362
|
-
|
|
46363
|
-
|
|
46365
|
+
totalPrice: {
|
|
46366
|
+
type: "centPrecision",
|
|
46367
|
+
centAmount: 0,
|
|
46368
|
+
currencyCode: draft.currency,
|
|
46369
|
+
fractionDigits: 0
|
|
46370
|
+
},
|
|
46371
|
+
shippingMode: "Single",
|
|
46372
|
+
shipping: [],
|
|
46364
46373
|
origin: draft.origin ?? "Customer",
|
|
46374
|
+
refusedGifts: [],
|
|
46365
46375
|
custom: createCustomFields(
|
|
46366
46376
|
draft.custom,
|
|
46367
46377
|
context.projectKey,
|
|
@@ -46714,10 +46724,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
46714
46724
|
}
|
|
46715
46725
|
}
|
|
46716
46726
|
getWithContainerAndKey(context, container, key) {
|
|
46717
|
-
const items = this._storage.all(
|
|
46718
|
-
context.projectKey,
|
|
46719
|
-
this.getTypeId()
|
|
46720
|
-
);
|
|
46727
|
+
const items = this._storage.all(context.projectKey, this.getTypeId());
|
|
46721
46728
|
return items.find(
|
|
46722
46729
|
(item) => item.container === container && item.key === key
|
|
46723
46730
|
);
|
|
@@ -46824,7 +46831,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
46824
46831
|
};
|
|
46825
46832
|
}
|
|
46826
46833
|
getTypeId() {
|
|
46827
|
-
return "customer";
|
|
46834
|
+
return "customer-group";
|
|
46828
46835
|
}
|
|
46829
46836
|
create(context, draft) {
|
|
46830
46837
|
const resource = {
|
|
@@ -46909,7 +46916,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
46909
46916
|
};
|
|
46910
46917
|
}
|
|
46911
46918
|
getTypeId() {
|
|
46912
|
-
return "
|
|
46919
|
+
return "discount-code";
|
|
46913
46920
|
}
|
|
46914
46921
|
create(context, draft) {
|
|
46915
46922
|
const resource = {
|
|
@@ -47220,6 +47227,8 @@ ${this.pendingMocks().join("\n")}`
|
|
|
47220
47227
|
refusedGifts: [],
|
|
47221
47228
|
origin: "Customer",
|
|
47222
47229
|
syncInfo: [],
|
|
47230
|
+
shippingMode: cart.shippingMode,
|
|
47231
|
+
shipping: cart.shipping,
|
|
47223
47232
|
store: context.storeKey ? {
|
|
47224
47233
|
key: context.storeKey,
|
|
47225
47234
|
typeId: "store"
|
|
@@ -47248,6 +47257,8 @@ ${this.pendingMocks().join("\n")}`
|
|
|
47248
47257
|
origin: draft.origin || "Customer",
|
|
47249
47258
|
paymentState: draft.paymentState,
|
|
47250
47259
|
refusedGifts: [],
|
|
47260
|
+
shippingMode: "Single",
|
|
47261
|
+
shipping: [],
|
|
47251
47262
|
store: resolveStoreReference(
|
|
47252
47263
|
draft.store,
|
|
47253
47264
|
context.projectKey,
|
|
@@ -47319,6 +47330,8 @@ ${this.pendingMocks().join("\n")}`
|
|
|
47319
47330
|
quantity: draft.quantity,
|
|
47320
47331
|
state: draft.state || [],
|
|
47321
47332
|
taxRate: draft.taxRate,
|
|
47333
|
+
taxedPricePortions: [],
|
|
47334
|
+
perMethodTaxRate: [],
|
|
47322
47335
|
totalPrice: createTypedMoney(draft.price.value),
|
|
47323
47336
|
variant: {
|
|
47324
47337
|
id: variant.id,
|
|
@@ -47340,6 +47353,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
47340
47353
|
money: createTypedMoney(draft.money),
|
|
47341
47354
|
name: draft.name,
|
|
47342
47355
|
quantity: draft.quantity,
|
|
47356
|
+
priceMode: draft.priceMode,
|
|
47343
47357
|
slug: draft.slug,
|
|
47344
47358
|
state: [],
|
|
47345
47359
|
totalPrice: createTypedMoney(draft.money)
|
|
@@ -47373,6 +47387,29 @@ ${this.pendingMocks().join("\n")}`
|
|
|
47373
47387
|
}
|
|
47374
47388
|
};
|
|
47375
47389
|
|
|
47390
|
+
// src/repositories/order-edit.ts
|
|
47391
|
+
var OrderEditRepository = class extends AbstractResourceRepository {
|
|
47392
|
+
constructor() {
|
|
47393
|
+
super(...arguments);
|
|
47394
|
+
this.actions = {};
|
|
47395
|
+
}
|
|
47396
|
+
getTypeId() {
|
|
47397
|
+
return "order-edit";
|
|
47398
|
+
}
|
|
47399
|
+
create(context, draft) {
|
|
47400
|
+
const resource = {
|
|
47401
|
+
...getBaseResourceProperties(),
|
|
47402
|
+
stagedActions: draft.stagedActions ?? [],
|
|
47403
|
+
resource: draft.resource,
|
|
47404
|
+
result: {
|
|
47405
|
+
type: "NotProcessed"
|
|
47406
|
+
}
|
|
47407
|
+
};
|
|
47408
|
+
this.saveNew(context, resource);
|
|
47409
|
+
return resource;
|
|
47410
|
+
}
|
|
47411
|
+
};
|
|
47412
|
+
|
|
47376
47413
|
// src/repositories/payment.ts
|
|
47377
47414
|
var PaymentRepository = class extends AbstractResourceRepository {
|
|
47378
47415
|
constructor() {
|
|
@@ -47530,7 +47567,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
47530
47567
|
checkForStagedChanges(resource);
|
|
47531
47568
|
return resource;
|
|
47532
47569
|
},
|
|
47533
|
-
|
|
47570
|
+
setDescription: (context, resource, { description, staged }) => {
|
|
47534
47571
|
const onlyStaged = staged !== void 0 ? staged : true;
|
|
47535
47572
|
resource.masterData.staged.description = description;
|
|
47536
47573
|
if (!onlyStaged) {
|
|
@@ -47539,9 +47576,80 @@ ${this.pendingMocks().join("\n")}`
|
|
|
47539
47576
|
checkForStagedChanges(resource);
|
|
47540
47577
|
return resource;
|
|
47541
47578
|
},
|
|
47542
|
-
|
|
47579
|
+
setKey: (context, resource, { key }) => {
|
|
47543
47580
|
resource.key = key;
|
|
47544
47581
|
return resource;
|
|
47582
|
+
},
|
|
47583
|
+
addExternalImage: (context, resource, { variantId, sku, image, staged }) => {
|
|
47584
|
+
const addImg = (data) => {
|
|
47585
|
+
const { variant, isMasterVariant, variantIndex } = getVariant(
|
|
47586
|
+
data,
|
|
47587
|
+
variantId,
|
|
47588
|
+
sku
|
|
47589
|
+
);
|
|
47590
|
+
if (!variant) {
|
|
47591
|
+
throw new Error(
|
|
47592
|
+
`Variant with id ${variantId} or sku ${sku} not found on product ${resource.id}`
|
|
47593
|
+
);
|
|
47594
|
+
}
|
|
47595
|
+
if (!variant.images) {
|
|
47596
|
+
variant.images = [];
|
|
47597
|
+
} else {
|
|
47598
|
+
const existingImage = variant.images.find((x) => x.url === image.url);
|
|
47599
|
+
if (existingImage) {
|
|
47600
|
+
throw new Error(
|
|
47601
|
+
`Cannot add image '${image.url}' because product '${resource.id}' already has that image.`
|
|
47602
|
+
);
|
|
47603
|
+
}
|
|
47604
|
+
}
|
|
47605
|
+
variant.images.push(image);
|
|
47606
|
+
if (isMasterVariant) {
|
|
47607
|
+
data.masterVariant = variant;
|
|
47608
|
+
} else {
|
|
47609
|
+
data.variants[variantIndex] = variant;
|
|
47610
|
+
}
|
|
47611
|
+
};
|
|
47612
|
+
const onlyStaged = staged !== void 0 ? staged : true;
|
|
47613
|
+
addImg(resource.masterData.staged);
|
|
47614
|
+
if (!onlyStaged) {
|
|
47615
|
+
addImg(resource.masterData.current);
|
|
47616
|
+
}
|
|
47617
|
+
checkForStagedChanges(resource);
|
|
47618
|
+
return resource;
|
|
47619
|
+
},
|
|
47620
|
+
removeImage: (context, resource, { variantId, sku, imageUrl, staged }) => {
|
|
47621
|
+
const removeImg = (data) => {
|
|
47622
|
+
const { variant, isMasterVariant, variantIndex } = getVariant(
|
|
47623
|
+
data,
|
|
47624
|
+
variantId,
|
|
47625
|
+
sku
|
|
47626
|
+
);
|
|
47627
|
+
if (!variant) {
|
|
47628
|
+
throw new Error(
|
|
47629
|
+
`Variant with id ${variantId} or sku ${sku} not found on product ${resource.id}`
|
|
47630
|
+
);
|
|
47631
|
+
}
|
|
47632
|
+
const variantImages = variant.images ?? [];
|
|
47633
|
+
const existingImage = variantImages.find((x) => x.url === imageUrl);
|
|
47634
|
+
if (!existingImage) {
|
|
47635
|
+
throw new Error(
|
|
47636
|
+
`Cannot remove image '${imageUrl}' because product '${resource.id}' does not have that image.`
|
|
47637
|
+
);
|
|
47638
|
+
}
|
|
47639
|
+
variant.images = variantImages.filter((image) => image.url !== imageUrl);
|
|
47640
|
+
if (isMasterVariant) {
|
|
47641
|
+
data.masterVariant = variant;
|
|
47642
|
+
} else {
|
|
47643
|
+
data.variants[variantIndex] = variant;
|
|
47644
|
+
}
|
|
47645
|
+
};
|
|
47646
|
+
const onlyStaged = staged !== void 0 ? staged : true;
|
|
47647
|
+
removeImg(resource.masterData.staged);
|
|
47648
|
+
if (!onlyStaged) {
|
|
47649
|
+
removeImg(resource.masterData.current);
|
|
47650
|
+
}
|
|
47651
|
+
checkForStagedChanges(resource);
|
|
47652
|
+
return resource;
|
|
47545
47653
|
}
|
|
47546
47654
|
};
|
|
47547
47655
|
}
|
|
@@ -47725,18 +47833,6 @@ ${this.pendingMocks().join("\n")}`
|
|
|
47725
47833
|
}
|
|
47726
47834
|
}
|
|
47727
47835
|
}
|
|
47728
|
-
getWithKey(context, key) {
|
|
47729
|
-
const result = this._storage.query(context.projectKey, this.getTypeId(), {
|
|
47730
|
-
where: [`key="${key}"`]
|
|
47731
|
-
});
|
|
47732
|
-
if (result.count === 1) {
|
|
47733
|
-
return result.results[0];
|
|
47734
|
-
}
|
|
47735
|
-
if (result.count > 1) {
|
|
47736
|
-
throw new Error("Duplicate product discount key");
|
|
47737
|
-
}
|
|
47738
|
-
return;
|
|
47739
|
-
}
|
|
47740
47836
|
};
|
|
47741
47837
|
|
|
47742
47838
|
// src/lib/projectionSearchFilter.ts
|
|
@@ -47984,7 +48080,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
47984
48080
|
this._storage = storage;
|
|
47985
48081
|
}
|
|
47986
48082
|
search(projectKey, params) {
|
|
47987
|
-
let resources = this._storage.all(projectKey, "product").map((r) => this.transform(r, params.staged ?? false)).filter((p) =>
|
|
48083
|
+
let resources = this._storage.all(projectKey, "product").map((r) => this.transform(r, params.staged ?? false)).filter((p) => {
|
|
47988
48084
|
if (!params.staged) {
|
|
47989
48085
|
return p.published;
|
|
47990
48086
|
}
|
|
@@ -48051,8 +48147,6 @@ ${this.pendingMocks().join("\n")}`
|
|
|
48051
48147
|
}
|
|
48052
48148
|
transform(product, staged) {
|
|
48053
48149
|
const obj = !staged ? product.masterData.current : product.masterData.staged;
|
|
48054
|
-
if (!obj)
|
|
48055
|
-
return null;
|
|
48056
48150
|
return {
|
|
48057
48151
|
id: product.id,
|
|
48058
48152
|
createdAt: product.createdAt,
|
|
@@ -48224,12 +48318,18 @@ ${this.pendingMocks().join("\n")}`
|
|
|
48224
48318
|
throw new Error("No valid action");
|
|
48225
48319
|
}
|
|
48226
48320
|
query(context, params = {}) {
|
|
48227
|
-
|
|
48321
|
+
const response = this._storage.query(context.projectKey, "product", {
|
|
48228
48322
|
expand: params.expand,
|
|
48229
48323
|
where: params.where,
|
|
48230
48324
|
offset: params.offset,
|
|
48231
48325
|
limit: params.limit
|
|
48232
48326
|
});
|
|
48327
|
+
return {
|
|
48328
|
+
...response,
|
|
48329
|
+
results: response.results.map(
|
|
48330
|
+
(r) => this._searchService.transform(r, false)
|
|
48331
|
+
)
|
|
48332
|
+
};
|
|
48233
48333
|
}
|
|
48234
48334
|
search(context, query) {
|
|
48235
48335
|
const results = this._searchService.search(context.projectKey, {
|
|
@@ -48245,6 +48345,27 @@ ${this.pendingMocks().join("\n")}`
|
|
|
48245
48345
|
}
|
|
48246
48346
|
};
|
|
48247
48347
|
|
|
48348
|
+
// src/repositories/product-selection.ts
|
|
48349
|
+
var ProductSelectionRepository = class extends AbstractResourceRepository {
|
|
48350
|
+
constructor() {
|
|
48351
|
+
super(...arguments);
|
|
48352
|
+
this.actions = {};
|
|
48353
|
+
}
|
|
48354
|
+
getTypeId() {
|
|
48355
|
+
return "product-selection";
|
|
48356
|
+
}
|
|
48357
|
+
create(context, draft) {
|
|
48358
|
+
const resource = {
|
|
48359
|
+
...getBaseResourceProperties(),
|
|
48360
|
+
productCount: 0,
|
|
48361
|
+
name: draft.name,
|
|
48362
|
+
type: "individual"
|
|
48363
|
+
};
|
|
48364
|
+
this.saveNew(context, resource);
|
|
48365
|
+
return resource;
|
|
48366
|
+
}
|
|
48367
|
+
};
|
|
48368
|
+
|
|
48248
48369
|
// src/repositories/product-type.ts
|
|
48249
48370
|
var ProductTypeRepository = class extends AbstractResourceRepository {
|
|
48250
48371
|
constructor() {
|
|
@@ -48296,20 +48417,20 @@ ${this.pendingMocks().join("\n")}`
|
|
|
48296
48417
|
this.attributeDefinitionFromAttributeDefinitionDraft(context, attribute)
|
|
48297
48418
|
);
|
|
48298
48419
|
},
|
|
48299
|
-
|
|
48420
|
+
changeAttributeOrderByName: (context, resource, { attributeNames }) => {
|
|
48300
48421
|
var _a;
|
|
48301
48422
|
const attrs = new Map(
|
|
48302
48423
|
(_a = resource.attributes) == null ? void 0 : _a.map((item) => [item.name, item])
|
|
48303
48424
|
);
|
|
48304
48425
|
const result = [];
|
|
48305
48426
|
let current = resource.attributes;
|
|
48306
|
-
|
|
48307
|
-
const attr = attrs.get(
|
|
48427
|
+
attributeNames.forEach((attrName) => {
|
|
48428
|
+
const attr = attrs.get(attrName);
|
|
48308
48429
|
if (attr === void 0) {
|
|
48309
48430
|
throw new Error("New attr");
|
|
48310
48431
|
}
|
|
48311
48432
|
result.push(attr);
|
|
48312
|
-
current = current == null ? void 0 : current.filter((f) => f.name !==
|
|
48433
|
+
current = current == null ? void 0 : current.filter((f) => f.name !== attrName);
|
|
48313
48434
|
});
|
|
48314
48435
|
resource.attributes = result;
|
|
48315
48436
|
if (current) {
|
|
@@ -48357,18 +48478,6 @@ ${this.pendingMocks().join("\n")}`
|
|
|
48357
48478
|
this.saveNew(context, resource);
|
|
48358
48479
|
return resource;
|
|
48359
48480
|
}
|
|
48360
|
-
getWithKey(context, key) {
|
|
48361
|
-
const result = this._storage.query(context.projectKey, this.getTypeId(), {
|
|
48362
|
-
where: [`key="${key}"`]
|
|
48363
|
-
});
|
|
48364
|
-
if (result.count === 1) {
|
|
48365
|
-
return result.results[0];
|
|
48366
|
-
}
|
|
48367
|
-
if (result.count > 1) {
|
|
48368
|
-
throw new Error("Duplicate product type key");
|
|
48369
|
-
}
|
|
48370
|
-
return;
|
|
48371
|
-
}
|
|
48372
48481
|
};
|
|
48373
48482
|
|
|
48374
48483
|
// src/repositories/project.ts
|
|
@@ -48388,8 +48497,9 @@ ${this.pendingMocks().join("\n")}`
|
|
|
48388
48497
|
changeLanguages: (context, resource, { languages }) => {
|
|
48389
48498
|
resource.languages = languages;
|
|
48390
48499
|
},
|
|
48391
|
-
|
|
48392
|
-
resource.messages.enabled =
|
|
48500
|
+
changeMessagesConfiguration: (context, resource, { messagesConfiguration }) => {
|
|
48501
|
+
resource.messages.enabled = messagesConfiguration.enabled;
|
|
48502
|
+
resource.messages.deleteDaysAfterCreation = messagesConfiguration.deleteDaysAfterCreation;
|
|
48393
48503
|
},
|
|
48394
48504
|
changeProductSearchIndexingEnabled: (context, resource, { enabled }) => {
|
|
48395
48505
|
var _a;
|
|
@@ -48445,6 +48555,53 @@ ${this.pendingMocks().join("\n")}`
|
|
|
48445
48555
|
}
|
|
48446
48556
|
};
|
|
48447
48557
|
|
|
48558
|
+
// src/repositories/quote.ts
|
|
48559
|
+
var QuoteRepository = class extends AbstractResourceRepository {
|
|
48560
|
+
constructor() {
|
|
48561
|
+
super(...arguments);
|
|
48562
|
+
this.actions = {};
|
|
48563
|
+
}
|
|
48564
|
+
getTypeId() {
|
|
48565
|
+
return "quote";
|
|
48566
|
+
}
|
|
48567
|
+
create(context, draft) {
|
|
48568
|
+
throw new Error("not implemented");
|
|
48569
|
+
}
|
|
48570
|
+
};
|
|
48571
|
+
|
|
48572
|
+
// src/repositories/quote-request.ts
|
|
48573
|
+
var QuoteRequestRepository = class extends AbstractResourceRepository {
|
|
48574
|
+
constructor() {
|
|
48575
|
+
super(...arguments);
|
|
48576
|
+
this.actions = {};
|
|
48577
|
+
}
|
|
48578
|
+
getTypeId() {
|
|
48579
|
+
return "quote-request";
|
|
48580
|
+
}
|
|
48581
|
+
create(context, draft) {
|
|
48582
|
+
throw new Error("not implemented");
|
|
48583
|
+
}
|
|
48584
|
+
};
|
|
48585
|
+
|
|
48586
|
+
// src/repositories/review.ts
|
|
48587
|
+
var ReviewRepository = class extends AbstractResourceRepository {
|
|
48588
|
+
constructor() {
|
|
48589
|
+
super(...arguments);
|
|
48590
|
+
this.actions = {};
|
|
48591
|
+
}
|
|
48592
|
+
getTypeId() {
|
|
48593
|
+
return "review";
|
|
48594
|
+
}
|
|
48595
|
+
create(context, draft) {
|
|
48596
|
+
const resource = {
|
|
48597
|
+
...getBaseResourceProperties(),
|
|
48598
|
+
includedInStatistics: false
|
|
48599
|
+
};
|
|
48600
|
+
this.saveNew(context, resource);
|
|
48601
|
+
return resource;
|
|
48602
|
+
}
|
|
48603
|
+
};
|
|
48604
|
+
|
|
48448
48605
|
// src/repositories/shipping-method.ts
|
|
48449
48606
|
var import_deep_equal3 = __toESM(require_deep_equal());
|
|
48450
48607
|
var ShippingMethodRepository = class extends AbstractResourceRepository {
|
|
@@ -48619,6 +48776,41 @@ ${this.pendingMocks().join("\n")}`
|
|
|
48619
48776
|
}
|
|
48620
48777
|
};
|
|
48621
48778
|
|
|
48779
|
+
// src/repositories/staged-quote.ts
|
|
48780
|
+
var StagedQuoteRepository = class extends AbstractResourceRepository {
|
|
48781
|
+
constructor() {
|
|
48782
|
+
super(...arguments);
|
|
48783
|
+
this.actions = {};
|
|
48784
|
+
}
|
|
48785
|
+
getTypeId() {
|
|
48786
|
+
return "staged-quote";
|
|
48787
|
+
}
|
|
48788
|
+
create(context, draft) {
|
|
48789
|
+
throw new Error("not implemented");
|
|
48790
|
+
}
|
|
48791
|
+
};
|
|
48792
|
+
|
|
48793
|
+
// src/repositories/standalone-price.ts
|
|
48794
|
+
var StandAlonePriceRepository = class extends AbstractResourceRepository {
|
|
48795
|
+
constructor() {
|
|
48796
|
+
super(...arguments);
|
|
48797
|
+
this.actions = {};
|
|
48798
|
+
}
|
|
48799
|
+
getTypeId() {
|
|
48800
|
+
return "standalone-price";
|
|
48801
|
+
}
|
|
48802
|
+
create(context, draft) {
|
|
48803
|
+
const resource = {
|
|
48804
|
+
...getBaseResourceProperties(),
|
|
48805
|
+
active: draft.active,
|
|
48806
|
+
sku: draft.sku,
|
|
48807
|
+
value: draft.value
|
|
48808
|
+
};
|
|
48809
|
+
this.saveNew(context, resource);
|
|
48810
|
+
return resource;
|
|
48811
|
+
}
|
|
48812
|
+
};
|
|
48813
|
+
|
|
48622
48814
|
// src/repositories/state.ts
|
|
48623
48815
|
var StateRepository = class extends AbstractResourceRepository {
|
|
48624
48816
|
constructor() {
|
|
@@ -48627,6 +48819,9 @@ ${this.pendingMocks().join("\n")}`
|
|
|
48627
48819
|
changeKey: (context, resource, { key }) => {
|
|
48628
48820
|
resource.key = key;
|
|
48629
48821
|
},
|
|
48822
|
+
changeInitial: (context, resource, { initial }) => {
|
|
48823
|
+
resource.initial = initial;
|
|
48824
|
+
},
|
|
48630
48825
|
setDescription: (context, resource, { description }) => {
|
|
48631
48826
|
resource.description = description;
|
|
48632
48827
|
},
|
|
@@ -48739,18 +48934,6 @@ ${this.pendingMocks().join("\n")}`
|
|
|
48739
48934
|
)
|
|
48740
48935
|
);
|
|
48741
48936
|
}
|
|
48742
|
-
getWithKey(context, key) {
|
|
48743
|
-
const result = this._storage.query(context.projectKey, this.getTypeId(), {
|
|
48744
|
-
where: [`key="${key}"`]
|
|
48745
|
-
});
|
|
48746
|
-
if (result.count === 1) {
|
|
48747
|
-
return result.results[0];
|
|
48748
|
-
}
|
|
48749
|
-
if (result.count > 1) {
|
|
48750
|
-
throw new Error("Duplicate store key");
|
|
48751
|
-
}
|
|
48752
|
-
return;
|
|
48753
|
-
}
|
|
48754
48937
|
};
|
|
48755
48938
|
|
|
48756
48939
|
// src/repositories/subscription.ts
|
|
@@ -48849,18 +49032,6 @@ ${this.pendingMocks().join("\n")}`
|
|
|
48849
49032
|
this.saveNew(context, resource);
|
|
48850
49033
|
return resource;
|
|
48851
49034
|
}
|
|
48852
|
-
getWithKey(context, key) {
|
|
48853
|
-
const result = this._storage.query(context.projectKey, this.getTypeId(), {
|
|
48854
|
-
where: [`key="${key}"`]
|
|
48855
|
-
});
|
|
48856
|
-
if (result.count === 1) {
|
|
48857
|
-
return result.results[0];
|
|
48858
|
-
}
|
|
48859
|
-
if (result.count > 1) {
|
|
48860
|
-
throw new Error("Duplicate tax category key");
|
|
48861
|
-
}
|
|
48862
|
-
return;
|
|
48863
|
-
}
|
|
48864
49035
|
};
|
|
48865
49036
|
|
|
48866
49037
|
// src/repositories/type.ts
|
|
@@ -49019,18 +49190,25 @@ ${this.pendingMocks().join("\n")}`
|
|
|
49019
49190
|
"inventory-entry": new InventoryEntryRepository(storage),
|
|
49020
49191
|
"key-value-document": new CustomObjectRepository(storage),
|
|
49021
49192
|
order: new OrderRepository(storage),
|
|
49193
|
+
"order-edit": new OrderEditRepository(storage),
|
|
49022
49194
|
payment: new PaymentRepository(storage),
|
|
49023
49195
|
"my-cart": new CartRepository(storage),
|
|
49024
49196
|
"my-order": new MyOrderRepository(storage),
|
|
49025
49197
|
"my-customer": new CustomerRepository(storage),
|
|
49026
49198
|
"my-payment": new PaymentRepository(storage),
|
|
49027
|
-
"shipping-method": new ShippingMethodRepository(storage),
|
|
49028
|
-
"product-type": new ProductTypeRepository(storage),
|
|
49029
49199
|
product: new ProductRepository(storage),
|
|
49030
|
-
|
|
49200
|
+
"product-type": new ProductTypeRepository(storage),
|
|
49031
49201
|
"product-discount": new ProductDiscountRepository(storage),
|
|
49032
49202
|
"product-projection": new ProductProjectionRepository(storage),
|
|
49203
|
+
"product-selection": new ProductSelectionRepository(storage),
|
|
49204
|
+
project: new ProjectRepository(storage),
|
|
49205
|
+
review: new ReviewRepository(storage),
|
|
49206
|
+
quote: new QuoteRepository(storage),
|
|
49207
|
+
"quote-request": new QuoteRequestRepository(storage),
|
|
49208
|
+
"shipping-method": new ShippingMethodRepository(storage),
|
|
49033
49209
|
"shopping-list": new ShoppingListRepository(storage),
|
|
49210
|
+
"staged-quote": new StagedQuoteRepository(storage),
|
|
49211
|
+
"standalone-price": new StandAlonePriceRepository(storage),
|
|
49034
49212
|
state: new StateRepository(storage),
|
|
49035
49213
|
store: new StoreRepository(storage),
|
|
49036
49214
|
subscription: new SubscriptionRepository(storage),
|
|
@@ -49199,25 +49377,27 @@ ${this.pendingMocks().join("\n")}`
|
|
|
49199
49377
|
return "carts";
|
|
49200
49378
|
}
|
|
49201
49379
|
extraRoutes(parent) {
|
|
49202
|
-
parent.post("/replicate", (
|
|
49203
|
-
|
|
49204
|
-
|
|
49205
|
-
|
|
49206
|
-
|
|
49207
|
-
|
|
49208
|
-
|
|
49209
|
-
|
|
49210
|
-
|
|
49211
|
-
|
|
49212
|
-
|
|
49213
|
-
|
|
49214
|
-
|
|
49215
|
-
|
|
49216
|
-
|
|
49217
|
-
|
|
49218
|
-
|
|
49219
|
-
|
|
49220
|
-
}
|
|
49380
|
+
parent.post("/replicate", this.replicate.bind(this));
|
|
49381
|
+
}
|
|
49382
|
+
replicate(request, response) {
|
|
49383
|
+
const context = getRepositoryContext(request);
|
|
49384
|
+
const cartOrOrder = request.body.reference.typeId === "order" ? this.orderRepository.get(context, request.body.reference.id) : this.repository.get(context, request.body.reference.id);
|
|
49385
|
+
if (!cartOrOrder) {
|
|
49386
|
+
return response.status(400).send();
|
|
49387
|
+
}
|
|
49388
|
+
const cartDraft = {
|
|
49389
|
+
...cartOrOrder,
|
|
49390
|
+
currency: cartOrOrder.totalPrice.currencyCode,
|
|
49391
|
+
discountCodes: [],
|
|
49392
|
+
shipping: [],
|
|
49393
|
+
lineItems: cartOrOrder.lineItems.map((lineItem) => ({
|
|
49394
|
+
...lineItem,
|
|
49395
|
+
variantId: lineItem.variant.id,
|
|
49396
|
+
sku: lineItem.variant.sku
|
|
49397
|
+
}))
|
|
49398
|
+
};
|
|
49399
|
+
const newCart = this.repository.create(context, cartDraft);
|
|
49400
|
+
return response.status(200).send(newCart);
|
|
49221
49401
|
}
|
|
49222
49402
|
};
|
|
49223
49403
|
|
|
@@ -49561,19 +49741,6 @@ ${this.pendingMocks().join("\n")}`
|
|
|
49561
49741
|
getBasePath() {
|
|
49562
49742
|
return "product-discounts";
|
|
49563
49743
|
}
|
|
49564
|
-
extraRoutes(router) {
|
|
49565
|
-
router.get("/key=:key", this.getWithKey.bind(this));
|
|
49566
|
-
}
|
|
49567
|
-
getWithKey(request, response) {
|
|
49568
|
-
const resource = this.repository.getWithKey(
|
|
49569
|
-
getRepositoryContext(request),
|
|
49570
|
-
request.params.key
|
|
49571
|
-
);
|
|
49572
|
-
if (resource) {
|
|
49573
|
-
return response.status(200).send(resource);
|
|
49574
|
-
}
|
|
49575
|
-
return response.status(404).send("Not found");
|
|
49576
|
-
}
|
|
49577
49744
|
};
|
|
49578
49745
|
|
|
49579
49746
|
// src/services/product-projection.ts
|
|
@@ -49606,19 +49773,6 @@ ${this.pendingMocks().join("\n")}`
|
|
|
49606
49773
|
getBasePath() {
|
|
49607
49774
|
return "product-types";
|
|
49608
49775
|
}
|
|
49609
|
-
extraRoutes(router) {
|
|
49610
|
-
router.get("/key=:key", this.getWithKey.bind(this));
|
|
49611
|
-
}
|
|
49612
|
-
getWithKey(request, response) {
|
|
49613
|
-
const resource = this.repository.getWithKey(
|
|
49614
|
-
getRepositoryContext(request),
|
|
49615
|
-
request.params.key
|
|
49616
|
-
);
|
|
49617
|
-
if (resource) {
|
|
49618
|
-
return response.status(200).send(resource);
|
|
49619
|
-
}
|
|
49620
|
-
return response.status(404).send("Not found");
|
|
49621
|
-
}
|
|
49622
49776
|
};
|
|
49623
49777
|
|
|
49624
49778
|
// src/services/shipping-method.ts
|
|
@@ -49667,19 +49821,6 @@ ${this.pendingMocks().join("\n")}`
|
|
|
49667
49821
|
getBasePath() {
|
|
49668
49822
|
return "stores";
|
|
49669
49823
|
}
|
|
49670
|
-
extraRoutes(router) {
|
|
49671
|
-
router.get("/key=:key", this.getWithKey.bind(this));
|
|
49672
|
-
}
|
|
49673
|
-
getWithKey(request, response) {
|
|
49674
|
-
const resource = this.repository.getWithKey(
|
|
49675
|
-
getRepositoryContext(request),
|
|
49676
|
-
request.params.key
|
|
49677
|
-
);
|
|
49678
|
-
if (resource) {
|
|
49679
|
-
return response.status(200).send(resource);
|
|
49680
|
-
}
|
|
49681
|
-
return response.status(404).send("Not found");
|
|
49682
|
-
}
|
|
49683
49824
|
};
|
|
49684
49825
|
|
|
49685
49826
|
// src/services/subscription.ts
|
|
@@ -49702,19 +49843,6 @@ ${this.pendingMocks().join("\n")}`
|
|
|
49702
49843
|
getBasePath() {
|
|
49703
49844
|
return "tax-categories";
|
|
49704
49845
|
}
|
|
49705
|
-
extraRoutes(router) {
|
|
49706
|
-
router.get("/key=:key", this.getWithKey.bind(this));
|
|
49707
|
-
}
|
|
49708
|
-
getWithKey(request, response) {
|
|
49709
|
-
const resource = this.repository.getWithKey(
|
|
49710
|
-
getRepositoryContext(request),
|
|
49711
|
-
request.params.key
|
|
49712
|
-
);
|
|
49713
|
-
if (resource) {
|
|
49714
|
-
return response.status(200).send(resource);
|
|
49715
|
-
}
|
|
49716
|
-
return response.status(404).send("Not found");
|
|
49717
|
-
}
|
|
49718
49846
|
};
|
|
49719
49847
|
|
|
49720
49848
|
// src/services/type.ts
|
|
@@ -49799,8 +49927,8 @@ ${this.pendingMocks().join("\n")}`
|
|
|
49799
49927
|
constructor(options = {}) {
|
|
49800
49928
|
this._nockScopes = { auth: void 0, api: void 0 };
|
|
49801
49929
|
this.options = { ...DEFAULT_OPTIONS, ...options };
|
|
49802
|
-
this._services =
|
|
49803
|
-
this._repositories =
|
|
49930
|
+
this._services = null;
|
|
49931
|
+
this._repositories = null;
|
|
49804
49932
|
this._projectService = void 0;
|
|
49805
49933
|
this._storage = new InMemoryStorage();
|
|
49806
49934
|
this._oauth2 = new OAuth2Server({
|
|
@@ -49827,9 +49955,12 @@ ${this.pendingMocks().join("\n")}`
|
|
|
49827
49955
|
if (!projectKey && !this.options.defaultProjectKey) {
|
|
49828
49956
|
throw new Error("No projectKey passed and no default set");
|
|
49829
49957
|
}
|
|
49958
|
+
if (this._repositories === null) {
|
|
49959
|
+
throw new Error("repositories not initialized yet");
|
|
49960
|
+
}
|
|
49830
49961
|
return new ProjectAPI(
|
|
49831
49962
|
projectKey || this.options.defaultProjectKey,
|
|
49832
|
-
this.
|
|
49963
|
+
this._repositories,
|
|
49833
49964
|
this._storage
|
|
49834
49965
|
);
|
|
49835
49966
|
}
|
|
@@ -49840,6 +49971,7 @@ ${this.pendingMocks().join("\n")}`
|
|
|
49840
49971
|
server.keepAliveTimeout = 60 * 1e3;
|
|
49841
49972
|
}
|
|
49842
49973
|
createApp(options) {
|
|
49974
|
+
this._repositories = createRepositories(this._storage);
|
|
49843
49975
|
const app = (0, import_express6.default)();
|
|
49844
49976
|
const projectRouter = import_express6.default.Router({ mergeParams: true });
|
|
49845
49977
|
projectRouter.use(import_express6.default.json());
|
|
@@ -49858,12 +49990,11 @@ ${this.pendingMocks().join("\n")}`
|
|
|
49858
49990
|
app.use("/:projectKey", projectRouter);
|
|
49859
49991
|
app.use("/:projectKey/in-store/key=:storeKey", projectRouter);
|
|
49860
49992
|
}
|
|
49861
|
-
this.
|
|
49993
|
+
this._services = createServices(projectRouter, this._repositories);
|
|
49862
49994
|
this._projectService = new ProjectService(
|
|
49863
49995
|
projectRouter,
|
|
49864
49996
|
this._repositories.project
|
|
49865
49997
|
);
|
|
49866
|
-
this._services = createServices(projectRouter, this._repositories);
|
|
49867
49998
|
app.use((err, req, resp, next) => {
|
|
49868
49999
|
if (err instanceof CommercetoolsError) {
|
|
49869
50000
|
return resp.status(err.statusCode).send({
|