merchi_sdk_js 0.0.2 → 0.0.4

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.
Files changed (88) hide show
  1. package/package.json +4 -3
  2. package/dist/address.js +0 -109
  3. package/dist/assignment.js +0 -175
  4. package/dist/automatic_payment_relationship.js +0 -72
  5. package/dist/backup.js +0 -32
  6. package/dist/bank.js +0 -25
  7. package/dist/cart.js +0 -133
  8. package/dist/cart_item.js +0 -71
  9. package/dist/cart_shipment_group.js +0 -23
  10. package/dist/cart_shipment_quote.js +0 -26
  11. package/dist/category.js +0 -68
  12. package/dist/company.js +0 -248
  13. package/dist/company_invitation.js +0 -70
  14. package/dist/component.js +0 -107
  15. package/dist/component_tag.js +0 -60
  16. package/dist/component_version.js +0 -21
  17. package/dist/country_tax.js +0 -93
  18. package/dist/dictionary.js +0 -130
  19. package/dist/discount.js +0 -22
  20. package/dist/discount_group.js +0 -18
  21. package/dist/domain.js +0 -245
  22. package/dist/domain_invitation.js +0 -17
  23. package/dist/domain_tag.js +0 -87
  24. package/dist/domain_types.js +0 -22
  25. package/dist/draft.js +0 -97
  26. package/dist/draft_comment.js +0 -45
  27. package/dist/draft_template.js +0 -39
  28. package/dist/email_address.js +0 -34
  29. package/dist/email_counter.js +0 -47
  30. package/dist/enrolled_domain.js +0 -88
  31. package/dist/exchange_rate.js +0 -66
  32. package/dist/field_types.js +0 -19
  33. package/dist/helpers.js +0 -86
  34. package/dist/internal_tag.js +0 -98
  35. package/dist/inventory.js +0 -100
  36. package/dist/inventory_unit_variation.js +0 -19
  37. package/dist/invoice.js +0 -225
  38. package/dist/invoice_types.js +0 -11
  39. package/dist/item.js +0 -25
  40. package/dist/job.js +0 -536
  41. package/dist/job_comment.js +0 -45
  42. package/dist/job_status.js +0 -47
  43. package/dist/matching_inventory.js +0 -21
  44. package/dist/md5.js +0 -149
  45. package/dist/menu.js +0 -37
  46. package/dist/menu_item.js +0 -24
  47. package/dist/merchi.js +0 -1004
  48. package/dist/merchi_file.js +0 -165
  49. package/dist/model.js +0 -753
  50. package/dist/notification.js +0 -151
  51. package/dist/notification_types.js +0 -199
  52. package/dist/output.cjs.js +0 -31317
  53. package/dist/output.esm.js +0 -31312
  54. package/dist/page.js +0 -41
  55. package/dist/payment.js +0 -32
  56. package/dist/payment_device.js +0 -21
  57. package/dist/payment_types.js +0 -20
  58. package/dist/phone_number.js +0 -37
  59. package/dist/product.js +0 -288
  60. package/dist/product_types.js +0 -32
  61. package/dist/production_comment.js +0 -44
  62. package/dist/quote.js +0 -91
  63. package/dist/quote_item.js +0 -59
  64. package/dist/roles.js +0 -29
  65. package/dist/seo_domain_page.js +0 -42
  66. package/dist/session.js +0 -103
  67. package/dist/set.js +0 -29
  68. package/dist/shipment.js +0 -181
  69. package/dist/shipment_item.js +0 -17
  70. package/dist/shipment_item_fulfillment.js +0 -17
  71. package/dist/shipment_method.js +0 -81
  72. package/dist/shipment_method_variation.js +0 -38
  73. package/dist/subscription_plan.js +0 -75
  74. package/dist/supply_domain.js +0 -65
  75. package/dist/system_role.js +0 -12
  76. package/dist/theme.js +0 -180
  77. package/dist/theme_css_setting.js +0 -61
  78. package/dist/theme_status.js +0 -11
  79. package/dist/user.js +0 -409
  80. package/dist/user_company.js +0 -19
  81. package/dist/user_types.js +0 -23
  82. package/dist/uuid.js +0 -12
  83. package/dist/variation.js +0 -233
  84. package/dist/variation_field.js +0 -233
  85. package/dist/variation_fields_option.js +0 -41
  86. package/dist/variation_option.js +0 -62
  87. package/dist/variations_group.js +0 -43
  88. package/dist/white_label_accessibilities.js +0 -11
