merchi_sdk_ts 0.0.1

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 (226) hide show
  1. package/.babelrc +13 -0
  2. package/.eslintrc.cjs +43 -0
  3. package/LICENSE +21 -0
  4. package/README.md +2 -0
  5. package/jest.config.js +17 -0
  6. package/package.json +44 -0
  7. package/src/constants/auto_assign_production_on_actions.ts +6 -0
  8. package/src/constants/call_to_actions.test.ts +5 -0
  9. package/src/constants/call_to_actions.ts +14 -0
  10. package/src/constants/discount_types.test.ts +5 -0
  11. package/src/constants/discount_types.ts +3 -0
  12. package/src/constants/domain_types.test.ts +5 -0
  13. package/src/constants/domain_types.ts +12 -0
  14. package/src/constants/errors.ts +32 -0
  15. package/src/constants/event_types.test.ts +5 -0
  16. package/src/constants/event_types.ts +5 -0
  17. package/src/constants/field_types.test.ts +5 -0
  18. package/src/constants/field_types.ts +13 -0
  19. package/src/constants/input_types.test.ts +5 -0
  20. package/src/constants/input_types.ts +13 -0
  21. package/src/constants/inventory_status.test.ts +5 -0
  22. package/src/constants/inventory_statuses.ts +6 -0
  23. package/src/constants/invoice_types.test.ts +5 -0
  24. package/src/constants/invoice_types.ts +5 -0
  25. package/src/constants/item_types.test.ts +5 -0
  26. package/src/constants/item_types.ts +5 -0
  27. package/src/constants/job/drafting_status.test.ts +5 -0
  28. package/src/constants/job/drafting_status.ts +7 -0
  29. package/src/constants/job/payment_status.test.ts +5 -0
  30. package/src/constants/job/payment_status.ts +7 -0
  31. package/src/constants/job/production_status.test.ts +5 -0
  32. package/src/constants/job/production_status.ts +12 -0
  33. package/src/constants/job/shipment_status.test.ts +5 -0
  34. package/src/constants/job/shipment_status.ts +11 -0
  35. package/src/constants/job/supply_chain_request_status.test.ts +5 -0
  36. package/src/constants/job/supply_chain_request_status.ts +6 -0
  37. package/src/constants/job_priorities.test.ts +5 -0
  38. package/src/constants/job_priorities.ts +6 -0
  39. package/src/constants/job_status.test.ts +5 -0
  40. package/src/constants/job_status.ts +49 -0
  41. package/src/constants/job_types.test.ts +5 -0
  42. package/src/constants/job_types.ts +15 -0
  43. package/src/constants/notification_sections.test.ts +5 -0
  44. package/src/constants/notification_sections.ts +13 -0
  45. package/src/constants/notification_types.test.ts +5 -0
  46. package/src/constants/notification_types.ts +97 -0
  47. package/src/constants/notification_urgencies.test.ts +5 -0
  48. package/src/constants/notification_urgencies.ts +7 -0
  49. package/src/constants/payment_types.test.ts +5 -0
  50. package/src/constants/payment_types.ts +10 -0
  51. package/src/constants/platform.test.ts +15 -0
  52. package/src/constants/platform.ts +6 -0
  53. package/src/constants/product_types.test.ts +6 -0
  54. package/src/constants/product_types.ts +25 -0
  55. package/src/constants/rights.test.ts +5 -0
  56. package/src/constants/rights.ts +5 -0
  57. package/src/constants/robots_meta_directives.test.ts +5 -0
  58. package/src/constants/robots_meta_directives.ts +11 -0
  59. package/src/constants/roles.test.ts +5 -0
  60. package/src/constants/roles.ts +38 -0
  61. package/src/constants/shipment_companies.test.ts +5 -0
  62. package/src/constants/shipment_companies.ts +18 -0
  63. package/src/constants/shipment_services.test.ts +5 -0
  64. package/src/constants/shipment_services.ts +3 -0
  65. package/src/constants/system_roles.test.ts +5 -0
  66. package/src/constants/system_roles.ts +3 -0
  67. package/src/constants/theme_foundations.test.ts +5 -0
  68. package/src/constants/theme_foundations.ts +6 -0
  69. package/src/constants/theme_status.test.ts +5 -0
  70. package/src/constants/theme_status.ts +5 -0
  71. package/src/constants/user_types.test.ts +5 -0
  72. package/src/constants/user_types.ts +17 -0
  73. package/src/constants/white_label_accessibilities.test.ts +5 -0
  74. package/src/constants/white_label_accessibilities.ts +6 -0
  75. package/src/cookie.test.ts +11 -0
  76. package/src/cookie.ts +16 -0
  77. package/src/entities/address.test.ts +7 -0
  78. package/src/entities/address.ts +65 -0
  79. package/src/entities/assignment.test.ts +39 -0
  80. package/src/entities/assignment.ts +92 -0
  81. package/src/entities/automatic_payment_relationship.test.ts +8 -0
  82. package/src/entities/automatic_payment_relationship.ts +26 -0
  83. package/src/entities/backup.test.ts +7 -0
  84. package/src/entities/backup.ts +14 -0
  85. package/src/entities/bank.test.ts +7 -0
  86. package/src/entities/bank.ts +45 -0
  87. package/src/entities/cart.test.ts +50 -0
  88. package/src/entities/cart.ts +89 -0
  89. package/src/entities/cart_item.test.ts +33 -0
  90. package/src/entities/cart_item.ts +77 -0
  91. package/src/entities/cart_shipment_group.ts +21 -0
  92. package/src/entities/cart_shipment_quote.ts +33 -0
  93. package/src/entities/category.test.ts +57 -0
  94. package/src/entities/category.ts +37 -0
  95. package/src/entities/company.test.ts +7 -0
  96. package/src/entities/company.ts +275 -0
  97. package/src/entities/company_invitation.test.ts +7 -0
  98. package/src/entities/company_invitation.ts +33 -0
  99. package/src/entities/component.test.ts +14 -0
  100. package/src/entities/component.ts +92 -0
  101. package/src/entities/component_tag.test.ts +7 -0
  102. package/src/entities/component_tag.ts +17 -0
  103. package/src/entities/component_version.test.ts +7 -0
  104. package/src/entities/component_version.ts +30 -0
  105. package/src/entities/country_tax.test.ts +13 -0
  106. package/src/entities/country_tax.ts +46 -0
  107. package/src/entities/discount.test.ts +18 -0
  108. package/src/entities/discount.ts +34 -0
  109. package/src/entities/discount_group.test.ts +7 -0
  110. package/src/entities/discount_group.ts +28 -0
  111. package/src/entities/domain.test.ts +79 -0
  112. package/src/entities/domain.ts +246 -0
  113. package/src/entities/domain_invitation.test.ts +7 -0
  114. package/src/entities/domain_invitation.ts +36 -0
  115. package/src/entities/domain_tag.test.ts +7 -0
  116. package/src/entities/domain_tag.ts +42 -0
  117. package/src/entities/draft.test.ts +43 -0
  118. package/src/entities/draft.ts +88 -0
  119. package/src/entities/draft_comment.test.ts +7 -0
  120. package/src/entities/draft_comment.ts +54 -0
  121. package/src/entities/draft_template.test.ts +7 -0
  122. package/src/entities/draft_template.ts +40 -0
  123. package/src/entities/email_address.test.ts +7 -0
  124. package/src/entities/email_address.ts +24 -0
  125. package/src/entities/email_counter.test.ts +7 -0
  126. package/src/entities/email_counter.ts +20 -0
  127. package/src/entities/enrolled_domain.test.ts +7 -0
  128. package/src/entities/enrolled_domain.ts +40 -0
  129. package/src/entities/exchange_rate.test.ts +7 -0
  130. package/src/entities/exchange_rate.ts +22 -0
  131. package/src/entities/file.test.ts +43 -0
  132. package/src/entities/file.ts +172 -0
  133. package/src/entities/internal_tag.test.ts +7 -0
  134. package/src/entities/internal_tag.ts +51 -0
  135. package/src/entities/inventory.test.ts +28 -0
  136. package/src/entities/inventory.ts +56 -0
  137. package/src/entities/inventory_unit_variation.test.ts +7 -0
  138. package/src/entities/inventory_unit_variation.ts +29 -0
  139. package/src/entities/invoice.test.ts +43 -0
  140. package/src/entities/invoice.ts +179 -0
  141. package/src/entities/item.test.ts +19 -0
  142. package/src/entities/item.ts +44 -0
  143. package/src/entities/job.test.ts +95 -0
  144. package/src/entities/job.ts +349 -0
  145. package/src/entities/job_comment.test.ts +7 -0
  146. package/src/entities/job_comment.ts +50 -0
  147. package/src/entities/matching_inventory.ts +29 -0
  148. package/src/entities/menu.test.ts +7 -0
  149. package/src/entities/menu.ts +30 -0
  150. package/src/entities/menu_item.test.ts +7 -0
  151. package/src/entities/menu_item.ts +29 -0
  152. package/src/entities/notification.test.ts +7 -0
  153. package/src/entities/notification.ts +99 -0
  154. package/src/entities/page.test.ts +7 -0
  155. package/src/entities/page.ts +32 -0
  156. package/src/entities/payment.test.ts +19 -0
  157. package/src/entities/payment.ts +65 -0
  158. package/src/entities/payment_device.test.ts +7 -0
  159. package/src/entities/payment_device.ts +30 -0
  160. package/src/entities/phone_number.test.ts +7 -0
  161. package/src/entities/phone_number.ts +36 -0
  162. package/src/entities/product.test.ts +750 -0
  163. package/src/entities/product.ts +427 -0
  164. package/src/entities/production_comment.test.ts +7 -0
  165. package/src/entities/production_comment.ts +50 -0
  166. package/src/entities/quote.test.ts +98 -0
  167. package/src/entities/quote.ts +140 -0
  168. package/src/entities/quote_item.test.ts +50 -0
  169. package/src/entities/quote_item.ts +71 -0
  170. package/src/entities/seo_domain_page.test.ts +7 -0
  171. package/src/entities/seo_domain_page.ts +33 -0
  172. package/src/entities/session.test.ts +7 -0
  173. package/src/entities/session.ts +28 -0
  174. package/src/entities/shipment.test.ts +24 -0
  175. package/src/entities/shipment.ts +185 -0
  176. package/src/entities/shipment_item.test.ts +7 -0
  177. package/src/entities/shipment_item.ts +15 -0
  178. package/src/entities/shipment_item_fulfillment.test.ts +8 -0
  179. package/src/entities/shipment_item_fulfillment.ts +15 -0
  180. package/src/entities/shipment_method.test.ts +7 -0
  181. package/src/entities/shipment_method.ts +61 -0
  182. package/src/entities/shipment_method_variation.test.ts +7 -0
  183. package/src/entities/shipment_method_variation.ts +39 -0
  184. package/src/entities/short_url.test.ts +7 -0
  185. package/src/entities/short_url.ts +36 -0
  186. package/src/entities/subscription_plan.test.ts +7 -0
  187. package/src/entities/subscription_plan.ts +73 -0
  188. package/src/entities/supply_domain.test.ts +7 -0
  189. package/src/entities/supply_domain.ts +27 -0
  190. package/src/entities/system_role.test.ts +7 -0
  191. package/src/entities/system_role.ts +17 -0
  192. package/src/entities/theme.test.ts +38 -0
  193. package/src/entities/theme.ts +267 -0
  194. package/src/entities/theme_css_setting.test.ts +7 -0
  195. package/src/entities/theme_css_setting.ts +23 -0
  196. package/src/entities/user.test.ts +154 -0
  197. package/src/entities/user.ts +394 -0
  198. package/src/entities/user_company.test.ts +7 -0
  199. package/src/entities/user_company.ts +27 -0
  200. package/src/entities/variation.test.ts +7 -0
  201. package/src/entities/variation.ts +61 -0
  202. package/src/entities/variation_field.test.ts +76 -0
  203. package/src/entities/variation_field.ts +169 -0
  204. package/src/entities/variation_fields_option.test.ts +46 -0
  205. package/src/entities/variation_fields_option.ts +95 -0
  206. package/src/entities/variation_option.test.ts +7 -0
  207. package/src/entities/variation_option.ts +52 -0
  208. package/src/entities/variations_group.test.ts +7 -0
  209. package/src/entities/variations_group.ts +41 -0
  210. package/src/entity.ts +1002 -0
  211. package/src/merchi.test.ts +25 -0
  212. package/src/merchi.ts +379 -0
  213. package/src/request.test.ts +43 -0
  214. package/src/request.ts +124 -0
  215. package/src/test_util.ts +18 -0
  216. package/src/toasts.test.ts +38 -0
  217. package/src/toasts.ts +34 -0
  218. package/src/util/float.ts +12 -0
  219. package/src/util/query_string.test.ts +7 -0
  220. package/src/util/query_string.ts +11 -0
  221. package/src/util/validation.test.ts +16 -0
  222. package/src/util/validation.ts +2 -0
  223. package/src/uuid.test.ts +15 -0
  224. package/src/uuid.ts +8 -0
  225. package/tsconfig.json +23 -0
  226. package/webpack.config.cjs +27 -0
