merchi_sdk_js 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. package/package.json +4 -4
  2. package/src/helpers.js +1 -1
  3. package/dist/address.js +0 -109
  4. package/dist/assignment.js +0 -175
  5. package/dist/automatic_payment_relationship.js +0 -72
  6. package/dist/backup.js +0 -32
  7. package/dist/bank.js +0 -25
  8. package/dist/cart.js +0 -133
  9. package/dist/cart_item.js +0 -71
  10. package/dist/cart_shipment_group.js +0 -23
  11. package/dist/cart_shipment_quote.js +0 -26
  12. package/dist/category.js +0 -68
  13. package/dist/company.js +0 -248
  14. package/dist/company_invitation.js +0 -70
  15. package/dist/component.js +0 -107
  16. package/dist/component_tag.js +0 -60
  17. package/dist/component_version.js +0 -21
  18. package/dist/country_tax.js +0 -93
  19. package/dist/dictionary.js +0 -130
  20. package/dist/discount.js +0 -22
  21. package/dist/discount_group.js +0 -18
  22. package/dist/domain.js +0 -245
  23. package/dist/domain_invitation.js +0 -17
  24. package/dist/domain_tag.js +0 -87
  25. package/dist/domain_types.js +0 -22
  26. package/dist/draft.js +0 -97
  27. package/dist/draft_comment.js +0 -45
  28. package/dist/draft_template.js +0 -39
  29. package/dist/email_address.js +0 -34
  30. package/dist/email_counter.js +0 -47
  31. package/dist/enrolled_domain.js +0 -88
  32. package/dist/exchange_rate.js +0 -66
  33. package/dist/field_types.js +0 -19
  34. package/dist/helpers.js +0 -86
  35. package/dist/internal_tag.js +0 -98
  36. package/dist/inventory.js +0 -100
  37. package/dist/inventory_unit_variation.js +0 -19
  38. package/dist/invoice.js +0 -225
  39. package/dist/invoice_types.js +0 -11
  40. package/dist/item.js +0 -25
  41. package/dist/job.js +0 -536
  42. package/dist/job_comment.js +0 -45
  43. package/dist/job_status.js +0 -47
  44. package/dist/matching_inventory.js +0 -21
  45. package/dist/md5.js +0 -149
  46. package/dist/menu.js +0 -37
  47. package/dist/menu_item.js +0 -24
  48. package/dist/merchi.js +0 -1004
  49. package/dist/merchi_file.js +0 -165
  50. package/dist/model.js +0 -753
  51. package/dist/notification.js +0 -151
  52. package/dist/notification_types.js +0 -199
  53. package/dist/output.cjs.js +0 -31317
  54. package/dist/output.esm.js +0 -31312
  55. package/dist/page.js +0 -41
  56. package/dist/payment.js +0 -32
  57. package/dist/payment_device.js +0 -21
  58. package/dist/payment_types.js +0 -20
  59. package/dist/phone_number.js +0 -37
  60. package/dist/product.js +0 -288
  61. package/dist/product_types.js +0 -32
  62. package/dist/production_comment.js +0 -44
  63. package/dist/quote.js +0 -91
  64. package/dist/quote_item.js +0 -59
  65. package/dist/roles.js +0 -29
  66. package/dist/seo_domain_page.js +0 -42
  67. package/dist/session.js +0 -103
  68. package/dist/set.js +0 -29
  69. package/dist/shipment.js +0 -181
  70. package/dist/shipment_item.js +0 -17
  71. package/dist/shipment_item_fulfillment.js +0 -17
  72. package/dist/shipment_method.js +0 -81
  73. package/dist/shipment_method_variation.js +0 -38
  74. package/dist/subscription_plan.js +0 -75
  75. package/dist/supply_domain.js +0 -65
  76. package/dist/system_role.js +0 -12
  77. package/dist/theme.js +0 -180
  78. package/dist/theme_css_setting.js +0 -61
  79. package/dist/theme_status.js +0 -11
  80. package/dist/user.js +0 -409
  81. package/dist/user_company.js +0 -19
  82. package/dist/user_types.js +0 -23
  83. package/dist/uuid.js +0 -12
  84. package/dist/variation.js +0 -233
  85. package/dist/variation_field.js +0 -233
  86. package/dist/variation_fields_option.js +0 -41
  87. package/dist/variation_option.js +0 -62
  88. package/dist/variations_group.js +0 -43
  89. package/dist/white_label_accessibilities.js +0 -11
