merchi_cart 0.0.5-c → 0.0.5-d
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/lib/MerchiSDK/entities/address.js +76 -160
- package/lib/MerchiSDK/entities/assignment.js +85 -177
- package/lib/MerchiSDK/entities/automatic_payment_relationship.js +30 -81
- package/lib/MerchiSDK/entities/backup.js +14 -53
- package/lib/MerchiSDK/entities/bank.js +46 -115
- package/lib/MerchiSDK/entities/cart.js +80 -181
- package/lib/MerchiSDK/entities/cart_item.js +73 -158
- package/lib/MerchiSDK/entities/cart_shipment_group.js +24 -69
- package/lib/MerchiSDK/entities/cart_shipment_quote.js +30 -87
- package/lib/MerchiSDK/entities/category.js +34 -94
- package/lib/MerchiSDK/entities/company.js +292 -574
- package/lib/MerchiSDK/entities/company_invitation.js +28 -85
- package/lib/MerchiSDK/entities/component.js +89 -199
- package/lib/MerchiSDK/entities/component_tag.js +16 -58
- package/lib/MerchiSDK/entities/component_version.js +30 -84
- package/lib/MerchiSDK/entities/country_tax.js +48 -112
- package/lib/MerchiSDK/entities/discount.js +32 -85
- package/lib/MerchiSDK/entities/discount_group.js +28 -79
- package/lib/MerchiSDK/entities/domain.js +242 -486
- package/lib/MerchiSDK/entities/domain_invitation.js +32 -92
- package/lib/MerchiSDK/entities/domain_tag.js +38 -101
- package/lib/MerchiSDK/entities/draft.js +77 -168
- package/lib/MerchiSDK/entities/draft_comment.js +52 -127
- package/lib/MerchiSDK/entities/draft_template.js +40 -103
- package/lib/MerchiSDK/entities/email_address.js +26 -74
- package/lib/MerchiSDK/entities/email_counter.js +19 -70
- package/lib/MerchiSDK/entities/enrolled_domain.js +32 -86
- package/lib/MerchiSDK/entities/exchange_rate.js +20 -68
- package/lib/MerchiSDK/entities/file.js +186 -362
- package/lib/MerchiSDK/entities/internal_tag.js +50 -119
- package/lib/MerchiSDK/entities/inventory.js +48 -119
- package/lib/MerchiSDK/entities/inventory_unit_variation.js +24 -74
- package/lib/MerchiSDK/entities/invoice.js +184 -373
- package/lib/MerchiSDK/entities/item.js +44 -106
- package/lib/MerchiSDK/entities/job.js +346 -667
- package/lib/MerchiSDK/entities/job_comment.js +46 -118
- package/lib/MerchiSDK/entities/matching_inventory.js +30 -81
- package/lib/MerchiSDK/entities/menu.js +28 -82
- package/lib/MerchiSDK/entities/menu_item.js +26 -80
- package/lib/MerchiSDK/entities/notification.js +94 -208
- package/lib/MerchiSDK/entities/page.js +30 -87
- package/lib/MerchiSDK/entities/payment.js +59 -139
- package/lib/MerchiSDK/entities/payment_device.js +36 -90
- package/lib/MerchiSDK/entities/phone_number.js +40 -100
- package/lib/MerchiSDK/entities/product.js +399 -745
- package/lib/MerchiSDK/entities/production_comment.js +46 -118
- package/lib/MerchiSDK/entities/quote.js +136 -228
- package/lib/MerchiSDK/entities/quote_item.js +59 -134
- package/lib/MerchiSDK/entities/seo_domain_page.js +28 -85
- package/lib/MerchiSDK/entities/session.js +31 -88
- package/lib/MerchiSDK/entities/shipment.js +190 -373
- package/lib/MerchiSDK/entities/shipment_item.js +18 -57
- package/lib/MerchiSDK/entities/shipment_item_fulfillment.js +18 -57
- package/lib/MerchiSDK/entities/shipment_method.js +56 -137
- package/lib/MerchiSDK/entities/shipment_method_variation.js +42 -105
- package/lib/MerchiSDK/entities/short_url.js +36 -96
- package/lib/MerchiSDK/entities/subscription_plan.js +64 -160
- package/lib/MerchiSDK/entities/supply_domain.js +26 -77
- package/lib/MerchiSDK/entities/system_role.js +16 -58
- package/lib/MerchiSDK/entities/theme.js +283 -554
- package/lib/MerchiSDK/entities/theme_css_setting.js +24 -72
- package/lib/MerchiSDK/entities/user.js +374 -664
- package/lib/MerchiSDK/entities/user_company.js +30 -81
- package/lib/MerchiSDK/entities/variation.js +58 -139
- package/lib/MerchiSDK/entities/variation_field.js +140 -282
- package/lib/MerchiSDK/entities/variation_fields_option.js +92 -189
- package/lib/MerchiSDK/entities/variation_option.js +45 -117
- package/lib/MerchiSDK/entities/variations_group.js +46 -109
- package/lib/MerchiSDK/entity.js +415 -419
- package/lib/MerchiSDK/merchi.js +65 -137
- package/lib/MerchiSDK/request.js +0 -5
- package/package.json +1 -1
|
@@ -1,163 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _decorate(decorators, factory, superClass, mixins) { var api = _getDecoratorsApi(); if (mixins) { for (var i = 0; i < mixins.length; i++) { api = mixins[i](api); } } var r = factory(function initialize(O) { api.initializeInstanceElements(O, decorated.elements); }, superClass); var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); api.initializeClassElements(r.F, decorated.elements); return api.runClassFinishers(r.F, decorated.finishers); }
|
|
4
|
-
function _getDecoratorsApi() { _getDecoratorsApi = function () { return api; }; var api = { elementsDefinitionOrder: [["method"], ["field"]], initializeInstanceElements: function (O, elements) { ["method", "field"].forEach(function (kind) { elements.forEach(function (element) { if (element.kind === kind && element.placement === "own") { this.defineClassElement(O, element); } }, this); }, this); }, initializeClassElements: function (F, elements) { var proto = F.prototype; ["method", "field"].forEach(function (kind) { elements.forEach(function (element) { var placement = element.placement; if (element.kind === kind && (placement === "static" || placement === "prototype")) { var receiver = placement === "static" ? F : proto; this.defineClassElement(receiver, element); } }, this); }, this); }, defineClassElement: function (receiver, element) { var descriptor = element.descriptor; if (element.kind === "field") { var initializer = element.initializer; descriptor = { enumerable: descriptor.enumerable, writable: descriptor.writable, configurable: descriptor.configurable, value: initializer === void 0 ? void 0 : initializer.call(receiver) }; } Object.defineProperty(receiver, element.key, descriptor); }, decorateClass: function (elements, decorators) { var newElements = []; var finishers = []; var placements = { static: [], prototype: [], own: [] }; elements.forEach(function (element) { this.addElementPlacement(element, placements); }, this); elements.forEach(function (element) { if (!_hasDecorators(element)) return newElements.push(element); var elementFinishersExtras = this.decorateElement(element, placements); newElements.push(elementFinishersExtras.element); newElements.push.apply(newElements, elementFinishersExtras.extras); finishers.push.apply(finishers, elementFinishersExtras.finishers); }, this); if (!decorators) { return { elements: newElements, finishers: finishers }; } var result = this.decorateConstructor(newElements, decorators); finishers.push.apply(finishers, result.finishers); result.finishers = finishers; return result; }, addElementPlacement: function (element, placements, silent) { var keys = placements[element.placement]; if (!silent && keys.indexOf(element.key) !== -1) { throw new TypeError("Duplicated element (" + element.key + ")"); } keys.push(element.key); }, decorateElement: function (element, placements) { var extras = []; var finishers = []; for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { var keys = placements[element.placement]; keys.splice(keys.indexOf(element.key), 1); var elementObject = this.fromElementDescriptor(element); var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); element = elementFinisherExtras.element; this.addElementPlacement(element, placements); if (elementFinisherExtras.finisher) { finishers.push(elementFinisherExtras.finisher); } var newExtras = elementFinisherExtras.extras; if (newExtras) { for (var j = 0; j < newExtras.length; j++) { this.addElementPlacement(newExtras[j], placements); } extras.push.apply(extras, newExtras); } } return { element: element, finishers: finishers, extras: extras }; }, decorateConstructor: function (elements, decorators) { var finishers = []; for (var i = decorators.length - 1; i >= 0; i--) { var obj = this.fromClassDescriptor(elements); var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); if (elementsAndFinisher.finisher !== undefined) { finishers.push(elementsAndFinisher.finisher); } if (elementsAndFinisher.elements !== undefined) { elements = elementsAndFinisher.elements; for (var j = 0; j < elements.length - 1; j++) { for (var k = j + 1; k < elements.length; k++) { if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { throw new TypeError("Duplicated element (" + elements[j].key + ")"); } } } } } return { elements: elements, finishers: finishers }; }, fromElementDescriptor: function (element) { var obj = { kind: element.kind, key: element.key, placement: element.placement, descriptor: element.descriptor }; var desc = { value: "Descriptor", configurable: true }; Object.defineProperty(obj, Symbol.toStringTag, desc); if (element.kind === "field") obj.initializer = element.initializer; return obj; }, toElementDescriptors: function (elementObjects) { if (elementObjects === undefined) return; return _toArray(elementObjects).map(function (elementObject) { var element = this.toElementDescriptor(elementObject); this.disallowProperty(elementObject, "finisher", "An element descriptor"); this.disallowProperty(elementObject, "extras", "An element descriptor"); return element; }, this); }, toElementDescriptor: function (elementObject) { var kind = String(elementObject.kind); if (kind !== "method" && kind !== "field") { throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); } var key = _toPropertyKey(elementObject.key); var placement = String(elementObject.placement); if (placement !== "static" && placement !== "prototype" && placement !== "own") { throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); } var descriptor = elementObject.descriptor; this.disallowProperty(elementObject, "elements", "An element descriptor"); var element = { kind: kind, key: key, placement: placement, descriptor: _extends({}, descriptor) }; if (kind !== "field") { this.disallowProperty(elementObject, "initializer", "A method descriptor"); } else { this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); element.initializer = elementObject.initializer; } return element; }, toElementFinisherExtras: function (elementObject) { var element = this.toElementDescriptor(elementObject); var finisher = _optionalCallableProperty(elementObject, "finisher"); var extras = this.toElementDescriptors(elementObject.extras); return { element: element, finisher: finisher, extras: extras }; }, fromClassDescriptor: function (elements) { var obj = { kind: "class", elements: elements.map(this.fromElementDescriptor, this) }; var desc = { value: "Descriptor", configurable: true }; Object.defineProperty(obj, Symbol.toStringTag, desc); return obj; }, toClassDescriptor: function (obj) { var kind = String(obj.kind); if (kind !== "class") { throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); } this.disallowProperty(obj, "key", "A class descriptor"); this.disallowProperty(obj, "placement", "A class descriptor"); this.disallowProperty(obj, "descriptor", "A class descriptor"); this.disallowProperty(obj, "initializer", "A class descriptor"); this.disallowProperty(obj, "extras", "A class descriptor"); var finisher = _optionalCallableProperty(obj, "finisher"); var elements = this.toElementDescriptors(obj.elements); return { elements: elements, finisher: finisher }; }, runClassFinishers: function (constructor, finishers) { for (var i = 0; i < finishers.length; i++) { var newConstructor = (0, finishers[i])(constructor); if (newConstructor !== undefined) { if (typeof newConstructor !== "function") { throw new TypeError("Finishers must return a constructor."); } constructor = newConstructor; } } return constructor; }, disallowProperty: function (obj, name, objectType) { if (obj[name] !== undefined) { throw new TypeError(objectType + " can't have a ." + name + " property."); } } }; return api; }
|
|
5
|
-
function _createElementDescriptor(def) { var key = _toPropertyKey(def.key); var descriptor; if (def.kind === "method") { descriptor = { value: def.value, writable: true, configurable: true, enumerable: false }; } else if (def.kind === "get") { descriptor = { get: def.value, configurable: true, enumerable: false }; } else if (def.kind === "set") { descriptor = { set: def.value, configurable: true, enumerable: false }; } else if (def.kind === "field") { descriptor = { configurable: true, writable: true, enumerable: true }; } var element = { kind: def.kind === "field" ? "field" : "method", key: key, placement: def.static ? "static" : def.kind === "field" ? "own" : "prototype", descriptor: descriptor }; if (def.decorators) element.decorators = def.decorators; if (def.kind === "field") element.initializer = def.value; return element; }
|
|
6
|
-
function _coalesceGetterSetter(element, other) { if (element.descriptor.get !== undefined) { other.descriptor.get = element.descriptor.get; } else { other.descriptor.set = element.descriptor.set; } }
|
|
7
|
-
function _coalesceClassElements(elements) { var newElements = []; var isSameElement = function (other) { return other.kind === "method" && other.key === element.key && other.placement === element.placement; }; for (var i = 0; i < elements.length; i++) { var element = elements[i]; var other; if (element.kind === "method" && (other = newElements.find(isSameElement))) { if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { if (_hasDecorators(element) || _hasDecorators(other)) { throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); } other.descriptor = element.descriptor; } else { if (_hasDecorators(element)) { if (_hasDecorators(other)) { throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); } other.decorators = element.decorators; } _coalesceGetterSetter(element, other); } } else { newElements.push(element); } } return newElements; }
|
|
8
|
-
function _hasDecorators(element) { return element.decorators && element.decorators.length; }
|
|
9
|
-
function _isDataDescriptor(desc) { return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); }
|
|
10
|
-
function _optionalCallableProperty(obj, name) { var value = obj[name]; if (value !== undefined && typeof value !== "function") { throw new TypeError("Expected '" + name + "' to be a function"); } return value; }
|
|
1
|
+
var _dec, _init_archived, _dec2, _init_id, _dec3, _init_lineOne, _dec4, _init_lineTwo, _dec5, _init_city, _dec6, _init_state, _dec7, _init_country, _dec8, _init_postcode, _dec9, _init_shipmentAsSenderAddress, _dec10, _init_shipmentsAsReceiverAddress, _dec11, _init_banks, _dec12, _init_users, _dec13, _init_inventories, _dec14, _init_jobs, _dec15, _init_productedJobs, _dec16, _init_shippingTo, _dec17, _init_companies;
|
|
2
|
+
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw new Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
11
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
12
4
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
+
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
6
|
+
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
13
7
|
import { Entity } from "../entity";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
decorators: [Address.property({
|
|
87
|
-
type: String
|
|
88
|
-
})],
|
|
89
|
-
key: "country",
|
|
90
|
-
value: void 0
|
|
91
|
-
}, {
|
|
92
|
-
kind: "field",
|
|
93
|
-
decorators: [Address.property({
|
|
94
|
-
type: String
|
|
95
|
-
})],
|
|
96
|
-
key: "postcode",
|
|
97
|
-
value: void 0
|
|
98
|
-
}, {
|
|
99
|
-
kind: "field",
|
|
100
|
-
decorators: [Address.property({
|
|
101
|
-
arrayType: 'Shipment'
|
|
102
|
-
})],
|
|
103
|
-
key: "shipmentAsSenderAddress",
|
|
104
|
-
value: void 0
|
|
105
|
-
}, {
|
|
106
|
-
kind: "field",
|
|
107
|
-
decorators: [Address.property({
|
|
108
|
-
arrayType: 'Shipment'
|
|
109
|
-
})],
|
|
110
|
-
key: "shipmentsAsReceiverAddress",
|
|
111
|
-
value: void 0
|
|
112
|
-
}, {
|
|
113
|
-
kind: "field",
|
|
114
|
-
decorators: [Address.property({
|
|
115
|
-
arrayType: 'Bank'
|
|
116
|
-
})],
|
|
117
|
-
key: "banks",
|
|
118
|
-
value: void 0
|
|
119
|
-
}, {
|
|
120
|
-
kind: "field",
|
|
121
|
-
decorators: [Address.property({
|
|
122
|
-
arrayType: 'User'
|
|
123
|
-
})],
|
|
124
|
-
key: "users",
|
|
125
|
-
value: void 0
|
|
126
|
-
}, {
|
|
127
|
-
kind: "field",
|
|
128
|
-
decorators: [Address.property({
|
|
129
|
-
arrayType: 'Inventory'
|
|
130
|
-
})],
|
|
131
|
-
key: "inventories",
|
|
132
|
-
value: void 0
|
|
133
|
-
}, {
|
|
134
|
-
kind: "field",
|
|
135
|
-
decorators: [Address.property({
|
|
136
|
-
arrayType: 'Job'
|
|
137
|
-
})],
|
|
138
|
-
key: "jobs",
|
|
139
|
-
value: void 0
|
|
140
|
-
}, {
|
|
141
|
-
kind: "field",
|
|
142
|
-
decorators: [Address.property({
|
|
143
|
-
arrayType: 'Job'
|
|
144
|
-
})],
|
|
145
|
-
key: "productedJobs",
|
|
146
|
-
value: void 0
|
|
147
|
-
}, {
|
|
148
|
-
kind: "field",
|
|
149
|
-
decorators: [Address.property({
|
|
150
|
-
arrayType: 'Invoice'
|
|
151
|
-
})],
|
|
152
|
-
key: "shippingTo",
|
|
153
|
-
value: void 0
|
|
154
|
-
}, {
|
|
155
|
-
kind: "field",
|
|
156
|
-
decorators: [Address.property({
|
|
157
|
-
arrayType: 'Company'
|
|
158
|
-
})],
|
|
159
|
-
key: "companies",
|
|
160
|
-
value: void 0
|
|
161
|
-
}]
|
|
162
|
-
};
|
|
163
|
-
}, Entity);
|
|
8
|
+
_dec = Address.property({
|
|
9
|
+
type: Date
|
|
10
|
+
});
|
|
11
|
+
_dec2 = Address.property();
|
|
12
|
+
_dec3 = Address.property({
|
|
13
|
+
type: String
|
|
14
|
+
});
|
|
15
|
+
_dec4 = Address.property({
|
|
16
|
+
type: String
|
|
17
|
+
});
|
|
18
|
+
_dec5 = Address.property({
|
|
19
|
+
type: String
|
|
20
|
+
});
|
|
21
|
+
_dec6 = Address.property({
|
|
22
|
+
type: String
|
|
23
|
+
});
|
|
24
|
+
_dec7 = Address.property({
|
|
25
|
+
type: String
|
|
26
|
+
});
|
|
27
|
+
_dec8 = Address.property({
|
|
28
|
+
type: String
|
|
29
|
+
});
|
|
30
|
+
_dec9 = Address.property({
|
|
31
|
+
arrayType: 'Shipment'
|
|
32
|
+
});
|
|
33
|
+
_dec10 = Address.property({
|
|
34
|
+
arrayType: 'Shipment'
|
|
35
|
+
});
|
|
36
|
+
_dec11 = Address.property({
|
|
37
|
+
arrayType: 'Bank'
|
|
38
|
+
});
|
|
39
|
+
_dec12 = Address.property({
|
|
40
|
+
arrayType: 'User'
|
|
41
|
+
});
|
|
42
|
+
_dec13 = Address.property({
|
|
43
|
+
arrayType: 'Inventory'
|
|
44
|
+
});
|
|
45
|
+
_dec14 = Address.property({
|
|
46
|
+
arrayType: 'Job'
|
|
47
|
+
});
|
|
48
|
+
_dec15 = Address.property({
|
|
49
|
+
arrayType: 'Job'
|
|
50
|
+
});
|
|
51
|
+
_dec16 = Address.property({
|
|
52
|
+
arrayType: 'Invoice'
|
|
53
|
+
});
|
|
54
|
+
_dec17 = Address.property({
|
|
55
|
+
arrayType: 'Company'
|
|
56
|
+
});
|
|
57
|
+
export class Address extends Entity {
|
|
58
|
+
static #_ = [_init_archived, _init_id, _init_lineOne, _init_lineTwo, _init_city, _init_state, _init_country, _init_postcode, _init_shipmentAsSenderAddress, _init_shipmentsAsReceiverAddress, _init_banks, _init_users, _init_inventories, _init_jobs, _init_productedJobs, _init_shippingTo, _init_companies] = _applyDecs(this, [[_dec, 0, "archived"], [_dec2, 0, "id"], [_dec3, 0, "lineOne"], [_dec4, 0, "lineTwo"], [_dec5, 0, "city"], [_dec6, 0, "state"], [_dec7, 0, "country"], [_dec8, 0, "postcode"], [_dec9, 0, "shipmentAsSenderAddress"], [_dec10, 0, "shipmentsAsReceiverAddress"], [_dec11, 0, "banks"], [_dec12, 0, "users"], [_dec13, 0, "inventories"], [_dec14, 0, "jobs"], [_dec15, 0, "productedJobs"], [_dec16, 0, "shippingTo"], [_dec17, 0, "companies"]], [], 0, void 0, Entity).e;
|
|
59
|
+
static resourceName = 'addresses';
|
|
60
|
+
static singularName = 'address';
|
|
61
|
+
static pluralName = 'addresses';
|
|
62
|
+
archived = _init_archived(this);
|
|
63
|
+
id = _init_id(this);
|
|
64
|
+
lineOne = _init_lineOne(this);
|
|
65
|
+
lineTwo = _init_lineTwo(this);
|
|
66
|
+
city = _init_city(this);
|
|
67
|
+
state = _init_state(this);
|
|
68
|
+
country = _init_country(this);
|
|
69
|
+
postcode = _init_postcode(this);
|
|
70
|
+
shipmentAsSenderAddress = _init_shipmentAsSenderAddress(this);
|
|
71
|
+
shipmentsAsReceiverAddress = _init_shipmentsAsReceiverAddress(this);
|
|
72
|
+
banks = _init_banks(this);
|
|
73
|
+
users = _init_users(this);
|
|
74
|
+
inventories = _init_inventories(this);
|
|
75
|
+
jobs = _init_jobs(this);
|
|
76
|
+
productedJobs = _init_productedJobs(this);
|
|
77
|
+
shippingTo = _init_shippingTo(this);
|
|
78
|
+
companies = _init_companies(this);
|
|
79
|
+
}
|
|
@@ -1,186 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _decorate(decorators, factory, superClass, mixins) { var api = _getDecoratorsApi(); if (mixins) { for (var i = 0; i < mixins.length; i++) { api = mixins[i](api); } } var r = factory(function initialize(O) { api.initializeInstanceElements(O, decorated.elements); }, superClass); var decorated = api.decorateClass(_coalesceClassElements(r.d.map(_createElementDescriptor)), decorators); api.initializeClassElements(r.F, decorated.elements); return api.runClassFinishers(r.F, decorated.finishers); }
|
|
4
|
-
function _getDecoratorsApi() { _getDecoratorsApi = function () { return api; }; var api = { elementsDefinitionOrder: [["method"], ["field"]], initializeInstanceElements: function (O, elements) { ["method", "field"].forEach(function (kind) { elements.forEach(function (element) { if (element.kind === kind && element.placement === "own") { this.defineClassElement(O, element); } }, this); }, this); }, initializeClassElements: function (F, elements) { var proto = F.prototype; ["method", "field"].forEach(function (kind) { elements.forEach(function (element) { var placement = element.placement; if (element.kind === kind && (placement === "static" || placement === "prototype")) { var receiver = placement === "static" ? F : proto; this.defineClassElement(receiver, element); } }, this); }, this); }, defineClassElement: function (receiver, element) { var descriptor = element.descriptor; if (element.kind === "field") { var initializer = element.initializer; descriptor = { enumerable: descriptor.enumerable, writable: descriptor.writable, configurable: descriptor.configurable, value: initializer === void 0 ? void 0 : initializer.call(receiver) }; } Object.defineProperty(receiver, element.key, descriptor); }, decorateClass: function (elements, decorators) { var newElements = []; var finishers = []; var placements = { static: [], prototype: [], own: [] }; elements.forEach(function (element) { this.addElementPlacement(element, placements); }, this); elements.forEach(function (element) { if (!_hasDecorators(element)) return newElements.push(element); var elementFinishersExtras = this.decorateElement(element, placements); newElements.push(elementFinishersExtras.element); newElements.push.apply(newElements, elementFinishersExtras.extras); finishers.push.apply(finishers, elementFinishersExtras.finishers); }, this); if (!decorators) { return { elements: newElements, finishers: finishers }; } var result = this.decorateConstructor(newElements, decorators); finishers.push.apply(finishers, result.finishers); result.finishers = finishers; return result; }, addElementPlacement: function (element, placements, silent) { var keys = placements[element.placement]; if (!silent && keys.indexOf(element.key) !== -1) { throw new TypeError("Duplicated element (" + element.key + ")"); } keys.push(element.key); }, decorateElement: function (element, placements) { var extras = []; var finishers = []; for (var decorators = element.decorators, i = decorators.length - 1; i >= 0; i--) { var keys = placements[element.placement]; keys.splice(keys.indexOf(element.key), 1); var elementObject = this.fromElementDescriptor(element); var elementFinisherExtras = this.toElementFinisherExtras((0, decorators[i])(elementObject) || elementObject); element = elementFinisherExtras.element; this.addElementPlacement(element, placements); if (elementFinisherExtras.finisher) { finishers.push(elementFinisherExtras.finisher); } var newExtras = elementFinisherExtras.extras; if (newExtras) { for (var j = 0; j < newExtras.length; j++) { this.addElementPlacement(newExtras[j], placements); } extras.push.apply(extras, newExtras); } } return { element: element, finishers: finishers, extras: extras }; }, decorateConstructor: function (elements, decorators) { var finishers = []; for (var i = decorators.length - 1; i >= 0; i--) { var obj = this.fromClassDescriptor(elements); var elementsAndFinisher = this.toClassDescriptor((0, decorators[i])(obj) || obj); if (elementsAndFinisher.finisher !== undefined) { finishers.push(elementsAndFinisher.finisher); } if (elementsAndFinisher.elements !== undefined) { elements = elementsAndFinisher.elements; for (var j = 0; j < elements.length - 1; j++) { for (var k = j + 1; k < elements.length; k++) { if (elements[j].key === elements[k].key && elements[j].placement === elements[k].placement) { throw new TypeError("Duplicated element (" + elements[j].key + ")"); } } } } } return { elements: elements, finishers: finishers }; }, fromElementDescriptor: function (element) { var obj = { kind: element.kind, key: element.key, placement: element.placement, descriptor: element.descriptor }; var desc = { value: "Descriptor", configurable: true }; Object.defineProperty(obj, Symbol.toStringTag, desc); if (element.kind === "field") obj.initializer = element.initializer; return obj; }, toElementDescriptors: function (elementObjects) { if (elementObjects === undefined) return; return _toArray(elementObjects).map(function (elementObject) { var element = this.toElementDescriptor(elementObject); this.disallowProperty(elementObject, "finisher", "An element descriptor"); this.disallowProperty(elementObject, "extras", "An element descriptor"); return element; }, this); }, toElementDescriptor: function (elementObject) { var kind = String(elementObject.kind); if (kind !== "method" && kind !== "field") { throw new TypeError('An element descriptor\'s .kind property must be either "method" or' + ' "field", but a decorator created an element descriptor with' + ' .kind "' + kind + '"'); } var key = _toPropertyKey(elementObject.key); var placement = String(elementObject.placement); if (placement !== "static" && placement !== "prototype" && placement !== "own") { throw new TypeError('An element descriptor\'s .placement property must be one of "static",' + ' "prototype" or "own", but a decorator created an element descriptor' + ' with .placement "' + placement + '"'); } var descriptor = elementObject.descriptor; this.disallowProperty(elementObject, "elements", "An element descriptor"); var element = { kind: kind, key: key, placement: placement, descriptor: _extends({}, descriptor) }; if (kind !== "field") { this.disallowProperty(elementObject, "initializer", "A method descriptor"); } else { this.disallowProperty(descriptor, "get", "The property descriptor of a field descriptor"); this.disallowProperty(descriptor, "set", "The property descriptor of a field descriptor"); this.disallowProperty(descriptor, "value", "The property descriptor of a field descriptor"); element.initializer = elementObject.initializer; } return element; }, toElementFinisherExtras: function (elementObject) { var element = this.toElementDescriptor(elementObject); var finisher = _optionalCallableProperty(elementObject, "finisher"); var extras = this.toElementDescriptors(elementObject.extras); return { element: element, finisher: finisher, extras: extras }; }, fromClassDescriptor: function (elements) { var obj = { kind: "class", elements: elements.map(this.fromElementDescriptor, this) }; var desc = { value: "Descriptor", configurable: true }; Object.defineProperty(obj, Symbol.toStringTag, desc); return obj; }, toClassDescriptor: function (obj) { var kind = String(obj.kind); if (kind !== "class") { throw new TypeError('A class descriptor\'s .kind property must be "class", but a decorator' + ' created a class descriptor with .kind "' + kind + '"'); } this.disallowProperty(obj, "key", "A class descriptor"); this.disallowProperty(obj, "placement", "A class descriptor"); this.disallowProperty(obj, "descriptor", "A class descriptor"); this.disallowProperty(obj, "initializer", "A class descriptor"); this.disallowProperty(obj, "extras", "A class descriptor"); var finisher = _optionalCallableProperty(obj, "finisher"); var elements = this.toElementDescriptors(obj.elements); return { elements: elements, finisher: finisher }; }, runClassFinishers: function (constructor, finishers) { for (var i = 0; i < finishers.length; i++) { var newConstructor = (0, finishers[i])(constructor); if (newConstructor !== undefined) { if (typeof newConstructor !== "function") { throw new TypeError("Finishers must return a constructor."); } constructor = newConstructor; } } return constructor; }, disallowProperty: function (obj, name, objectType) { if (obj[name] !== undefined) { throw new TypeError(objectType + " can't have a ." + name + " property."); } } }; return api; }
|
|
5
|
-
function _createElementDescriptor(def) { var key = _toPropertyKey(def.key); var descriptor; if (def.kind === "method") { descriptor = { value: def.value, writable: true, configurable: true, enumerable: false }; } else if (def.kind === "get") { descriptor = { get: def.value, configurable: true, enumerable: false }; } else if (def.kind === "set") { descriptor = { set: def.value, configurable: true, enumerable: false }; } else if (def.kind === "field") { descriptor = { configurable: true, writable: true, enumerable: true }; } var element = { kind: def.kind === "field" ? "field" : "method", key: key, placement: def.static ? "static" : def.kind === "field" ? "own" : "prototype", descriptor: descriptor }; if (def.decorators) element.decorators = def.decorators; if (def.kind === "field") element.initializer = def.value; return element; }
|
|
6
|
-
function _coalesceGetterSetter(element, other) { if (element.descriptor.get !== undefined) { other.descriptor.get = element.descriptor.get; } else { other.descriptor.set = element.descriptor.set; } }
|
|
7
|
-
function _coalesceClassElements(elements) { var newElements = []; var isSameElement = function (other) { return other.kind === "method" && other.key === element.key && other.placement === element.placement; }; for (var i = 0; i < elements.length; i++) { var element = elements[i]; var other; if (element.kind === "method" && (other = newElements.find(isSameElement))) { if (_isDataDescriptor(element.descriptor) || _isDataDescriptor(other.descriptor)) { if (_hasDecorators(element) || _hasDecorators(other)) { throw new ReferenceError("Duplicated methods (" + element.key + ") can't be decorated."); } other.descriptor = element.descriptor; } else { if (_hasDecorators(element)) { if (_hasDecorators(other)) { throw new ReferenceError("Decorators can't be placed on different accessors with for " + "the same property (" + element.key + ")."); } other.decorators = element.decorators; } _coalesceGetterSetter(element, other); } } else { newElements.push(element); } } return newElements; }
|
|
8
|
-
function _hasDecorators(element) { return element.decorators && element.decorators.length; }
|
|
9
|
-
function _isDataDescriptor(desc) { return desc !== undefined && !(desc.value === undefined && desc.writable === undefined); }
|
|
10
|
-
function _optionalCallableProperty(obj, name) { var value = obj[name]; if (value !== undefined && typeof value !== "function") { throw new TypeError("Expected '" + name + "' to be a function"); } return value; }
|
|
1
|
+
var _dec, _init_archived, _dec2, _init_id, _dec3, _init_managerAccepts, _dec4, _init_supplierRefused, _dec5, _init_needsDrafting, _dec6, _init_needsShipping, _dec7, _init_productionDeadline, _dec8, _init_assignmentDeadline, _dec9, _init_notes, _dec10, _init_job, _dec11, _init_supplyJob, _dec12, _init_supplier, _dec13, _init_quote, _dec14, _init_comments, _dec15, _init_shipment, _dec16, _init_supplyDomain, _dec17, _init_notifications, _dec18, _init_productionFiles;
|
|
2
|
+
function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function (e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw new Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O.static = l, O.private = f, f ? 2 === o ? k = function (e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function (e) { return e[n]; }, (o < 2 || 4 === o) && (F = function (e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == typeof P && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol.for("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol.for("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function (t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
|
|
11
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
12
4
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
+
function _setFunctionName(e, t, n) { "symbol" == typeof t && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
|
|
6
|
+
function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? typeof e : "null")); return e; }
|
|
13
7
|
import { Entity } from "../entity";
|
|
14
8
|
import { Quote } from "./quote";
|
|
15
9
|
import { Shipment } from "./shipment";
|
|
16
10
|
import { SupplyDomain } from "./supply_domain";
|
|
17
11
|
import { User } from "./user";
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
_dec = Assignment.property({
|
|
13
|
+
type: Date
|
|
14
|
+
});
|
|
15
|
+
_dec2 = Assignment.property();
|
|
16
|
+
_dec3 = Assignment.property({
|
|
17
|
+
type: Date
|
|
18
|
+
});
|
|
19
|
+
_dec4 = Assignment.property({
|
|
20
|
+
type: Date
|
|
21
|
+
});
|
|
22
|
+
_dec5 = Assignment.property();
|
|
23
|
+
_dec6 = Assignment.property();
|
|
24
|
+
_dec7 = Assignment.property();
|
|
25
|
+
_dec8 = Assignment.property();
|
|
26
|
+
_dec9 = Assignment.property({
|
|
27
|
+
type: String
|
|
28
|
+
});
|
|
29
|
+
_dec10 = Assignment.property({
|
|
30
|
+
type: 'Job'
|
|
31
|
+
});
|
|
32
|
+
_dec11 = Assignment.property({
|
|
33
|
+
type: 'Job'
|
|
34
|
+
});
|
|
35
|
+
_dec12 = Assignment.property({
|
|
36
|
+
type: User
|
|
37
|
+
});
|
|
38
|
+
_dec13 = Assignment.property({
|
|
39
|
+
type: Quote
|
|
40
|
+
});
|
|
41
|
+
_dec14 = Assignment.property({
|
|
42
|
+
arrayType: 'ProductionComment'
|
|
43
|
+
});
|
|
44
|
+
_dec15 = Assignment.property({
|
|
45
|
+
type: Shipment
|
|
46
|
+
});
|
|
47
|
+
_dec16 = Assignment.property({
|
|
48
|
+
type: SupplyDomain
|
|
49
|
+
});
|
|
50
|
+
_dec17 = Assignment.property({
|
|
51
|
+
arrayType: 'Notification'
|
|
52
|
+
});
|
|
53
|
+
_dec18 = Assignment.property({
|
|
54
|
+
arrayType: 'MerchiFile'
|
|
55
|
+
});
|
|
56
|
+
export class Assignment extends Entity {
|
|
57
|
+
static #_ = [_init_archived, _init_id, _init_managerAccepts, _init_supplierRefused, _init_needsDrafting, _init_needsShipping, _init_productionDeadline, _init_assignmentDeadline, _init_notes, _init_job, _init_supplyJob, _init_supplier, _init_quote, _init_comments, _init_shipment, _init_supplyDomain, _init_notifications, _init_productionFiles] = _applyDecs(this, [[_dec, 0, "archived"], [_dec2, 0, "id"], [_dec3, 0, "managerAccepts"], [_dec4, 0, "supplierRefused"], [_dec5, 0, "needsDrafting"], [_dec6, 0, "needsShipping"], [_dec7, 0, "productionDeadline"], [_dec8, 0, "assignmentDeadline"], [_dec9, 0, "notes"], [_dec10, 0, "job"], [_dec11, 0, "supplyJob"], [_dec12, 0, "supplier"], [_dec13, 0, "quote"], [_dec14, 0, "comments"], [_dec15, 0, "shipment"], [_dec16, 0, "supplyDomain"], [_dec17, 0, "notifications"], [_dec18, 0, "productionFiles"]], [], 0, void 0, Entity).e;
|
|
58
|
+
static resourceName = 'assignments';
|
|
59
|
+
static singularName = 'assignment';
|
|
60
|
+
static pluralName = 'assignments';
|
|
61
|
+
archived = _init_archived(this);
|
|
62
|
+
id = _init_id(this);
|
|
63
|
+
managerAccepts = _init_managerAccepts(this);
|
|
64
|
+
supplierRefused = _init_supplierRefused(this);
|
|
65
|
+
needsDrafting = _init_needsDrafting(this);
|
|
66
|
+
needsShipping = _init_needsShipping(this);
|
|
67
|
+
productionDeadline = _init_productionDeadline(this);
|
|
68
|
+
assignmentDeadline = _init_assignmentDeadline(this);
|
|
69
|
+
notes = _init_notes(this);
|
|
70
|
+
job = _init_job(this);
|
|
71
|
+
supplyJob = _init_supplyJob(this);
|
|
72
|
+
supplier = _init_supplier(this);
|
|
73
|
+
quote = _init_quote(this);
|
|
74
|
+
comments = _init_comments(this);
|
|
75
|
+
shipment = _init_shipment(this);
|
|
76
|
+
supplyDomain = _init_supplyDomain(this);
|
|
77
|
+
notifications = _init_notifications(this);
|
|
78
|
+
productionFiles = _init_productionFiles(this);
|
|
79
|
+
generateInvoice = props => {
|
|
80
|
+
const resource = `/generate-invoice-for-assignment/${this.id}/`;
|
|
81
|
+
const fetchOptions = {
|
|
82
|
+
method: 'POST'
|
|
83
|
+
};
|
|
84
|
+
fetchOptions.query = [];
|
|
85
|
+
if (props && props.addToInvoice) {
|
|
86
|
+
fetchOptions.query.push(['add_to_invoice', String(props.addToInvoice)]);
|
|
23
87
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
static: true,
|
|
30
|
-
key: "resourceName",
|
|
31
|
-
value() {
|
|
32
|
-
return 'assignments';
|
|
33
|
-
}
|
|
34
|
-
}, {
|
|
35
|
-
kind: "field",
|
|
36
|
-
static: true,
|
|
37
|
-
key: "singularName",
|
|
38
|
-
value() {
|
|
39
|
-
return 'assignment';
|
|
40
|
-
}
|
|
41
|
-
}, {
|
|
42
|
-
kind: "field",
|
|
43
|
-
static: true,
|
|
44
|
-
key: "pluralName",
|
|
45
|
-
value() {
|
|
46
|
-
return 'assignments';
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
kind: "field",
|
|
50
|
-
decorators: [Assignment.property({
|
|
51
|
-
type: Date
|
|
52
|
-
})],
|
|
53
|
-
key: "archived",
|
|
54
|
-
value: void 0
|
|
55
|
-
}, {
|
|
56
|
-
kind: "field",
|
|
57
|
-
decorators: [Assignment.property()],
|
|
58
|
-
key: "id",
|
|
59
|
-
value: void 0
|
|
60
|
-
}, {
|
|
61
|
-
kind: "field",
|
|
62
|
-
decorators: [Assignment.property({
|
|
63
|
-
type: Date
|
|
64
|
-
})],
|
|
65
|
-
key: "managerAccepts",
|
|
66
|
-
value: void 0
|
|
67
|
-
}, {
|
|
68
|
-
kind: "field",
|
|
69
|
-
decorators: [Assignment.property({
|
|
70
|
-
type: Date
|
|
71
|
-
})],
|
|
72
|
-
key: "supplierRefused",
|
|
73
|
-
value: void 0
|
|
74
|
-
}, {
|
|
75
|
-
kind: "field",
|
|
76
|
-
decorators: [Assignment.property()],
|
|
77
|
-
key: "needsDrafting",
|
|
78
|
-
value: void 0
|
|
79
|
-
}, {
|
|
80
|
-
kind: "field",
|
|
81
|
-
decorators: [Assignment.property()],
|
|
82
|
-
key: "needsShipping",
|
|
83
|
-
value: void 0
|
|
84
|
-
}, {
|
|
85
|
-
kind: "field",
|
|
86
|
-
decorators: [Assignment.property()],
|
|
87
|
-
key: "productionDeadline",
|
|
88
|
-
value: void 0
|
|
89
|
-
}, {
|
|
90
|
-
kind: "field",
|
|
91
|
-
decorators: [Assignment.property()],
|
|
92
|
-
key: "assignmentDeadline",
|
|
93
|
-
value: void 0
|
|
94
|
-
}, {
|
|
95
|
-
kind: "field",
|
|
96
|
-
decorators: [Assignment.property({
|
|
97
|
-
type: String
|
|
98
|
-
})],
|
|
99
|
-
key: "notes",
|
|
100
|
-
value: void 0
|
|
101
|
-
}, {
|
|
102
|
-
kind: "field",
|
|
103
|
-
decorators: [Assignment.property({
|
|
104
|
-
type: 'Job'
|
|
105
|
-
})],
|
|
106
|
-
key: "job",
|
|
107
|
-
value: void 0
|
|
108
|
-
}, {
|
|
109
|
-
kind: "field",
|
|
110
|
-
decorators: [Assignment.property({
|
|
111
|
-
type: 'Job'
|
|
112
|
-
})],
|
|
113
|
-
key: "supplyJob",
|
|
114
|
-
value: void 0
|
|
115
|
-
}, {
|
|
116
|
-
kind: "field",
|
|
117
|
-
decorators: [Assignment.property({
|
|
118
|
-
type: User
|
|
119
|
-
})],
|
|
120
|
-
key: "supplier",
|
|
121
|
-
value: void 0
|
|
122
|
-
}, {
|
|
123
|
-
kind: "field",
|
|
124
|
-
decorators: [Assignment.property({
|
|
125
|
-
type: Quote
|
|
126
|
-
})],
|
|
127
|
-
key: "quote",
|
|
128
|
-
value: void 0
|
|
129
|
-
}, {
|
|
130
|
-
kind: "field",
|
|
131
|
-
decorators: [Assignment.property({
|
|
132
|
-
arrayType: 'ProductionComment'
|
|
133
|
-
})],
|
|
134
|
-
key: "comments",
|
|
135
|
-
value: void 0
|
|
136
|
-
}, {
|
|
137
|
-
kind: "field",
|
|
138
|
-
decorators: [Assignment.property({
|
|
139
|
-
type: Shipment
|
|
140
|
-
})],
|
|
141
|
-
key: "shipment",
|
|
142
|
-
value: void 0
|
|
143
|
-
}, {
|
|
144
|
-
kind: "field",
|
|
145
|
-
decorators: [Assignment.property({
|
|
146
|
-
type: SupplyDomain
|
|
147
|
-
})],
|
|
148
|
-
key: "supplyDomain",
|
|
149
|
-
value: void 0
|
|
150
|
-
}, {
|
|
151
|
-
kind: "field",
|
|
152
|
-
decorators: [Assignment.property({
|
|
153
|
-
arrayType: 'Notification'
|
|
154
|
-
})],
|
|
155
|
-
key: "notifications",
|
|
156
|
-
value: void 0
|
|
157
|
-
}, {
|
|
158
|
-
kind: "field",
|
|
159
|
-
decorators: [Assignment.property({
|
|
160
|
-
arrayType: 'MerchiFile'
|
|
161
|
-
})],
|
|
162
|
-
key: "productionFiles",
|
|
163
|
-
value: void 0
|
|
164
|
-
}, {
|
|
165
|
-
kind: "field",
|
|
166
|
-
key: "generateInvoice",
|
|
167
|
-
value() {
|
|
168
|
-
return props => {
|
|
169
|
-
const resource = `/generate-invoice-for-assignment/${this.id}/`;
|
|
170
|
-
const fetchOptions = {
|
|
171
|
-
method: 'POST'
|
|
172
|
-
};
|
|
173
|
-
fetchOptions.query = [];
|
|
174
|
-
if (props && props.addToInvoice) {
|
|
175
|
-
fetchOptions.query.push(['add_to_invoice', String(props.addToInvoice)]);
|
|
176
|
-
}
|
|
177
|
-
return this.merchi.authenticatedFetch(resource, fetchOptions).then(data => {
|
|
178
|
-
const invoice = new this.merchi.Invoice();
|
|
179
|
-
invoice.fromJson(data);
|
|
180
|
-
return invoice;
|
|
181
|
-
});
|
|
182
|
-
};
|
|
183
|
-
}
|
|
184
|
-
}]
|
|
88
|
+
return this.merchi.authenticatedFetch(resource, fetchOptions).then(data => {
|
|
89
|
+
const invoice = new this.merchi.Invoice();
|
|
90
|
+
invoice.fromJson(data);
|
|
91
|
+
return invoice;
|
|
92
|
+
});
|
|
185
93
|
};
|
|
186
|
-
}
|
|
94
|
+
}
|