@@ -1,130 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Dictionary = Dictionary;
7
- var _formData = _interopRequireDefault(require("form-data"));
8
- var _browserOrNode = require("browser-or-node");
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
- function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11
- function Dictionary() {
12
- var store = {},
13
- count = 0;
14
- function noSuchKey(name) {
15
- throw 'No such key "' + String(name) + '" in dictionary';
16
- }
17
- this.clone = function () {
18
- return new Dictionary(store, count);
19
- };
20
- this.add = function (name, value) {
21
- if (!this.has(name)) {
22
- ++count;
23
- }
24
- store[name] = value;
25
- return this;
26
- };
27
- this.getArray = function (names) {
28
- /** passing a array of keys return the values array
29
- * corresponding to the keys **/
30
- var i,
31
- returnArray = [];
32
- for (i = 0; i < names.length; i++) {
33
- if (this.has(names[i])) {
34
- returnArray.push(store[names[i]]);
35
- } else {
36
- noSuchKey(names[i]);
37
- }
38
- }
39
- return returnArray;
40
- };
41
- this.get = function (name, default_) {
42
- if (this.has(name)) {
43
- return store[name];
44
- }
45
- if (default_ !== undefined) {
46
- return default_;
47
- }
48
- return noSuchKey(name);
49
- };
50
- this.has = function (name) {
51
- return Object.prototype.hasOwnProperty.call(store, name) && Object.prototype.propertyIsEnumerable.call(store, name);
52
- };
53
- this.remove = function (name) {
54
- if (this.has(name)) {
55
- delete store[name];
56
- --count;
57
- return this;
58
- }
59
- return noSuchKey(name);
60
- };
61
- this.merge = function (other) {
62
- var _this = this;
63
- if (other.__proto__.constructor === Dictionary) {
64
- other.each(function (name, value) {
65
- _this.add(name, value);
66
- });
67
- } else {
68
- for (var property in other) {
69
- if (other.hasOwnProperty(property)) {
70
- _this.add(property, other[property]);
71
- }
72
- }
73
- }
74
- return this;
75
- };
76
- this.each = function (procedure) {
77
- var name;
78
- for (name in store) {
79
- if (Object.prototype.hasOwnProperty.call(store, name)) {
80
- procedure(name, store[name]);
81
- }
82
- }
83
- return this;
84
- };
85
- this.keys = function () {
86
- var result = [];
87
- this.each(function (name) {
88
- result.push(name);
89
- });
90
- return result;
91
- };
92
- this.values = function () {
93
- var result = [];
94
- this.each(function (ignore, value) {
95
- result.push(value);
96
- });
97
- return result;
98
- };
99
- this.count = function () {
100
- return count;
101
- };
102
- this.toFormData = function () {
103
- var result;
104
- if (_browserOrNode.isJsDom || _browserOrNode.isBrowser) {
105
- result = new FormData();
106
- } else {
107
- result = new _formData["default"]();
108
- }
109
- this.each(function (key, value) {
110
- result.append(key, value);
111
- });
112
- return result;
113
- };
114
- this.toUriEncoding = function () {
115
- var result = '';
116
- this.each(function (key, value) {
117
- if (_typeof(key) === "object") {
118
- throw "cannot URI encode object key";
119
- }
120
- if (_typeof(value) === "object") {
121
- throw "cannot URI encode object name";
122
- }
123
- result += encodeURIComponent(key);
124
- result += '=';
125
- result += encodeURIComponent(value);
126
- result += '&';
127
- });
128
- return result.slice(0, -1);
129
- };
130
- }
package/dist/discount.js DELETED
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Discount = Discount;
7
- var _uuid = require("./uuid.js");
8
- var _model = require("./model.js");
9
- function Discount() {
10
- this.resource = '/discounts';
11
- this.json = 'discount';
12
- this.temporaryId = (0, _uuid.generateUUID)();
13
- (0, _model.addPropertyTo)(this, 'id');
14
- (0, _model.addPropertyTo)(this, 'lowerLimit');
15
- (0, _model.addPropertyTo)(this, 'amount');
16
- this.discountedUnitCost = function (unitPrice) {
17
- var unitCost = unitPrice ? unitPrice : 0,
18
- amount = this.amount() ? this.amount() : 0,
19
- discount = 100 - amount;
20
- return parseFloat(unitCost / 100 * discount).toFixed(3);
21
- };
22
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DiscountGroup = DiscountGroup;
7
- var _uuid = require("./uuid.js");
8
- var _model = require("./model.js");
9
- function DiscountGroup() {
10
- this.resource = '/discountGroups';
11
- this.json = 'discountGroup';
12
- this.temporaryId = (0, _uuid.generateUUID)();
13
- (0, _model.addPropertyTo)(this, 'id');
14
- (0, _model.addPropertyTo)(this, 'discountType');
15
- (0, _model.addPropertyTo)(this, 'discounts');
16
- (0, _model.addPropertyTo)(this, 'name');
17
- (0, _model.addPropertyTo)(this, 'product');
18
- }
package/dist/domain.js DELETED
@@ -1,245 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Domain = Domain;
7
- exports.Domains = Domains;
8
- var _uuid = require("./uuid.js");
9
- var _dictionary = require("./dictionary.js");
10
- var _model = require("./model.js");
11
- var _roles = require("./roles.js");
12
- var _domain_types = require("./domain_types.js");
13
- var _company = require("./company.js");
14
- var _domain_tag = require("./domain_tag.js");
15
- var _domain_invitation = require("./domain_invitation.js");
16
- var _theme = require("./theme.js");
17
- var _merchi_file = require("./merchi_file.js");
18
- var _menu = require("./menu.js");
19
- var _supply_domain = require("./supply_domain.js");
20
- var _seo_domain_page = require("./seo_domain_page.js");
21
- var _user = require("./user.js");
22
- var _internal_tag = require("./internal_tag.js");
23
- function Domain() {
24
- this.resource = '/domains';
25
- this.json = 'domain';
26
- this.temporaryId = (0, _uuid.generateUUID)();
27
- (0, _model.addPropertyTo)(this, 'id');
28
- (0, _model.addPropertyTo)(this, 'aiContext');
29
- (0, _model.addPropertyTo)(this, 'apiSecret');
30
- (0, _model.addPropertyTo)(this, 'webflowApiKey');
31
- (0, _model.addPropertyTo)(this, 'shopifyShopUrl');
32
- (0, _model.addPropertyTo)(this, 'shopifyIsActive');
33
- (0, _model.addPropertyTo)(this, 'country');
34
- (0, _model.addPropertyTo)(this, 'currency');
35
- (0, _model.addPropertyTo)(this, 'domain');
36
- (0, _model.addPropertyTo)(this, 'domainType');
37
- (0, _model.addPropertyTo)(this, 'activeThemeId');
38
- (0, _model.addPropertyTo)(this, 'activeTheme', _theme.Theme);
39
- (0, _model.addPropertyTo)(this, 'subDomain');
40
- (0, _model.addPropertyTo)(this, 'theme');
41
- (0, _model.addPropertyTo)(this, 'logoUrl');
42
- (0, _model.addPropertyTo)(this, 'smsName');
43
- (0, _model.addPropertyTo)(this, 'emailDomain');
44
- (0, _model.addPropertyTo)(this, 'trackingCodeGoogleConversion');
45
- (0, _model.addPropertyTo)(this, 'trackingCodeGoogleGlobal');
46
- (0, _model.addPropertyTo)(this, 'qrShopQrCode');
47
- (0, _model.addPropertyTo)(this, 'logo', _merchi_file.MerchiFile);
48
- (0, _model.addPropertyTo)(this, 'favicon', _merchi_file.MerchiFile);
49
- (0, _model.addPropertyTo)(this, 'company', _company.Company);
50
- (0, _model.addPropertyTo)(this, 'ownedBy', _company.Company);
51
- (0, _model.addPropertyTo)(this, 'accessibleClients', _user.User);
52
- (0, _model.addPropertyTo)(this, 'accessibleClientCompanies', _company.Company);
53
- (0, _model.addPropertyTo)(this, 'unltdAiApiOrganizationId');
54
- (0, _model.addPropertyTo)(this, 'unltdAiApiSecretKey');
55
- (0, _model.addPropertyTo)(this, 'menus', _menu.Menu);
56
- (0, _model.addPropertyTo)(this, 'socialBitchute');
57
- (0, _model.addPropertyTo)(this, 'socialDiscord');
58
- (0, _model.addPropertyTo)(this, 'socialFacebook');
59
- (0, _model.addPropertyTo)(this, 'socialGoogle');
60
- (0, _model.addPropertyTo)(this, 'socialInstagram');
61
- (0, _model.addPropertyTo)(this, 'socialLinkedin');
62
- (0, _model.addPropertyTo)(this, 'socialRumble');
63
- (0, _model.addPropertyTo)(this, 'socialTelegram');
64
- (0, _model.addPropertyTo)(this, 'socialTiktok');
65
- (0, _model.addPropertyTo)(this, 'socialX');
66
- (0, _model.addPropertyTo)(this, 'socialYoutube');
67
- (0, _model.addPropertyTo)(this, 'internalUseNotes');
68
- (0, _model.addPropertyTo)(this, 'internalUseAiContext');
69
- (0, _model.addPropertyTo)(this, 'showDomainPublicly');
70
- (0, _model.addPropertyTo)(this, 'publicAccessRestricted');
71
- (0, _model.addPropertyTo)(this, 'showDomainToAccessibleEntitiesOnly');
72
- (0, _model.addPropertyTo)(this, 'enableNotifications');
73
- (0, _model.addPropertyTo)(this, 'enableEmailNotifications');
74
- (0, _model.addPropertyTo)(this, 'enableSmsNotifications');
75
- (0, _model.addPropertyTo)(this, 'seoDomainPages', _seo_domain_page.SeoDomainPage);
76
- (0, _model.addPropertyTo)(this, 'themes', _theme.Theme);
77
- (0, _model.addPropertyTo)(this, 'supplyProducts', _supply_domain.SupplyDomain);
78
- (0, _model.addPropertyTo)(this, 'domainInvitations', _domain_invitation.DomainInvitation);
79
- (0, _model.addPropertyTo)(this, 'jobsAssignees', _user.User);
80
- (0, _model.addPropertyTo)(this, 'tags', _domain_tag.DomainTag);
81
- (0, _model.addPropertyTo)(this, 'internalTags', _internal_tag.InternalTag);
82
- this.create = function (success, error, embed, as_domain) {
83
- var data = (0, _model.serialise)(this),
84
- self = this;
85
- function handleResponse(result) {
86
- success((0, _model.fromJson)(self, result[self.json]));
87
- }
88
- (0, _model.create)({
89
- resource: this.resource,
90
- parameters: data[0],
91
- files: (0, _model.enumerateFiles)(data[1]),
92
- as_domain: as_domain,
93
- success: handleResponse,
94
- error: error,
95
- embed: embed
96
- });
97
- };
98
- this.get = function (success, error, embed, withRights) {
99
- var self = this;
100
- function handleResponse(result) {
101
- success((0, _model.fromJson)(self, result[self.json], {
102
- makesDirty: false
103
- }));
104
- }
105
- (0, _model.getOne)({
106
- resource: this.resource,
107
- id: this.id(),
108
- success: handleResponse,
109
- error: error,
110
- embed: embed,
111
- withRights: withRights
112
- });
113
- };
114
- this.invite = function (invitationData, success, error, embed) {
115
- var request = new _model.Request(),
116
- data = new _dictionary.Dictionary(),
117
- self = this,
118
- _id = self.id();
119
- function handleResponse(status, data) {
120
- var newInvitation = new _domain_invitation.DomainInvitation(),
121
- invitation = data,
122
- invitations = self.domainInvitations() ? self.domainInvitations() : [];
123
- newInvitation.id(invitation.id);
124
- newInvitation.userEmail(invitation.userEmail);
125
- newInvitation.userName(invitation.userName);
126
- newInvitation.role(invitation.role);
127
- invitations.push(newInvitation);
128
- self.domainInvitations(invitations);
129
- success(self);
130
- }
131
- data.add("inviteUserEmail", invitationData.emailAddress);
132
- data.add("inviteUserName", invitationData.userName);
133
- data.add("domainId", _id);
134
- data.add("domainRole", invitationData.role);
135
- request.resource('/domain_invite/').method('POST');
136
- request.data().merge(data);
137
- request.responseHandler(handleResponse);
138
- request.errorHandler(error);
139
- request.send();
140
- };
141
- this.getUsers = function (success, error, offset, limit, q, embed, tab) {
142
- var self = this,
143
- users = new _user.Users();
144
- function handleResponse(result) {
145
- success((0, _model.fromJsonList)(users, result));
146
- }
147
- (0, _model.getList)(users.resource, handleResponse, error, {
148
- inDomain: self.id(),
149
- tab: tab,
150
- offset: offset,
151
- limit: limit,
152
- q: q,
153
- embed: embed
154
- });
155
- };
156
- this.getManagers = function (success, error, offset, limit, embed) {
157
- var self = this;
158
- self.getUsers(success, error, offset, limit, null, embed, "manager");
159
- };
160
- this.getUsersWithRoles = function (success, error, roles, offset, limit, embed) {
161
- var self = this,
162
- users = new _user.Users();
163
- function handleResponse(result) {
164
- success((0, _model.fromJsonList)(users, result));
165
- }
166
- (0, _model.getList)(users.resource, handleResponse, error, {
167
- inDomain: self.id(),
168
- inDomainRoles: roles,
169
- offset: offset,
170
- limit: limit,
171
- embed: embed
172
- });
173
- };
174
- this.patch = function (success, error, embed, as_domain) {
175
- var data = data = (0, _model.serialise)(this)[0],
176
- self = this;
177
- function handleResponse(result) {
178
- success((0, _model.fromJson)(self, result[self.json]));
179
- }
180
- (0, _model.patchOne)({
181
- resource: this.resource,
182
- id: this.id(),
183
- success: handleResponse,
184
- as_domain: as_domain,
185
- error: error,
186
- data: data,
187
- embed: embed
188
- });
189
- };
190
- this.update = function (success, error, embed) {
191
- this.patch(success, error, (0, _model.serialise)(this, undefined, undefined, undefined, {
192
- excludeOld: true
193
- })[0], embed);
194
- };
195
- this.mainMenu = function () {
196
- var menus = this.menus(),
197
- i = 0;
198
- if (menus === undefined) {
199
- return null;
200
- }
201
- for (i = 0; i < menus.length; ++i) {
202
- if (menus[i].menuType() === 0) {
203
- return menus[i];
204
- }
205
- }
206
- return null;
207
- };
208
- this.domainLogoUrl = function () {
209
- var logo = this.logo();
210
- return logo && logo.viewUrl() ? logo.viewUrl() : null;
211
- };
212
- this.faviconLogoUrl = function () {
213
- var favicon = this.favicon();
214
- return favicon && favicon.viewUrl() ? favicon.viewUrl() : null;
215
- };
216
- this.isDomainType = function (typeName) {
217
- return this.domainType() === _domain_types.domainTypesInts.get(typeName);
218
- };
219
- this.isSellerDomain = function () {
220
- return this.isDomainType(_roles.SELLER);
221
- };
222
- this.isSellerOrSellerPlusDomain = function () {
223
- return this.isSellerDomain() || this.isDomainType(_roles.SELLER_PLUS);
224
- };
225
- this.isSupplierOrRestrictedSupplierDomain = function () {
226
- return this.isDomainType(_roles.SUPPLIER) || this.isDomainType(_roles.RESTRICTED_SUPPLIER);
227
- };
228
- this.isUnrestricted = function () {
229
- return this.domainType() === _domain_types.domainTypesInts.get('Unrestricted');
230
- };
231
- }
232
- function Domains() {
233
- this.resource = '/domains';
234
- this.json = 'domains';
235
- this.single = Domain;
236
- this.get = function (success, error, parameters) {
237
- var self = this;
238
- function handleResponse(result) {
239
- success((0, _model.fromJsonList)(self, result, {
240
- makesDirty: false
241
- }));
242
- }
243
- (0, _model.getList)(this.resource, handleResponse, error, parameters);
244
- };
245
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DomainInvitation = DomainInvitation;
7
- var _uuid = require("./uuid.js");
8
- var _model = require("./model.js");
9
- function DomainInvitation() {
10
- this.resource = '/domain_invitations';
11
- this.json = 'domainInvitation';
12
- this.temporaryId = (0, _uuid.generateUUID)();
13
- (0, _model.addPropertyTo)(this, 'id');
14
- (0, _model.addPropertyTo)(this, 'userName');
15
- (0, _model.addPropertyTo)(this, 'userEmail');
16
- (0, _model.addPropertyTo)(this, 'role');
17
- }
@@ -1,87 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DomainTag = DomainTag;
7
- exports.DomainTags = DomainTags;
8
- var _uuid = require("./uuid.js");
9
- var _model = require("./model.js");
10
- var _domain = require("./domain.js");
11
- var _product = require("./product.js");
12
- function DomainTag() {
13
- this.resource = '/domain_tags';
14
- this.json = 'domainTag';
15
- this.temporaryId = (0, _uuid.generateUUID)();
16
- (0, _model.addPropertyTo)(this, 'id');
17
- (0, _model.addPropertyTo)(this, 'name');
18
- (0, _model.addPropertyTo)(this, 'description');
19
- (0, _model.addPropertyTo)(this, 'colour');
20
- (0, _model.addPropertyTo)(this, 'showPublic');
21
- (0, _model.addPropertyTo)(this, 'domain', _domain.Domain);
22
- (0, _model.addPropertyTo)(this, 'products', _product.Product);
23
- this.create = function (success, error, embed, domainId) {
24
- var data = (0, _model.serialise)(this),
25
- self = this;
26
- function handleResponse(result) {
27
- success((0, _model.fromJson)(self, result[self.json]));
28
- }
29
- (0, _model.create)({
30
- resource: this.resource,
31
- parameters: data[0],
32
- files: (0, _model.enumerateFiles)(data[1]),
33
- success: handleResponse,
34
- error: error,
35
- embed: embed,
36
- as_domain: domainId
37
- });
38
- };
39
- this.get = function (success, error) {
40
- var self = this;
41
- function handleResponse(result) {
42
- success((0, _model.fromJson)(self, result[self.json], {
43
- makesDirty: false
44
- }));
45
- }
46
- (0, _model.getOne)({
47
- resource: this.resource,
48
- id: this.id(),
49
- success: handleResponse,
50
- error: error
51
- });
52
- };
53
- this.patch = function (success, error, embed) {
54
- var self = this,
55
- data = (0, _model.serialise)(this)[0];
56
- function handleResponse(result) {
57
- success((0, _model.fromJson)(self, result[self.json], {
58
- makesDirty: false
59
- }));
60
- }
61
- (0, _model.patchOne)({
62
- resource: this.resource,
63
- id: this.id(),
64
- success: handleResponse,
65
- error: error,
66
- data: data,
67
- embed: embed
68
- });
69
- };
70
- this.destroy = function (success, error) {
71
- (0, _model.deleteOne)(this.resource + "/" + this.id(), success, error);
72
- };
73
- }
74
- function DomainTags() {
75
- this.resource = '/domain_tags';
76
- this.json = 'domainTags';
77
- this.single = DomainTag;
78
- this.get = function (success, error, parameters) {
79
- var self = this;
80
- function handleResponse(result) {
81
- success((0, _model.fromJsonList)(self, result, {
82
- makesDirty: false
83
- }));
84
- }
85
- (0, _model.getList)(this.resource, handleResponse, error, parameters);
86
- };
87
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.domainTypesInts = exports.domainTypes = void 0;
7
- var _dictionary = require("./dictionary.js");
8
- var domainTypes = exports.domainTypes = new _dictionary.Dictionary();
9
- domainTypes.add(0, 'Unrestricted');
10
- domainTypes.add(1, 'Seller');
11
- domainTypes.add(2, 'Seller plus');
12
- domainTypes.add(3, 'Supplier');
13
- domainTypes.add(4, 'Restricted supplier');
14
- domainTypes.add(5, 'Domain supplier');
15
- domainTypes.add(6, 'Domain client catalogue');
16
- domainTypes.add(7, 'Domain shopify seller');
17
- domainTypes.add(8, 'Unrestricted shopify app');
18
- domainTypes.add(9, 'Reserved');
19
- var domainTypesInts = exports.domainTypesInts = new _dictionary.Dictionary();
20
- domainTypes.each(function (key, value) {
21
- domainTypesInts.add(value, parseInt(key, 10));
22
- });
package/dist/draft.js DELETED
@@ -1,97 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Draft = Draft;
7
- exports.Drafts = Drafts;
8
- var _model = require("./model.js");
9
- var _helpers = require("./helpers.js");
10
- var _job = require("./job.js");
11
- var _user = require("./user.js");
12
- var _draft_comment = require("./draft_comment.js");
13
- var _merchi_file = require("./merchi_file.js");
14
- function Draft() {
15
- this.resource = '/drafts';
16
- this.json = 'draft';
17
- (0, _model.addPropertyTo)(this, 'id');
18
- (0, _model.addPropertyTo)(this, 'job', _job.Job);
19
- (0, _model.addPropertyTo)(this, 'sharedWithJob', _job.Job);
20
- (0, _model.addPropertyTo)(this, 'designer', _user.User);
21
- (0, _model.addPropertyTo)(this, 'file', _merchi_file.MerchiFile);
22
- (0, _model.addPropertyTo)(this, 'date');
23
- (0, _model.addPropertyTo)(this, 'accepted');
24
- (0, _model.addPropertyTo)(this, 'changesRequested');
25
- (0, _model.addPropertyTo)(this, 'resendDate');
26
- (0, _model.addPropertyTo)(this, 'viewed');
27
- (0, _model.addPropertyTo)(this, 'justViewed');
28
- (0, _model.addPropertyTo)(this, 'comments', _draft_comment.DraftComment);
29
- (0, _model.addPropertyTo)(this, 'commentsCount');
30
- (0, _model.addPropertyTo)(this, 'sendSms');
31
- (0, _model.addPropertyTo)(this, 'sendEmail');
32
- this.get = function (success, error, embed, include_archived) {
33
- var self = this;
34
- function handleResponse(result) {
35
- success((0, _model.fromJson)(self, result[self.json], {
36
- makesDirty: false
37
- }));
38
- }
39
- (0, _model.getOne)({
40
- resource: this.resource,
41
- id: this.id(),
42
- success: handleResponse,
43
- error: error,
44
- embed: embed,
45
- includeArchived: include_archived
46
- });
47
- };
48
- this.patch = function (options) {
49
- var self = this,
50
- data = (0, _model.serialise)(this, undefined, undefined, undefined, {
51
- excludeOld: true
52
- })[0],
53
- job = this.job(),
54
- domain = job && job.domain() ? job.domain().id() : null,
55
- asDomain = options.asDomain,
56
- domainId = (0, _helpers.isUndefined)(asDomain) ? domain : asDomain;
57
- function handleResponse(result) {
58
- options.success((0, _model.fromJson)(self, result[self.json]));
59
- }
60
- (0, _model.patchOne)({
61
- resource: this.resource,
62
- id: this.id(),
63
- success: handleResponse,
64
- error: options.error,
65
- as_domain: domainId,
66
- data: data,
67
- embed: options.embed
68
- });
69
- };
70
- this.changesRequested = function () {
71
- var comments = this.comments() ? this.comments() : [],
72
- i;
73
- for (i = 0; i < comments.length; i++) {
74
- if (comments[i].changeRequest()) {
75
- return true;
76
- }
77
- }
78
- return false;
79
- };
80
- this.commentsYoungestToEldest = function () {
81
- return (0, _helpers.sortArrayByObjectKeyDescending)(this.comments(), 'id');
82
- };
83
- }
84
- function Drafts() {
85
- this.resource = '/drafts';
86
- this.json = 'drafts';
87
- this.single = Draft;
88
- this.get = function (success, error, parameters) {
89
- var self = this;
90
- function handleResponse(result) {
91
- success((0, _model.fromJsonList)(self, result, {
92
- makesDirty: false
93
- }));
94
- }
95
- (0, _model.getList)(this.resource, handleResponse, error, parameters);
96
- };
97
- }
@@ -1,45 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.DraftComment = DraftComment;
7
- var _model = require("./model.js");
8
- var _draft = require("./draft.js");
9
- var _job = require("./job.js");
10
- var _user = require("./user.js");
11
- var _notification = require("./notification.js");
12
- var _merchi_file = require("./merchi_file.js");
13
- function DraftComment() {
14
- this.resource = '/draft_comments';
15
- this.json = 'draftComment';
16
- (0, _model.addPropertyTo)(this, 'id');
17
- (0, _model.addPropertyTo)(this, 'draft', _draft.Draft);
18
- (0, _model.addPropertyTo)(this, 'user', _user.User);
19
- (0, _model.addPropertyTo)(this, 'file', _merchi_file.MerchiFile);
20
- (0, _model.addPropertyTo)(this, 'notifications', _notification.Notification);
21
- (0, _model.addPropertyTo)(this, 'job', _job.Job);
22
- (0, _model.addPropertyTo)(this, 'date');
23
- (0, _model.addPropertyTo)(this, 'text');
24
- (0, _model.addPropertyTo)(this, 'urgency');
25
- (0, _model.addPropertyTo)(this, 'subject');
26
- (0, _model.addPropertyTo)(this, 'sendSms');
27
- (0, _model.addPropertyTo)(this, 'sendEmail');
28
- (0, _model.addPropertyTo)(this, 'changeRequest');
29
- this.create = function (options) {
30
- var data = (0, _model.serialise)(this),
31
- self = this;
32
- function handleResponse(result) {
33
- options.success((0, _model.fromJson)(self, result[self.json]));
34
- }
35
- (0, _model.create)({
36
- resource: this.resource,
37
- parameters: data[0],
38
- files: (0, _model.enumerateFiles)(data[1]),
39
- success: handleResponse,
40
- as_domain: options.as_domain,
41
- error: options.error,
42
- embed: options.embed
43
- });
44
- };
45
- }