package/dist/roles.js DELETED
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.systemRoles = exports.roles = exports.allRoles = exports.SUPPLIER = exports.SELLER_PLUS = exports.SELLER = exports.RESTRICTED_SUPPLIER = exports.COMPONENT_BUILDER = void 0;
7
- var _dictionary = require("./dictionary.js");
8
- var _set = require("./set.js");
9
- var roles = exports.roles = new _dictionary.Dictionary();
10
- roles.add('public', 0);
11
- roles.add('admin', 1);
12
- roles.add('sales', 2);
13
- roles.add('designer', 3);
14
- roles.add('supplier', 4);
15
- roles.add('client', 5);
16
- roles.add('manager', 6);
17
- roles.add('accountant', 7);
18
- roles.add('theme editor', 8);
19
- var systemRoles = exports.systemRoles = new _dictionary.Dictionary();
20
- systemRoles.add("Component builder", 1);
21
- var allRoles = exports.allRoles = new _set.Set();
22
- roles.each(function (key, value) {
23
- allRoles.add(value);
24
- });
25
- var COMPONENT_BUILDER = exports.COMPONENT_BUILDER = 'Component builder';
26
- var SELLER = exports.SELLER = 'Seller';
27
- var SELLER_PLUS = exports.SELLER_PLUS = 'Seller plus';
28
- var SUPPLIER = exports.SUPPLIER = 'Supplier';
29
- var RESTRICTED_SUPPLIER = exports.RESTRICTED_SUPPLIER = 'Restricted supplier';
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SeoDomainPage = SeoDomainPage;
7
- exports.SeoDomainPages = SeoDomainPages;
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 SeoDomainPage() {
13
- this.resource = '/seo_domain_pages';
14
- this.json = 'seoDomainPage';
15
- this.temporaryId = (0, _uuid.generateUUID)();
16
- (0, _model.addPropertyTo)(this, 'archived');
17
- (0, _model.addPropertyTo)(this, 'id');
18
- (0, _model.addPropertyTo)(this, 'metaDescription');
19
- (0, _model.addPropertyTo)(this, 'metaRobots');
20
- (0, _model.addPropertyTo)(this, 'metaTitle');
21
- (0, _model.addPropertyTo)(this, 'pageKey');
22
- (0, _model.addPropertyTo)(this, 'domain', _domain.Domain);
23
- (0, _model.addPropertyTo)(this, 'product', _product.Product);
24
- }
25
- function SeoDomainPages() {
26
- this.resource = '/seo_domain_pages';
27
- this.json = 'seoDomainPage';
28
- this.single = SeoDomainPage;
29
- this.get = function (success, error, offset, limit, q) {
30
- var self = this;
31
- function handleResponse(result) {
32
- success((0, _model.fromJsonList)(self, result, {
33
- makesDirty: false
34
- }));
35
- }
36
- (0, _model.getList)(this.resource, handleResponse, error, {
37
- offset: offset,
38
- limit: limit,
39
- q: q
40
- });
41
- };
42
- }
package/dist/session.js DELETED
@@ -1,103 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Session = Session;
7
- exports.Sessions = Sessions;
8
- var _dictionary = require("./dictionary.js");
9
- var _model = require("./model.js");
10
- var _user = require("./user.js");
11
- var _domain = require("./domain.js");
12
- function Session() {
13
- this.resource = '/sessions';
14
- this.json = 'session';
15
- (0, _model.addPropertyTo)(this, 'ip');
16
- (0, _model.addPropertyTo)(this, 'user', _user.User);
17
- (0, _model.addPropertyTo)(this, 'domain', _domain.Domain);
18
- (0, _model.addPropertyTo)(this, 'token');
19
- (0, _model.addPropertyTo)(this, 'remember');
20
- this.create = function (success, error, embed, username, password) {
21
- var self = this;
22
- function handleResponse(result) {
23
- success((0, _model.fromJson)(self, result[self.json]));
24
- }
25
- (0, _model.create)({
26
- resource: this.resource,
27
- success: handleResponse,
28
- error: error,
29
- embed: embed,
30
- username: username,
31
- password: password
32
- });
33
- };
34
- this.get = function (success, error, embed) {
35
- var self = this;
36
- function handleResponse(result) {
37
- success((0, _model.fromJson)(self, result[self.json], {
38
- makesDirty: false
39
- }));
40
- }
41
- (0, _model.getOne)({
42
- resource: this.resource,
43
- id: this.token(),
44
- success: handleResponse,
45
- error: error,
46
- embed: embed
47
- });
48
- };
49
- this.remove = function (success, error) {
50
- (0, _model.deleteOne)(this.resource, success, error);
51
- };
52
- this.storeCreate = function (success, error, parameters) {
53
- var request = new _model.Request(),
54
- query = new _dictionary.Dictionary(),
55
- password = parameters.password,
56
- remember = parameters.remember,
57
- storeName = parameters.storeName,
58
- username = parameters.email;
59
- self = this;
60
- if (password) {
61
- request.password(password);
62
- }
63
- if (remember) {
64
- query.add('remember', remember);
65
- }
66
- if (storeName) {
67
- query.add('storeName', storeName);
68
- }
69
- if (username) {
70
- request.username(username);
71
- }
72
- request.resource('/store-session/');
73
- request.method('POST');
74
- request.query().merge(query);
75
- function handleResponse(status, data) {
76
- success((0, _model.fromJson)(self, data[self.json]));
77
- }
78
- function handleError(status, data) {
79
- var statusCode = status ? status : 400,
80
- errorObject = data ? data : {
81
- message: 'could not connect to server',
82
- errorCode: 0
83
- };
84
- error(statusCode, errorObject);
85
- }
86
- request.responseHandler(handleResponse).errorHandler(handleError);
87
- request.send();
88
- };
89
- }
90
- function Sessions() {
91
- this.resource = '/sessions';
92
- this.json = 'sessions';
93
- this.single = Session;
94
- this.get = function (success, error, parameters) {
95
- var self = this;
96
- function handleResponse(result) {
97
- success((0, _model.fromJsonList)(self, result, {
98
- makesDirty: false
99
- }));
100
- }
101
- (0, _model.getList)(this.resource, handleResponse, error, parameters);
102
- };
103
- }
package/dist/set.js DELETED
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Set = Set;
7
- var _dictionary = require("./dictionary.js");
8
- function Set() {
9
- var store = new _dictionary.Dictionary();
10
- this.add = function (value) {
11
- store.add(value, value);
12
- };
13
- this.has = function (value) {
14
- return store.has(value);
15
- };
16
- this.each = function (procedure) {
17
- store.each(function (name, value) {
18
- procedure(value);
19
- });
20
- return this;
21
- };
22
- this.values = function () {
23
- return store.values();
24
- };
25
- this.remove = function (value) {
26
- store.remove(value);
27
- return this;
28
- };
29
- }
package/dist/shipment.js DELETED
@@ -1,181 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.Shipment = Shipment;
7
- exports.Shipments = Shipments;
8
- var _uuid = require("./uuid.js");
9
- var _model = require("./model.js");
10
- var _helpers = require("./helpers.js");
11
- var _address = require("./address.js");
12
- var _assignment = require("./assignment.js");
13
- var _country_tax = require("./country_tax.js");
14
- var _domain_tag = require("./domain_tag.js");
15
- var _user = require("./user.js");
16
- var _company = require("./company.js");
17
- var _invoice = require("./invoice.js");
18
- var _job = require("./job.js");
19
- var _merchi_file = require("./merchi_file.js");
20
- var _shipment_item = require("./shipment_item.js");
21
- var _shipment_method = require("./shipment_method.js");
22
- var _internal_tag = require("./internal_tag.js");
23
- function Shipment() {
24
- this.resource = '/shipments';
25
- this.json = 'shipment';
26
- this.temporaryId = (0, _uuid.generateUUID)();
27
- (0, _model.addPropertyTo)(this, 'id');
28
- (0, _model.addPropertyTo)(this, 'name');
29
- (0, _model.addPropertyTo)(this, 'pickUp');
30
- (0, _model.addPropertyTo)(this, 'shipmentServiceBookingInfo');
31
- (0, _model.addPropertyTo)(this, 'shipmentServiceQuote');
32
- (0, _model.addPropertyTo)(this, 'shipmentLabel', _merchi_file.MerchiFile);
33
- (0, _model.addPropertyTo)(this, 'creationDate');
34
- (0, _model.addPropertyTo)(this, 'dispatchDate');
35
- (0, _model.addPropertyTo)(this, 'dispatchedDate');
36
- (0, _model.addPropertyTo)(this, 'expectedReceiveDate');
37
- (0, _model.addPropertyTo)(this, 'receivedDate');
38
- (0, _model.addPropertyTo)(this, 'sender', _user.User);
39
- (0, _model.addPropertyTo)(this, 'senderCompany', _company.Company);
40
- (0, _model.addPropertyTo)(this, 'senderAddress', _address.Address);
41
- (0, _model.addPropertyTo)(this, 'senderNotes');
42
- (0, _model.addPropertyTo)(this, 'blindShipTo');
43
- (0, _model.addPropertyTo)(this, 'receiver', _user.User);
44
- (0, _model.addPropertyTo)(this, 'receiverCompany', _company.Company);
45
- (0, _model.addPropertyTo)(this, 'receiverAddress', _address.Address);
46
- (0, _model.addPropertyTo)(this, 'receiverNotes');
47
- (0, _model.addPropertyTo)(this, 'invoices', _invoice.Invoice);
48
- (0, _model.addPropertyTo)(this, 'jobs', _job.Job);
49
- (0, _model.addPropertyTo)(this, 'assignments', _assignment.Assignment);
50
- (0, _model.addPropertyTo)(this, 'trackingNumber');
51
- (0, _model.addPropertyTo)(this, 'transportCompany');
52
- (0, _model.addPropertyTo)(this, 'transportCompanyName');
53
- (0, _model.addPropertyTo)(this, 'sendSms');
54
- (0, _model.addPropertyTo)(this, 'sendEmail');
55
- (0, _model.addPropertyTo)(this, 'cost');
56
- (0, _model.addPropertyTo)(this, 'taxAmount');
57
- (0, _model.addPropertyTo)(this, 'maxWeight');
58
- (0, _model.addPropertyTo)(this, 'maxVolume');
59
- (0, _model.addPropertyTo)(this, 'taxType', _country_tax.CountryTax);
60
- (0, _model.addPropertyTo)(this, 'senderResponsible');
61
- (0, _model.addPropertyTo)(this, 'tags', _domain_tag.DomainTag);
62
- (0, _model.addPropertyTo)(this, 'shipmentItems', _shipment_item.ShipmentItem);
63
- (0, _model.addPropertyTo)(this, 'shipmentMethod', _shipment_method.ShipmentMethod);
64
- (0, _model.addPropertyTo)(this, 'internalTags', _internal_tag.InternalTag);
65
- this.get = function (success, error, embed) {
66
- var self = this;
67
- function handleResponse(result) {
68
- success((0, _model.fromJson)(self, result[self.json], {
69
- makesDirty: false
70
- }));
71
- }
72
- (0, _model.getOne)({
73
- resource: this.resource,
74
- id: this.id(),
75
- success: handleResponse,
76
- error: error,
77
- embed: embed
78
- });
79
- };
80
- this.create = function (options) {
81
- var data = (0, _model.serialise)(this),
82
- self = this;
83
- function handleResponse(result) {
84
- options.success((0, _model.fromJson)(self, result[self.json]));
85
- }
86
- (0, _model.create)({
87
- resource: this.resource,
88
- parameters: data[0],
89
- files: (0, _model.enumerateFiles)(data[1]),
90
- success: handleResponse,
91
- error: options.error,
92
- embed: options.embed
93
- });
94
- };
95
- this.patch = function (success, error, data, embed) {
96
- var self = this;
97
- function handleResponse(result) {
98
- success((0, _model.fromJson)(self, result[self.json], {
99
- makesDirty: false
100
- }));
101
- }
102
- (0, _model.patchOne)({
103
- resource: this.resource,
104
- id: this.id(),
105
- success: handleResponse,
106
- error: error,
107
- data: data,
108
- embed: embed
109
- });
110
- };
111
- this.update = function (options) {
112
- var self = this;
113
- this.patch(options.success, options.error, (0, _model.serialise)(self, undefined, undefined, undefined, {
114
- excludeOld: true
115
- })[0], options.embed);
116
- };
117
- this.destroy = function (success, error) {
118
- (0, _model.deleteOne)(this.resource + "/" + this.id(), success, error);
119
- };
120
- this.hasJobs = function () {
121
- return Boolean(this.jobs()) && this.jobs().length > 0;
122
- };
123
- this.hasJob = function (job) {
124
- var jobIndex = this.jobs().findIndex(function (shipmentJob) {
125
- return shipmentJob.id() === job.id();
126
- });
127
- return jobIndex >= 0;
128
- };
129
- this.hasAssignments = function () {
130
- return Boolean(this.assignments()) && this.assignments().length > 0;
131
- };
132
- this.hasAssignment = function (assignment) {
133
- var assignments = this.assignments(),
134
- assignmentIndex;
135
- if (Boolean(assignments)) {
136
- assignmentIndex = assignments.findIndex(function (shipmentAssignment) {
137
- return shipmentAssignment.id() === assignment.id();
138
- });
139
- return assignmentIndex >= 0;
140
- }
141
- return false;
142
- };
143
- this.removeAssignment = function (assignmentId) {
144
- var self = this;
145
- if (Boolean(assignmentId) && assignmentId !== '') {
146
- (0, _helpers.removeObjectFromArrayWithIntegerValue)(self.assignments(), 'id', assignmentId);
147
- }
148
- };
149
- this.removeJob = function (jobId) {
150
- var self = this;
151
- if (Boolean(jobId) && jobId !== '') {
152
- (0, _helpers.removeObjectFromArrayWithIntegerValue)(self.jobs(), 'id', jobId);
153
- }
154
- };
155
- this.readyForDispatchedNotification = function () {
156
- var self = this;
157
- return Boolean(self.id() && self.trackingNumber() && self.transportCompany() && self.dispatchedDate());
158
- };
159
- this.userIsResponsible = function (user) {
160
- var senderResponsible = this.senderResponsible(),
161
- shipmentUser = senderResponsible ? this.sender() : this.receiver();
162
- return shipmentUser && shipmentUser.id() === user.id();
163
- };
164
- this.responsibleCompany = function () {
165
- return this.senderResponsible() ? this.senderCompany() : this.receiverCompany();
166
- };
167
- }
168
- function Shipments() {
169
- this.resource = '/shipments';
170
- this.json = 'shipments';
171
- this.single = Shipment;
172
- this.get = function (success, error, parameters) {
173
- var self = this;
174
- function handleResponse(result) {
175
- success((0, _model.fromJsonList)(self, result, {
176
- makesDirty: false
177
- }));
178
- }
179
- (0, _model.getList)(this.resource, handleResponse, error, parameters);
180
- };
181
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ShipmentItem = ShipmentItem;
7
- var _uuid = require("./uuid.js");
8
- var _model = require("./model.js");
9
- var _shipment_item_fulfillment = require("./shipment_item_fulfillment.js");
10
- var _job = require("./job.js");
11
- function ShipmentItem() {
12
- this.resource = '/shipment_items';
13
- this.json = 'shipmentItem';
14
- this.temporaryId = (0, _uuid.generateUUID)();
15
- (0, _model.addPropertyTo)(this, 'job', _job.Job);
16
- (0, _model.addPropertyTo)(this, 'fulfillments', _shipment_item_fulfillment.ShipmentItemFulfillment);
17
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ShipmentItemFulfillment = ShipmentItemFulfillment;
7
- var _uuid = require("./uuid.js");
8
- var _model = require("./model.js");
9
- var _assignment = require("./assignment.js");
10
- var _job = require("./job.js");
11
- function ShipmentItemFulfillment() {
12
- this.resource = '/shipment_item_fulfillments';
13
- this.json = 'shipmentItemFulfillment';
14
- this.temporaryId = (0, _uuid.generateUUID)();
15
- (0, _model.addPropertyTo)(this, 'assignment', _assignment.Assignment);
16
- (0, _model.addPropertyTo)(this, 'job', _job.Job);
17
- }
@@ -1,81 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ShipmentMethod = ShipmentMethod;
7
- exports.ShipmentMethods = ShipmentMethods;
8
- var _uuid = require("./uuid.js");
9
- var _model = require("./model.js");
10
- var _address = require("./address.js");
11
- var _country_tax = require("./country_tax.js");
12
- var _company = require("./company.js");
13
- var _shipment_method_variation = require("./shipment_method_variation.js");
14
- function ShipmentMethod() {
15
- this.resource = '/shipment_methods';
16
- this.json = 'shipmentMethod';
17
- this.temporaryId = (0, _uuid.generateUUID)();
18
- (0, _model.addPropertyTo)(this, 'id');
19
- (0, _model.addPropertyTo)(this, 'name');
20
- (0, _model.addPropertyTo)(this, 'shipmentService');
21
- (0, _model.addPropertyTo)(this, 'pickUp');
22
- (0, _model.addPropertyTo)(this, 'originAddress', _address.Address);
23
- (0, _model.addPropertyTo)(this, 'company', _company.Company);
24
- (0, _model.addPropertyTo)(this, 'companyDefault');
25
- (0, _model.addPropertyTo)(this, 'defaultCost');
26
- (0, _model.addPropertyTo)(this, 'maxCost');
27
- (0, _model.addPropertyTo)(this, 'currency');
28
- (0, _model.addPropertyTo)(this, 'transportCompany');
29
- (0, _model.addPropertyTo)(this, 'transportCompanyName');
30
- (0, _model.addPropertyTo)(this, 'variations', _shipment_method_variation.ShipmentMethodVariation);
31
- (0, _model.addPropertyTo)(this, 'taxType', _country_tax.CountryTax);
32
- this.create = function (success, error, embed, domainId) {
33
- var data = (0, _model.serialise)(this),
34
- self = this;
35
- function handleResponse(result) {
36
- success((0, _model.fromJson)(self, result[self.json]));
37
- }
38
- (0, _model.create)({
39
- resource: this.resource,
40
- parameters: data[0],
41
- files: (0, _model.enumerateFiles)(data[1]),
42
- success: handleResponse,
43
- error: error,
44
- embed: embed,
45
- as_domain: domainId
46
- });
47
- };
48
- this.patch = function (success, error, embed) {
49
- var self = this,
50
- data = (0, _model.serialise)(this, undefined, undefined, undefined, {
51
- excludeOld: true
52
- })[0];
53
- function handleResponse(result) {
54
- success((0, _model.fromJson)(self, result[self.json], {
55
- makesDirty: false
56
- }));
57
- }
58
- (0, _model.patchOne)({
59
- resource: this.resource,
60
- id: this.id(),
61
- success: handleResponse,
62
- error: error,
63
- data: data,
64
- embed: embed
65
- });
66
- };
67
- }
68
- function ShipmentMethods() {
69
- this.resource = '/shipment_methods';
70
- this.json = 'shipmentMethods';
71
- this.single = ShipmentMethod;
72
- this.get = function (success, error, parameters) {
73
- var self = this;
74
- function handleResponse(result) {
75
- success((0, _model.fromJsonList)(self, result, {
76
- makesDirty: false
77
- }));
78
- }
79
- (0, _model.getList)(this.resource, handleResponse, error, parameters);
80
- };
81
- }
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ShipmentMethodVariation = ShipmentMethodVariation;
7
- exports.ShipmentMethodVariations = ShipmentMethodVariations;
8
- var _uuid = require("./uuid.js");
9
- var _model = require("./model.js");
10
- var _country_tax = require("./country_tax.js");
11
- var _shipment_method = require("./shipment_method.js");
12
- function ShipmentMethodVariation() {
13
- this.resource = '/shipment_method_variations';
14
- this.json = 'shipmentMethodVariation';
15
- this.temporaryId = (0, _uuid.generateUUID)();
16
- (0, _model.addPropertyTo)(this, 'id');
17
- (0, _model.addPropertyTo)(this, 'destinationCountry');
18
- (0, _model.addPropertyTo)(this, 'destinationState');
19
- (0, _model.addPropertyTo)(this, 'cost');
20
- (0, _model.addPropertyTo)(this, 'currency');
21
- (0, _model.addPropertyTo)(this, 'maxWeight');
22
- (0, _model.addPropertyTo)(this, 'shipmentMethod', _shipment_method.ShipmentMethod);
23
- (0, _model.addPropertyTo)(this, 'taxType', _country_tax.CountryTax);
24
- }
25
- function ShipmentMethodVariations() {
26
- this.resource = '/shipment_method_variations';
27
- this.json = 'shipmentMethodVariations';
28
- this.single = ShipmentMethodVariation;
29
- this.get = function (success, error, parameters) {
30
- var self = this;
31
- function handleResponse(result) {
32
- success((0, _model.fromJsonList)(self, result, {
33
- makesDirty: false
34
- }));
35
- }
36
- (0, _model.getList)(this.resource, handleResponse, error, parameters);
37
- };
38
- }
@@ -1,75 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SubscriptionPlan = SubscriptionPlan;
7
- exports.SubscriptionPlans = SubscriptionPlans;
8
- var _model = require("./model.js");
9
- var _user = require("./user.js");
10
- var _country_tax = require("./country_tax.js");
11
- function SubscriptionPlan() {
12
- this.resource = '/subscription_plans';
13
- this.json = 'subscriptionPlan';
14
- (0, _model.addPropertyTo)(this, 'id');
15
- (0, _model.addPropertyTo)(this, 'created');
16
- (0, _model.addPropertyTo)(this, 'updated');
17
- (0, _model.addPropertyTo)(this, 'createdBy', _user.User);
18
- (0, _model.addPropertyTo)(this, 'updatedBy', _user.User);
19
- (0, _model.addPropertyTo)(this, 'name');
20
- (0, _model.addPropertyTo)(this, 'currency');
21
- (0, _model.addPropertyTo)(this, 'tax', _country_tax.CountryTax);
22
- (0, _model.addPropertyTo)(this, 'baseCost');
23
- (0, _model.addPropertyTo)(this, 'whiteLabelDomainCost');
24
- (0, _model.addPropertyTo)(this, 'perSmsCost');
25
- (0, _model.addPropertyTo)(this, 'perUserCost');
26
- (0, _model.addPropertyTo)(this, 'perDomainCost');
27
- (0, _model.addPropertyTo)(this, 'baseUserCount');
28
- (0, _model.addPropertyTo)(this, 'baseDomainCount');
29
- (0, _model.addPropertyTo)(this, 'billingCycleDays');
30
- (0, _model.addPropertyTo)(this, 'isPrivate');
31
- this.create = function (success, error, embed, as_domain) {
32
- var data = (0, _model.serialise)(this),
33
- self = this;
34
- function handleResponse(result) {
35
- success((0, _model.fromJson)(self, result[self.json]));
36
- }
37
- (0, _model.create)({
38
- resource: this.resource,
39
- parameters: data[0],
40
- as_domain: as_domain,
41
- files: (0, _model.enumerateFiles)(data[1]),
42
- success: handleResponse,
43
- error: error,
44
- embed: embed
45
- });
46
- };
47
- this.get = function (success, error) {
48
- var self = this;
49
- function handleResponse(result) {
50
- success((0, _model.fromJson)(self, result[self.json], {
51
- makesDirty: false
52
- }));
53
- }
54
- (0, _model.getOne)({
55
- resource: this.resource,
56
- id: this.id(),
57
- success: handleResponse,
58
- error: error
59
- });
60
- };
61
- }
62
- function SubscriptionPlans() {
63
- this.resource = '/subscription_plans';
64
- this.json = 'subscriptionPlans';
65
- this.single = SubscriptionPlan;
66
- this.get = function (success, error, parameters) {
67
- var self = this;
68
- function handleResponse(result) {
69
- success((0, _model.fromJsonList)(self, result, {
70
- makesDirty: false
71
- }));
72
- }
73
- (0, _model.getList)(this.resource, handleResponse, error, parameters);
74
- };
75
- }
@@ -1,65 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.SupplyDomain = SupplyDomain;
7
- exports.SupplyDomains = SupplyDomains;
8
- var _uuid = require("./uuid.js");
9
- var _model = require("./model.js");
10
- var _product = require("./product.js");
11
- var _domain = require("./domain.js");
12
- function SupplyDomain() {
13
- this.resource = '/supply_domains';
14
- this.json = 'supplyDomain';
15
- this.temporaryId = (0, _uuid.generateUUID)();
16
- (0, _model.addPropertyTo)(this, 'id');
17
- (0, _model.addPropertyTo)(this, 'needsDrafting');
18
- (0, _model.addPropertyTo)(this, 'product', _product.Product);
19
- (0, _model.addPropertyTo)(this, 'supplyProduct', _product.Product);
20
- (0, _model.addPropertyTo)(this, 'domain', _domain.Domain);
21
- this.get = function (success, error) {
22
- var self = this;
23
- function handleResponse(result) {
24
- success((0, _model.fromJson)(self, result[self.json], {
25
- makesDirty: false
26
- }));
27
- }
28
- (0, _model.getOne)({
29
- resource: this.resource,
30
- id: this.id(),
31
- success: handleResponse,
32
- error: error
33
- });
34
- };
35
- this.create = function (success, error, embed, as_domain) {
36
- var data = (0, _model.serialise)(this),
37
- self = this;
38
- function handleResponse(result) {
39
- success((0, _model.fromJson)(self, result[self.json]));
40
- }
41
- (0, _model.create)({
42
- resource: this.resource,
43
- parameters: data[0],
44
- as_domain: as_domain,
45
- files: (0, _model.enumerateFiles)(data[1]),
46
- success: handleResponse,
47
- data: error,
48
- embed: embed
49
- });
50
- };
51
- }
52
- function SupplyDomains() {
53
- this.resource = '/supply_domains';
54
- this.json = 'supplyDomain';
55
- this.single = SupplyDomain;
56
- this.get = function (success, error, parameters) {
57
- var self = this;
58
- function handleResponse(result) {
59
- success((0, _model.fromJsonList)(self, result, {
60
- makesDirty: false
61
- }));
62
- }
63
- (0, _model.getList)(this.resource, handleResponse, error, parameters);
64
- };
65
- }