package/.babelrc ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "presets": [
3
+ ["@babel/preset-env", {"modules": false}],
4
+ "@babel/preset-react",
5
+ "@babel/preset-typescript"
6
+ ],
7
+ "plugins": [
8
+ ["@babel/plugin-proposal-decorators", { "legacy": true }],
9
+ ["@babel/plugin-transform-react-jsx", {
10
+ "runtime": "automatic"
11
+ }]
12
+ ]
13
+ }
package/.eslintrc.cjs ADDED
@@ -0,0 +1,43 @@
1
+ module.exports = {
2
+ 'parser': '@typescript-eslint/parser',
3
+ 'plugins': ['@typescript-eslint'],
4
+ 'env': {
5
+ 'browser': true,
6
+ 'es6': true,
7
+ 'jest': true
8
+ },
9
+ 'extends': ['eslint:recommended',
10
+ 'plugin:@typescript-eslint/eslint-recommended',
11
+ 'plugin:@typescript-eslint/recommended'],
12
+ 'globals': {
13
+ 'Atomics': 'readonly',
14
+ 'SharedArrayBuffer': 'readonly',
15
+ 'global': 'writable'
16
+ },
17
+ 'parserOptions': {
18
+ 'ecmaVersion': 2018,
19
+ 'sourceType': 'module'
20
+ },
21
+ 'rules': {
22
+ 'indent': 'off',
23
+ '@typescript-eslint/indent': ['error', 2],
24
+ '@typescript-eslint/explicit-function-return-type': 'off',
25
+ '@typescript-eslint/no-explicit-any': 'off',
26
+ '@typescript-eslint/no-non-null-assertion': 'off',
27
+ '@typescript-eslint/no-empty-function': 'off',
28
+ '@typescript-eslint/no-this-alias': 'off',
29
+ '@typescript-eslint/ban-types': 'off',
30
+ 'linebreak-style': [
31
+ 'error',
32
+ 'unix'
33
+ ],
34
+ 'quotes': [
35
+ 'error',
36
+ 'single'
37
+ ],
38
+ 'semi': [
39
+ 'error',
40
+ 'always'
41
+ ]
42
+ }
43
+ };
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Merchi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,2 @@
1
+ # merchi_sdk_ts
2
+ Merchi SDK TS
package/jest.config.js ADDED
@@ -0,0 +1,17 @@
1
+ export default {
2
+ "roots": ["<rootDir>/src"],
3
+ "transform": {
4
+ "^.+\\.tsx?$": "ts-jest"
5
+ },
6
+ "testEnvironment": 'jsdom',
7
+ "collectCoverage": true,
8
+ "collectCoverageFrom": ["src/**"],
9
+ "coverageThreshold": {
10
+ "global": {
11
+ "branches": 100,
12
+ "functions": 100,
13
+ "lines": 100,
14
+ "statements": 100
15
+ }
16
+ }
17
+ }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "merchi_sdk_ts",
3
+ "version": "0.0.1",
4
+ "main": "src/index.js",
5
+ "type": "module",
6
+ "repository": "git@github.com:merchisdk/merchi_sdk_ts.git",
7
+ "author": "Daniel Collins <mail@dcollins.info>, James Campton <james@merchi.co>, Cheng Yu <s3341458@gmail.com>",
8
+ "license": "GPL-3.0",
9
+ "scripts": {
10
+ "build": "webpack",
11
+ "test": "jest --coverage"
12
+ },
13
+ "devDependencies": {
14
+ "@babel/cli": "^7.23.0",
15
+ "@babel/core": "^7.23.0",
16
+ "@babel/plugin-transform-react-jsx": "^7.22.15",
17
+ "@babel/plugin-transform-runtime": "^7.23.3",
18
+ "@babel/preset-env": "^7.23.3",
19
+ "@babel/preset-react": "^7.23.3",
20
+ "@babel/preset-typescript": "^7.23.3",
21
+ "@types/jest": "^28.0.0",
22
+ "@typescript-eslint/eslint-plugin": "^5.0.0",
23
+ "@typescript-eslint/parser": "^5.30.5",
24
+ "eslint": "^8.19.0",
25
+ "jest": "^28.0.0",
26
+ "ts-jest": "^28.0.0",
27
+ "typescript": "^4.3.0"
28
+ },
29
+ "dependencies": {
30
+ "@babel/plugin-proposal-decorators": "^7.23.9",
31
+ "@types/lodash": "^4.14.141",
32
+ "@types/moment-timezone": "^0.5.12",
33
+ "@types/node": "^16.0.0",
34
+ "browser-or-node": "2.1.1",
35
+ "jest-environment-jsdom": "^28.1.3",
36
+ "lodash": "^4.17.15",
37
+ "moment": "^2.24.0",
38
+ "moment-timezone": "^0.5.27",
39
+ "path": "^0.12.7",
40
+ "reflect-metadata": "^0.1.13",
41
+ "webpack": "^5.90.0",
42
+ "webpack-cli": "^5.1.4"
43
+ }
44
+ }
@@ -0,0 +1,6 @@
1
+ export enum AutoAssignProductionOnAction {
2
+ NOT_REQUIRED = 0,
3
+ ON_JOB_CREATION = 1,
4
+ ON_JOB_INVOICE_PAID = 2,
5
+ ON_JOB_DRAFT_APPROVED = 3,
6
+ }
@@ -0,0 +1,5 @@
1
+ import { CallToActions } from './call_to_actions';
2
+
3
+ test('seller type exists', () => {
4
+ expect(CallToActions.COMPLETE_COMPANY_PROFILE_AND_UPGRADE_SUBSCRIPTION_PLAN).toBe(0);
5
+ });
@@ -0,0 +1,14 @@
1
+ export enum CallToActions {
2
+ COMPLETE_COMPANY_PROFILE_AND_UPGRADE_SUBSCRIPTION_PLAN = 0,
3
+ COMPLETE_COMPANY_PROFILE = 1,
4
+ UPGRADE_SUBSCRIPTION_PLAN = 2,
5
+ COMPANY_ADD_PAYMENT_DETAILS_TO_UNLOCK_MORE_FEATURES = 3,
6
+ COMPANY_SUBSCRIPTION_OUTSTANDING = 4,
7
+ COMPANY_OWNERSHIP_NEEDS_CONFIRMATION = 5,
8
+ MOD_PRODUCT_READY_FOR_SALE = 6,
9
+ CREATE_STORE_FOR_SELLING = 7,
10
+ COMPANY_NEEDS_TO_ADD_PAYMENT_METHOD = 8,
11
+ YOUR_COMPANIES_NEED_STRIPE_TO_COLLECT_PAYMENT = 9,
12
+ SUPPLIER_PRODUCT_READY_FOR_SALE = 10,
13
+ SET_PASSWORD = 11,
14
+ }
@@ -0,0 +1,5 @@
1
+ import { DiscountType } from './discount_types';
2
+
3
+ test('discount type volumetric exists', () => {
4
+ expect(DiscountType.VOLUMETRIC).toBe(0);
5
+ });
@@ -0,0 +1,3 @@
1
+ export enum DiscountType {
2
+ VOLUMETRIC = 0,
3
+ }
@@ -0,0 +1,5 @@
1
+ import { DomainType } from './domain_types';
2
+
3
+ test('seller type exists', () => {
4
+ expect(DomainType.SELLER).toBe(1);
5
+ });
@@ -0,0 +1,12 @@
1
+ export enum DomainType {
2
+ UNRESTRICTED = 0,
3
+ SELLER = 1,
4
+ SELLER_PLUS = 2,
5
+ SUPPLIER = 3,
6
+ RESTRICTED_SUPPLIER = 4,
7
+ DOMAIN_SUPPLIER = 5,
8
+ DOMAIN_CLIENT_CATALOGUE = 6,
9
+ DOMAIN_SHOPIFY_SELLER = 7,
10
+ UNRESTRICTED_SHOPIFY_APP = 8,
11
+ RESERVED = 9,
12
+ }
@@ -0,0 +1,32 @@
1
+ export enum ErrorType {
2
+ UNKNOWN_ERROR = 0,
3
+ SERVER_ERROR = 1,
4
+ CLIENT_ERROR = 2,
5
+ EMAIL_ALREADY_EXISTS = 3,
6
+ SUPPLIER_NOT_ADDED_TO_PRODUCT = 4,
7
+ EMAIL_NOT_FOUND = 5,
8
+ INVALID_PHONE_NUMBER = 6,
9
+ INVALID_PASSWORD = 7,
10
+ RESOURCE_NOT_FOUND = 8,
11
+ RESOURCE_GONE = 9,
12
+ REQUEST_TOO_LARGE = 10,
13
+ UNKNOWN_DOMAIN = 11,
14
+ UNSUPPORTED_METHOD = 12,
15
+ MISSING_EVENT_TYPES = 13,
16
+ INVALID_EVENT_TYPES = 14,
17
+ MISSING_URI = 15,
18
+ MISSING_SID = 16,
19
+ MISSING_SECRET_KEY = 17,
20
+ MISSING_SUBSCRIPTION_TOKEN = 18,
21
+ WRONG_SECRET_KEY = 19,
22
+ DUPLICATE_SUBSCRIPTION_TOKEN = 20,
23
+ BAD_SMS_TOKEN = 21,
24
+ DOMAIN_NOT_FOUND = 22,
25
+ }
26
+
27
+ export function getErrorFromCode(code: number): ErrorType {
28
+ if (code in ErrorType) {
29
+ return code;
30
+ }
31
+ return ErrorType.UNKNOWN_ERROR;
32
+ }
@@ -0,0 +1,5 @@
1
+ import { EventType } from './event_types';
2
+
3
+ test('post event type exists', () => {
4
+ expect(EventType.POST).toBe(0);
5
+ });
@@ -0,0 +1,5 @@
1
+ export enum EventType {
2
+ POST = 0,
3
+ PATCH = 1,
4
+ DELETE = 1,
5
+ }
@@ -0,0 +1,5 @@
1
+ import { FieldType } from './field_types';
2
+
3
+ test('text input type exists', () => {
4
+ expect(FieldType.TEXT_INPUT).toBe(1);
5
+ });
@@ -0,0 +1,13 @@
1
+ export enum FieldType {
2
+ TEXT_INPUT = 1,
3
+ SELECT = 2,
4
+ FILE_UPLOAD = 3,
5
+ TEXT_AREA = 4,
6
+ NUMBER_INPUT = 5,
7
+ CHECKBOX = 6,
8
+ RADIO = 7,
9
+ FIELD_INSTRUCTIONS = 8,
10
+ IMAGE_SELECT = 9,
11
+ COLOUR_PICKER = 10,
12
+ COLOUR_SELECT = 11,
13
+ }
@@ -0,0 +1,5 @@
1
+ import { InputType } from './input_types';
2
+
3
+ test('text type exists', () => {
4
+ expect(InputType.TEXT).toBe(1);
5
+ });
@@ -0,0 +1,13 @@
1
+ export enum InputType {
2
+ TEXT = 1,
3
+ SELECT = 2,
4
+ FILE = 3,
5
+ TEXTAREA = 4,
6
+ NUMBER = 5,
7
+ CHECKBOX = 6,
8
+ RADIO = 7,
9
+ INSTRUCTIONS = 8,
10
+ IMAGE_SELECT = 9,
11
+ COLUR_PICKER = 10,
12
+ COLOUR_SELECT = 11,
13
+ }
@@ -0,0 +1,5 @@
1
+ import { InventoryStatus } from './inventory_statuses';
2
+
3
+ test('inventory deducted', () => {
4
+ expect(InventoryStatus.DEDUCTED).toBe(0);
5
+ });
@@ -0,0 +1,6 @@
1
+ export enum InventoryStatus {
2
+ DEDUCTED = 0,
3
+ CAN_DEDUCT = 1,
4
+ NOT_SUFFICIENT = 2,
5
+ NO_MATCHING_INVENTORY = 3
6
+ }
@@ -0,0 +1,5 @@
1
+ import { InoviceType } from './invoice_types';
2
+
3
+ test('invoice type exists', () => {
4
+ expect(InoviceType.ORDER).toBe(0);
5
+ });
@@ -0,0 +1,5 @@
1
+ export enum InoviceType {
2
+ ORDER = 0,
3
+ SUBSCRIPTION_BILL = 1,
4
+ AUTO_SUPPLY_BILL = 2,
5
+ }
@@ -0,0 +1,5 @@
1
+ import { ItemType } from './item_types';
2
+
3
+ test('custom type exists', () => {
4
+ expect(ItemType.CUSTOM).toBe(0);
5
+ });
@@ -0,0 +1,5 @@
1
+ export enum ItemType {
2
+ CUSTOM = 0,
3
+ SHIPPING = 1,
4
+ TAX = 2,
5
+ }
@@ -0,0 +1,5 @@
1
+ import { DraftingStatus } from './drafting_status';
2
+
3
+ test('init status exists', () => {
4
+ expect(DraftingStatus.INIT).toBe(0);
5
+ });
@@ -0,0 +1,7 @@
1
+ export enum DraftingStatus {
2
+ INIT = 0,
3
+ WAIT_DRAFTING = 1,
4
+ CHANGES_REQUESTED = 2,
5
+ DRAFTING_UPLOADED = 3,
6
+ DRAFTINGA_APPROVED = 4,
7
+ }
@@ -0,0 +1,5 @@
1
+ import { PaymentStatus } from './payment_status';
2
+
3
+ test('init status exists', () => {
4
+ expect(PaymentStatus.INIT).toBe(0);
5
+ });
@@ -0,0 +1,7 @@
1
+ export enum PaymentStatus {
2
+ INIT = 0,
3
+ ISSUED = 1,
4
+ OVERDUE = 2,
5
+ PARTIAL_PAID = 3,
6
+ FULLY_PAID = 4
7
+ }
@@ -0,0 +1,5 @@
1
+ import { ProductionStatus } from './production_status';
2
+
3
+ test('init status exists', () => {
4
+ expect(ProductionStatus.INIT).toBe(0);
5
+ });
@@ -0,0 +1,12 @@
1
+ export enum ProductionStatus {
2
+ INIT = 0,
3
+ REJECTED = 1,
4
+ QUOTING = 2,
5
+ ASSIGN_SENT = 3,
6
+ ASSIGN_DEADLINE_REACHED = 5,
7
+ QUESTIONING = 6,
8
+ COMMENCED = 7,
9
+ FINISHED = 8,
10
+ SHIPPED = 9,
11
+ COMPLETED = 10,
12
+ }
@@ -0,0 +1,5 @@
1
+ import { ShipmentStatus } from './shipment_status';
2
+
3
+ test('not assigned status exists', () => {
4
+ expect(ShipmentStatus.NOT_ASSIGNED).toBe(0);
5
+ });
@@ -0,0 +1,11 @@
1
+ export enum ShipmentStatus {
2
+ NOT_ASSIGNED = 0,
3
+ ASSIGNED = 1,
4
+ DISPATCH_SET = 2,
5
+ DISPATCH_WARNING = 3,
6
+ DISPATCH_LATE = 4,
7
+ DISPATCHED = 5,
8
+ EXPECTED_RECEIVE_DATE_WARNING = 6,
9
+ EXPECTED_RECEIVE_DATE_PAST = 7,
10
+ RECEIVED = 8
11
+ }
@@ -0,0 +1,5 @@
1
+ import { SupplyChainRequestStatus } from './supply_chain_request_status';
2
+
3
+ test('not supply chain status exists', () => {
4
+ expect(SupplyChainRequestStatus.NO_REQUEST).toBe(0);
5
+ });
@@ -0,0 +1,6 @@
1
+ export enum SupplyChainRequestStatus {
2
+ NO_REQUEST = 0,
3
+ REQUESTED = 1,
4
+ DECLINED = 2,
5
+ ACCEPTED = 3,
6
+ }
@@ -0,0 +1,5 @@
1
+ import { JobPriority } from './job_priorities';
2
+
3
+ test('urgent priority exists', () => {
4
+ expect(JobPriority.URGENT).toBe(1);
5
+ });
@@ -0,0 +1,6 @@
1
+ export enum JobPriority {
2
+ URGENT = 1,
3
+ HIGH = 2,
4
+ MEDIUM = 3,
5
+ LOW = 4,
6
+ }
@@ -0,0 +1,5 @@
1
+ import { DraftingStatus } from './job_status';
2
+
3
+ test('init drafting status exists', () => {
4
+ expect(DraftingStatus.INIT).toBe(0);
5
+ });
@@ -0,0 +1,49 @@
1
+ export enum DraftingStatus {
2
+ INIT = 0,
3
+ WAIT_DRAFTING = 1,
4
+ CHANGES_REQUESTED = 2,
5
+ DRAFTING_UPLOADED = 3,
6
+ DRAFTING_APPROVED = 4,
7
+ }
8
+
9
+ export enum PaymentStatus {
10
+ INIT = 0,
11
+ ISSUED = 1,
12
+ OVERDUE = 2,
13
+ PARTIAL_PAID = 3,
14
+ FULLY_PAID = 4,
15
+ }
16
+
17
+ export enum ProductionStatus {
18
+ INIT = 0,
19
+ REJECTED = 1,
20
+ QUOTING = 2,
21
+ ASSIGN_SENT = 3,
22
+ ASSIGN_DEADLINE_REACHED = 4,
23
+ ASSIGN_COMPLETE = 5,
24
+ QUESTIONING = 6,
25
+ COMMENCED = 7,
26
+ FINISHED = 8,
27
+ SHIPPED = 9,
28
+ COMPLETED = 10,
29
+ }
30
+
31
+ export enum ShipmentStatus {
32
+ NOT_ASSIGNED = 0,
33
+ ASSIGNED = 1,
34
+ DISPATCH_SET = 2,
35
+ DISPATCH_WARNING = 3,
36
+ DISPATCH_LATE = 4,
37
+ DISPATCHED = 5,
38
+ EXPECTED_RECEIVE_DATE_WARNING = 6,
39
+ EXPECTED_RECEIVE_DATE_PAST = 7,
40
+ RECEIVED = 8,
41
+ PICKED_UP = 9,
42
+ }
43
+
44
+ export enum SupplyChainRequestStatus {
45
+ NO_REQUEST = 0,
46
+ REQUESTED = 1,
47
+ DECLINED = 2,
48
+ ACCEPTED = 3,
49
+ }
@@ -0,0 +1,5 @@
1
+ import { JobType } from './job_types';
2
+
3
+ test('product types exists', () => {
4
+ expect(JobType.PRODUCT_CREATION_MOD).toBe(0);
5
+ });
@@ -0,0 +1,15 @@
1
+ export enum JobType {
2
+ PRODUCT_CREATION_MOD = 0, // SUPPLIER_MOD, CLONED_SUPPLIER_MOD
3
+ PRODUCT_CREATION = 1, // SUPPLIER, // CLONED_SUPPLIER
4
+ PRODUCT_RESELL_CREATION_MOD = 2, // SUPPLIER_RESELL_MOD, CLONED_SUPPLIER_RESELL_MOD
5
+ PRODUCT_RESELL_CREATION = 3, // SUPPLIER_RESELL, CLONED_SUPPLIER_RESELL
6
+ SELLER = 4, // SELLER, INVENTORY_SELLER, CLONED_INVENTORY_SELLER
7
+ SELLER_MOD = 5, // CLONED_SELLER_MOD
8
+ SELLER_GROUP_BUY = 6, // SELLER_GROUP_BUY, CLONED_SELLER_GROUP_BUY_INVENTORY
9
+ SELLER_FILE_DOWNLOAD = 7, // SELLER_FILE_DOWNLOAD
10
+ SUPPLIER_FULFILLMENT = 8, // PRODUCTION_MOD // SUPPLY_DOMAIN_REFERENCE
11
+ SUPPLIER_FULFILLMENT_RESELL = 9, // SUPPLIER_TO_SUPPLIER_RESELL_MOD
12
+ SUPPLIER_FULFILLMENT_INVENTORY = 10, // INVENTORY_SUPPLIER
13
+ SUPPLIER_FULFILLMENT_INVENTORY_GROUP_BUY = 11, // SUPPLIER_GROUP_BUY_INVENTORY
14
+ SUPPLY_CHAIN_CREATION = 12 // USED TO ID JOBS WHICH ARE TO CREATE A NEW SUPPLY CHAIN
15
+ }
@@ -0,0 +1,5 @@
1
+ import { NotificationSection } from './notification_sections';
2
+
3
+ test('system section exists', () => {
4
+ expect(NotificationSection.SYSTEM).toBe(0);
5
+ });
@@ -0,0 +1,13 @@
1
+ export enum NotificationSection {
2
+ SYSTEM = 0,
3
+ USER = 1,
4
+ JOB_INFO = 2,
5
+ JOB_DRAFTING = 3,
6
+ JOB_PRODUCTION = 4,
7
+ JOB_INVOICING = 5,
8
+ JOB_SHIPPING = 6,
9
+ INVOICE = 7,
10
+ JOB_NOTIFICATIONS = 8,
11
+ REMINDER = 9,
12
+ WEB_FORM = 10,
13
+ }
@@ -0,0 +1,5 @@
1
+ import { NotificationType } from './notification_types';
2
+
3
+ test('no_type notification type exists', () => {
4
+ expect(NotificationType.NO_TYPE).toBe(0);
5
+ });
@@ -0,0 +1,97 @@
1
+ export enum NotificationType {
2
+ NO_TYPE = 0,
3
+ DRAFT_SENT = 1,
4
+ DRAFT_CHANGE_REQUEST = 2,
5
+ DRAFT_APPROVED = 3,
6
+ DESIGNER_ASSIGNED = 4,
7
+ DESIGNER_CHANGED = 5,
8
+ DRAFT_COMMENT = 6,
9
+ JOB_PAID = 7,
10
+ INVOICE_PAID = 8,
11
+ PAYMENT_ACCEPTED = 9,
12
+ SEND_INVOICE = 10,
13
+ JOB_COMMENT = 11,
14
+ PRODUCTION_COMMENT = 12,
15
+ JOB_STALE = 13,
16
+ MANAGER_ASSIGNED = 14,
17
+ ORDER_RECEIVED = 15,
18
+ CLIENT_CHANGED = 16,
19
+ PRODUCTION_FILE_UPLOADED = 17,
20
+ PRODUCTION_CANCELLED = 18,
21
+ PRODUCTION_FINISHED = 19,
22
+ PRODUCTION_COMMENCED = 20,
23
+ QUOTE_APPROVED = 21,
24
+ QUOTE_REFUSED = 22,
25
+ QUOTE_SUBMITTED = 23,
26
+ QUOTE_FAILED = 24,
27
+ QUOTE_COMMENCED = 25,
28
+ QUOTE_EXPIRED = 26,
29
+ SUPPLIER_ASSIGNED = 27,
30
+ SUPPLIER_REFUSED = 28,
31
+ READY_FOR_SHIPPING = 29,
32
+ SHIPMENT_UPDATE = 30,
33
+ SIGN_UP_CONFIRMATION = 31,
34
+ AUTOMATIC_JOB_RESPONSE = 32,
35
+ CRASH_EVENT = 33,
36
+ MANAGER_SUMMARY = 34,
37
+ PASSWORD_RESET = 35,
38
+ MANAGER_REASSIGNED = 36,
39
+ EMAIL_RESPONSE = 37,
40
+ JOB_NOTIFICATION = 38,
41
+ JOB_REMINDER = 39,
42
+ GENERAL_REMINDER = 40,
43
+ INVOICE_EMAIL_RESPONSE = 41,
44
+ AUTOMATIC_INVOICE_RESPONSE = 42,
45
+ SHIPMENT_DISPATCH_CLOSE = 43,
46
+ SHIPMENT_NOT_DISPATCHED = 44,
47
+ SHIPMENT_EXPECTED_DATE_WARNING = 45,
48
+ JOB_ADDED_TO_SHIPMENT = 46,
49
+ JOB_REMOVED_FROM_SHIPMENT = 47,
50
+ ASSIGNMENT_REMOVED_FROM_SHIPMENT = 48,
51
+ ASSIGNMENT_ADDED_TO_SHIPMENT = 49,
52
+ SHIPMENT_EXPECTED_DATE_PAST = 50,
53
+ JOB_FILE_UPLOADED = 51,
54
+ DOMAIN_INVITATION = 52,
55
+ QUOTE_JOB_SUBMITTED = 53,
56
+ QUOTE_JOB_RECEIVED = 54,
57
+ QUOTE_JOB_UPDATED = 55,
58
+ QUOTE_JOB_SENT = 56,
59
+ QUOTE_JOB_APPROVED = 57,
60
+ QUOTE_JOB_APPROVED_SENT = 58,
61
+ JOB_NOTIFICATION_COMMENT = 59,
62
+ PRODUCTION_SHIPPED = 60,
63
+ SELLER_STORE_CREATED = 61,
64
+ WEB_FORM = 62,
65
+ CREATE_DOMAIN_FOR_MOD_PRODUCT = 63,
66
+ RESELL_REQUEST_SUBMITTED = 64,
67
+ RESELL_REQUEST_RECEIVED = 65,
68
+ MOD_PRODUCT_READY_FOR_SALE = 66,
69
+ ADDED_TO_COMPANY = 67,
70
+ PRODUCTION_COMPLETED = 68,
71
+ SUPPLIER_PRODUCT_READY_FOR_SALE = 69,
72
+ STORE_ASSIGNED_TO_YOU = 70,
73
+ CLIENT_STORE_CREATED = 71,
74
+ MOD_SELLER_SUMMARY = 72,
75
+ MOD_SUPPLIER_SUMMARY = 73,
76
+ PRODUCT_GROUP_BUY_CREATED_SELLER = 74,
77
+ PRODUCT_GROUP_BUY_CREATED_SUPPLIER = 75,
78
+ PRODUCT_GROUP_BUY_PROGRESS = 76,
79
+ PRODUCT_GROUP_BUY_MOQ_TARGET_REACHED = 77,
80
+ PRODUCT_GROUP_BUY_MOQ_TARGET_REACHED_BUYER = 78,
81
+ PRODUCT_GROUP_BUY_BUYER_PURCHASE = 79,
82
+ PRODUCT_GROUP_BUY_CANCELLED_SELLER = 80,
83
+ PRODUCT_GROUP_BUY_CANCELLED_SUPPLIER = 81,
84
+ PRODUCT_GROUP_BUY_CANCELLED_BUYER = 82,
85
+ PRODUCT_GROUP_BUY_FEATURE_DEADLINE_PASSED_SELLER = 83,
86
+ PRODUCT_GROUP_BUY_FEATURE_DEADLINE_PASSED_SUPPLIER = 84,
87
+ SUBSCRIPTION_INVOICE_AUTOPAY_FAILED = 85,
88
+ TRIAL_WELCOME = 86,
89
+ DOMAIN_USER_NEW_ADDED = 87,
90
+ DOMAIN_USER_EXISTING_ADDED = 88,
91
+ CLIENT_CATALOGUE_CREATED = 89,
92
+ SHOPIFY_PLUGIN_SIGN_UP = 90,
93
+ JOB_CLIENT_PRODUCTION_FILES_SENT = 91,
94
+ PRODUCT_RESELL_READY_FOR_SALE = 92,
95
+ PRODUCT_RESELL_CREATED = 93,
96
+ PRODUCT_SUPPLY_CHAIN_UPDATED = 94,
97
+ }
@@ -0,0 +1,5 @@
1
+ import { NotificationUrgency } from './notification_urgencies';
2
+
3
+ test('urgent notification urgency exists', () => {
4
+ expect(NotificationUrgency.URGENT).toBe(3);
5
+ });