@gofynd/fdk-client-javascript 1.4.15-beta.1 → 1.4.15-beta.10

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 (154) hide show
  1. package/README.md +2 -2
  2. package/application.d.ts +1 -2
  3. package/application.js +2 -3
  4. package/index.d.ts +1 -2
  5. package/index.js +7 -1
  6. package/package.json +2 -3
  7. package/sdk/application/ApplicationClient.js +0 -18
  8. package/sdk/application/Cart/CartApplicationClient.d.ts +55 -90
  9. package/sdk/application/Cart/CartApplicationClient.js +60 -1185
  10. package/sdk/application/Catalog/CatalogApplicationClient.d.ts +80 -142
  11. package/sdk/application/Catalog/CatalogApplicationClient.js +148 -1293
  12. package/sdk/application/Common/CommonApplicationClient.d.ts +4 -8
  13. package/sdk/application/Common/CommonApplicationClient.js +5 -89
  14. package/sdk/application/Communication/CommunicationApplicationClient.d.ts +6 -19
  15. package/sdk/application/Communication/CommunicationApplicationClient.js +6 -145
  16. package/sdk/application/Configuration/ConfigurationApplicationClient.d.ts +32 -73
  17. package/sdk/application/Configuration/ConfigurationApplicationClient.js +31 -718
  18. package/sdk/application/Content/ContentApplicationClient.d.ts +46 -78
  19. package/sdk/application/Content/ContentApplicationClient.js +77 -914
  20. package/sdk/application/FileStorage/FileStorageApplicationClient.d.ts +9 -12
  21. package/sdk/application/FileStorage/FileStorageApplicationClient.js +22 -125
  22. package/sdk/application/Lead/LeadApplicationClient.d.ts +10 -18
  23. package/sdk/application/Lead/LeadApplicationClient.js +32 -202
  24. package/sdk/application/Logistic/LogisticApplicationClient.d.ts +22 -39
  25. package/sdk/application/Logistic/LogisticApplicationClient.js +50 -478
  26. package/sdk/application/Order/OrderApplicationClient.d.ts +22 -42
  27. package/sdk/application/Order/OrderApplicationClient.js +86 -472
  28. package/sdk/application/Payment/PaymentApplicationClient.d.ts +92 -212
  29. package/sdk/application/Payment/PaymentApplicationClient.js +57 -2102
  30. package/sdk/application/Rewards/RewardsApplicationClient.d.ts +14 -28
  31. package/sdk/application/Rewards/RewardsApplicationClient.js +16 -305
  32. package/sdk/application/Share/ShareApplicationClient.d.ts +14 -24
  33. package/sdk/application/Share/ShareApplicationClient.js +34 -294
  34. package/sdk/application/Theme/ThemeApplicationClient.d.ts +8 -14
  35. package/sdk/application/Theme/ThemeApplicationClient.js +28 -162
  36. package/sdk/application/User/UserApplicationClient.d.ts +85 -136
  37. package/sdk/application/User/UserApplicationClient.js +45 -1815
  38. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +2 -5
  39. package/sdk/application/Webhook/WebhookApplicationClient.js +4 -47
  40. package/sdk/application/index.d.ts +0 -18
  41. package/sdk/application/index.js +0 -33
  42. package/sdk/common/Utility.d.ts +1 -1
  43. package/sdk/common/Utility.js +10 -7
  44. package/sdk/common/Validator.d.ts +1 -0
  45. package/sdk/common/Validator.js +20 -0
  46. package/sdk/common/utils.d.ts +0 -1
  47. package/sdk/common/utils.js +0 -14
  48. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +2 -0
  49. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +2 -0
  50. package/sdk/partner/OAuthClient.js +1 -0
  51. package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -40
  52. package/sdk/partner/Theme/ThemePartnerModel.js +2 -24
  53. package/sdk/platform/Cart/CartPlatformModel.d.ts +28 -0
  54. package/sdk/platform/Cart/CartPlatformModel.js +12 -0
  55. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +0 -7
  56. package/sdk/platform/Catalog/CatalogPlatformModel.js +1 -4
  57. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +14 -0
  58. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +6 -0
  59. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.d.ts +3 -1
  60. package/sdk/platform/FileStorage/FileStoragePlatformApplicationClient.js +3 -0
  61. package/sdk/platform/FileStorage/FileStoragePlatformClient.d.ts +3 -1
  62. package/sdk/platform/FileStorage/FileStoragePlatformClient.js +3 -0
  63. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +16 -1
  64. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +20 -0
  65. package/sdk/platform/Order/OrderPlatformApplicationClient.d.ts +0 -10
  66. package/sdk/platform/Order/OrderPlatformApplicationClient.js +0 -92
  67. package/sdk/platform/Order/OrderPlatformApplicationValidator.d.ts +1 -28
  68. package/sdk/platform/Order/OrderPlatformApplicationValidator.js +0 -18
  69. package/sdk/platform/Order/OrderPlatformClient.d.ts +10 -0
  70. package/sdk/platform/Order/OrderPlatformClient.js +99 -0
  71. package/sdk/platform/Order/OrderPlatformModel.d.ts +7 -0
  72. package/sdk/platform/Order/OrderPlatformModel.js +3 -0
  73. package/sdk/platform/Order/OrderPlatformValidator.d.ts +33 -1
  74. package/sdk/platform/Order/OrderPlatformValidator.js +20 -0
  75. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
  76. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +4 -4
  77. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +56 -19
  78. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +42 -18
  79. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +3 -3
  80. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -2
  81. package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -40
  82. package/sdk/platform/Theme/ThemePlatformModel.js +2 -24
  83. package/sdk/public/Configuration/ConfigurationPublicClient.js +5 -2
  84. package/sdk/public/Content/ContentPublicClient.d.ts +1 -1
  85. package/sdk/public/Content/ContentPublicClient.js +14 -2
  86. package/sdk/public/Partner/PartnerPublicClient.d.ts +1 -1
  87. package/sdk/public/Partner/PartnerPublicClient.js +14 -2
  88. package/sdk/public/Webhook/WebhookPublicClient.js +5 -2
  89. package/sdk/application/Cart/CartApplicationModel.d.ts +0 -3994
  90. package/sdk/application/Cart/CartApplicationModel.js +0 -2497
  91. package/sdk/application/Cart/CartApplicationValidator.d.ts +0 -769
  92. package/sdk/application/Cart/CartApplicationValidator.js +0 -530
  93. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +0 -3857
  94. package/sdk/application/Catalog/CatalogApplicationModel.js +0 -2629
  95. package/sdk/application/Catalog/CatalogApplicationValidator.d.ts +0 -791
  96. package/sdk/application/Catalog/CatalogApplicationValidator.js +0 -551
  97. package/sdk/application/Common/CommonApplicationModel.d.ts +0 -449
  98. package/sdk/application/Common/CommonApplicationModel.js +0 -308
  99. package/sdk/application/Common/CommonApplicationValidator.d.ts +0 -46
  100. package/sdk/application/Common/CommonApplicationValidator.js +0 -38
  101. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +0 -293
  102. package/sdk/application/Communication/CommunicationApplicationModel.js +0 -201
  103. package/sdk/application/Communication/CommunicationApplicationValidator.d.ts +0 -29
  104. package/sdk/application/Communication/CommunicationApplicationValidator.js +0 -38
  105. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +0 -2556
  106. package/sdk/application/Configuration/ConfigurationApplicationModel.js +0 -1887
  107. package/sdk/application/Configuration/ConfigurationApplicationValidator.d.ts +0 -179
  108. package/sdk/application/Configuration/ConfigurationApplicationValidator.js +0 -176
  109. package/sdk/application/Content/ContentApplicationModel.d.ts +0 -2133
  110. package/sdk/application/Content/ContentApplicationModel.js +0 -1589
  111. package/sdk/application/Content/ContentApplicationValidator.d.ts +0 -284
  112. package/sdk/application/Content/ContentApplicationValidator.js +0 -264
  113. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +0 -272
  114. package/sdk/application/FileStorage/FileStorageApplicationModel.js +0 -190
  115. package/sdk/application/FileStorage/FileStorageApplicationValidator.d.ts +0 -56
  116. package/sdk/application/FileStorage/FileStorageApplicationValidator.js +0 -53
  117. package/sdk/application/Lead/LeadApplicationModel.d.ts +0 -590
  118. package/sdk/application/Lead/LeadApplicationModel.js +0 -480
  119. package/sdk/application/Lead/LeadApplicationValidator.d.ts +0 -68
  120. package/sdk/application/Lead/LeadApplicationValidator.js +0 -71
  121. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +0 -1675
  122. package/sdk/application/Logistic/LogisticApplicationModel.js +0 -1121
  123. package/sdk/application/Logistic/LogisticApplicationValidator.d.ts +0 -254
  124. package/sdk/application/Logistic/LogisticApplicationValidator.js +0 -190
  125. package/sdk/application/Order/OrderApplicationModel.d.ts +0 -2296
  126. package/sdk/application/Order/OrderApplicationModel.js +0 -1471
  127. package/sdk/application/Order/OrderApplicationValidator.d.ts +0 -265
  128. package/sdk/application/Order/OrderApplicationValidator.js +0 -197
  129. package/sdk/application/Payment/PaymentApplicationModel.d.ts +0 -4058
  130. package/sdk/application/Payment/PaymentApplicationModel.js +0 -2630
  131. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +0 -576
  132. package/sdk/application/Payment/PaymentApplicationValidator.js +0 -594
  133. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +0 -365
  134. package/sdk/application/Rewards/RewardsApplicationModel.js +0 -396
  135. package/sdk/application/Rewards/RewardsApplicationValidator.d.ts +0 -73
  136. package/sdk/application/Rewards/RewardsApplicationValidator.js +0 -84
  137. package/sdk/application/Share/ShareApplicationModel.d.ts +0 -339
  138. package/sdk/application/Share/ShareApplicationModel.js +0 -234
  139. package/sdk/application/Share/ShareApplicationValidator.d.ts +0 -90
  140. package/sdk/application/Share/ShareApplicationValidator.js +0 -91
  141. package/sdk/application/Theme/ThemeApplicationModel.d.ts +0 -1713
  142. package/sdk/application/Theme/ThemeApplicationModel.js +0 -1426
  143. package/sdk/application/Theme/ThemeApplicationValidator.d.ts +0 -66
  144. package/sdk/application/Theme/ThemeApplicationValidator.js +0 -58
  145. package/sdk/application/User/UserApplicationModel.d.ts +0 -1943
  146. package/sdk/application/User/UserApplicationModel.js +0 -1382
  147. package/sdk/application/User/UserApplicationValidator.d.ts +0 -560
  148. package/sdk/application/User/UserApplicationValidator.js +0 -573
  149. package/sdk/application/Webhook/WebhookApplicationModel.d.ts +0 -52
  150. package/sdk/application/Webhook/WebhookApplicationModel.js +0 -46
  151. package/sdk/application/Webhook/WebhookApplicationValidator.d.ts +0 -16
  152. package/sdk/application/Webhook/WebhookApplicationValidator.js +0 -19
  153. package/sdk/common/Clickstream.d.ts +0 -1
  154. package/sdk/common/Clickstream.js +0 -464
@@ -1,1121 +0,0 @@
1
- const Joi = require("joi");
2
-
3
- /**
4
- * @typedef GetStoreResponse
5
- * @property {StoreItemResponse[]} [items] - List of locations, each containing
6
- * detailed information about individual location.
7
- * @property {Page} [page]
8
- */
9
-
10
- /**
11
- * @typedef StoreItemResponse
12
- * @property {number} [id] - A unique identifier for the location.
13
- * @property {string} [store_type] - The type of store, indicating the nature of
14
- * the store, such as retail or warehouse.
15
- * @property {string} [fulfillment_type] - The method of fulfillment used by the
16
- * store, such as shipping, pickup, or delivery.
17
- * @property {number} [processing_time] - The average time taken by the store to
18
- * process orders, measured in minutes.
19
- * @property {string[]} [tags] - List of tags associated with the store for
20
- * categorization and search purposes.
21
- * @property {number} [company_id] - The unique identifier of the company that
22
- * owns the store.
23
- * @property {number} [latitude] - The geographical latitude coordinate of the
24
- * store location.
25
- * @property {number} [longitude] - The geographical longitude coordinate of the
26
- * store location.
27
- */
28
-
29
- /**
30
- * @typedef ValidateAddressRequest
31
- * @property {string} [address] - Complete address, combining address line 1,
32
- * address line 2, area, landmark, sector, city, state, and pincode.
33
- * @property {string} [address1] - First line of the address, typically
34
- * containing street or building information.
35
- * @property {string} [address2] - Second line of the address, which can be used
36
- * for additional address details if needed.
37
- * @property {string} [area] - Locality or area associated with the address.
38
- * @property {string} [landmark] - Prominent nearby landmark that aids in
39
- * locating the address.
40
- * @property {string} [pincode] - Postal code or PIN code of the address area.
41
- * @property {string} [sector] - Specifies the sector or district of the address
42
- * if applicable.
43
- * @property {string} [city] - Denote the city or municipality of the address.
44
- * @property {string} [state] - Indicates the state or province of the address.
45
- * @property {string} [name] - Recipient's name associated with the address.
46
- * @property {string} [phone] - Recipient's contact phone number.
47
- * @property {string} [email] - Recipient's email address.
48
- */
49
-
50
- /**
51
- * @typedef PincodeParentsResponse
52
- * @property {string} [sub_type] - Specific type of locality hierarchy the
53
- * pincode belongs to (e.g., city, state, country).
54
- * @property {string} [display_name] - User-friendly version of the geographical
55
- * data, which may be more descriptive or formatted differently.
56
- * @property {string} [name] - The actual geographical data, such as country
57
- * names (India), state names (Maharashtra), pin codes (400603), city names
58
- * (Dubai), or local sectors (Deira).
59
- * @property {string} [uid] - Unique identifier for the locality.
60
- */
61
-
62
- /**
63
- * @typedef PincodeMetaResponse
64
- * @property {string} [zone] - Geographical region to which the pincode belongs,
65
- * often used to categorize or group pincodes for regional management or
66
- * postal purposes.
67
- * @property {number} [internal_zone_id] - A unique identifier used within the
68
- * system to track or reference the specific zone associated with the pincode.
69
- */
70
-
71
- /**
72
- * @typedef PincodeErrorSchemaResponse
73
- * @property {string} [message] - A user-readable description of the error,
74
- * explaining what went wrong.
75
- * @property {string} [value] - A specific code or identifier related to the
76
- * error, used for referencing or categorizing the error.
77
- * @property {string} [type] - The classification of the error, indicating the
78
- * kind of issue.
79
- */
80
-
81
- /**
82
- * @typedef CountryMetaResponse
83
- * @property {string} [country_code] - The ISO 3166-1 alpha-2 code representing
84
- * the country (e.g., "IN" for India, "US" for the United States).
85
- * @property {string} [isd_code] - The International Subscriber Dialing (ISD)
86
- * code, also known as the country dialing code, used for making international
87
- * phone calls to the country (e.g., "+91" for India, "+1" for the United States).
88
- */
89
-
90
- /**
91
- * @typedef PincodeLatLongData
92
- * @property {string} [type] - Specifies the type of geographical feature or
93
- * data, typically "Point" for coordinates in geographic data systems.
94
- * @property {string[]} [coordinates] - Contains the latitude and longitude
95
- * values representing the precise location. The format is usually an array
96
- * with two values: [longitude, latitude].
97
- */
98
-
99
- /**
100
- * @typedef PincodeDataResponse
101
- * @property {PincodeParentsResponse[]} [parents] - List of object representing
102
- * a collection of geographical locations, each associated with specific
103
- * hierarchical data such as cities, states, or countries.
104
- * @property {PincodeMetaResponse} [meta]
105
- * @property {string} [display_name] - User-friendly version of the geographical
106
- * data, which may be more descriptive or formatted differently.
107
- * @property {PincodeErrorSchemaResponse} error
108
- * @property {CountryMetaResponse} [meta_code]
109
- * @property {PincodeLatLongData} [lat_long]
110
- * @property {string} [sub_type] - Indicates the specific type of locality
111
- * hierarchy the pincode belongs to (e.g., city, state, country).
112
- * @property {string} [name] - The actual geographical data, such as country
113
- * names (India), state names (Maharashtra), pin codes (400603), city names
114
- * (Dubai), or local sectors (Deira).
115
- * @property {string} [uid] - This field stands for "Unique Identifier," a
116
- * unique value assigned to each instance to ensure differentiation and reference.
117
- */
118
-
119
- /**
120
- * @typedef PincodeApiResponse
121
- * @property {boolean} success - Indicates whether the API request was
122
- * successful (true) or failed (false).
123
- * @property {PincodeDataResponse[]} [data] - Contains the actual response data
124
- * when the request is successful, providing details like pincode information
125
- * or related data.
126
- * @property {PincodeErrorSchemaResponse} error
127
- */
128
-
129
- /**
130
- * @typedef TATCategoryRequest
131
- * @property {string} [level] - Specifies the hierarchical level of the category
132
- * (e.g., country, state, city).
133
- * @property {number} [id] - Represents the unique identifier for the category
134
- * at the specified level.
135
- */
136
-
137
- /**
138
- * @typedef TATArticlesRequest
139
- * @property {TATCategoryRequest} [category]
140
- * @property {string} [manufacturing_time_unit] - The unit of measurement for
141
- * the manufacturing time, such as hours or days.
142
- * @property {number} [manufacturing_time] - The amount of time required to
143
- * manufacture the article, specified in the unit given by `manufacturing_time_unit`.
144
- */
145
-
146
- /**
147
- * @typedef TATLocationDetailsRequest
148
- * @property {number} [fulfillment_id] - A unique identifier of the fulfilling location.
149
- * @property {string} [from_pincode] - The postal code of the location from
150
- * which the fulfillment originates.
151
- * @property {TATArticlesRequest[]} [articles] - List of articles included in
152
- * the fulfillment request, which provides details about the items to be
153
- * processed or shipped.
154
- */
155
-
156
- /**
157
- * @typedef TATViewRequest
158
- * @property {string} [to_pincode] - The postal code of the destination location
159
- * where the fulfillment or shipment is headed.
160
- * @property {string} [source] - The origin or source of the request, indicating
161
- * where the data or action is coming from.
162
- * @property {string} [action] - The specific operation or request being made,
163
- * such as viewing, updating, or managing data.
164
- * @property {string} [identifier] - A unique ID used to reference or track the
165
- * specific request or item within the system.
166
- * @property {TATLocationDetailsRequest[]} [location_details] - Locations
167
- * involved in the request, including details about both the source and destination.
168
- * @property {string} [journey] - Indicates the direction of the request or
169
- * shipment. It can either be "forward" (from the source to the destination)
170
- * or "return" (from the destination back to the source).
171
- */
172
-
173
- /**
174
- * @typedef TATErrorSchemaResponse
175
- * @property {string} [message] - A user-readable description of the error,
176
- * explaining what went wrong.
177
- * @property {string} [value] - A specific code or identifier related to the
178
- * error, used for referencing or categorizing the error.
179
- * @property {string} [type] - The classification of the error, indicating the
180
- * kind of issue.
181
- */
182
-
183
- /**
184
- * @typedef TATTimestampResponse
185
- * @property {number} [min] - The earliest possible timestamp.
186
- * @property {number} [max] - The latest possible timestamp.
187
- */
188
-
189
- /**
190
- * @typedef TATFormattedResponse
191
- * @property {string} [min] - The earliest possible timestamp.
192
- * @property {string} [max] - The latest possible timestamp.
193
- */
194
-
195
- /**
196
- * @typedef TATPromiseResponse
197
- * @property {TATTimestampResponse} [timestamp]
198
- * @property {TATFormattedResponse} [formatted]
199
- */
200
-
201
- /**
202
- * @typedef TATArticlesResponse
203
- * @property {string} [manufacturing_time_unit] - The unit of measurement for
204
- * the manufacturing time such as hours or days.
205
- * @property {TATErrorSchemaResponse} [error]
206
- * @property {boolean} [is_cod_available] - Indicates whether Cash on Delivery
207
- * (COD) is available for the articles.
208
- * @property {TATPromiseResponse} [promise]
209
- * @property {number} [manufacturing_time] - The time required to manufacture
210
- * the articles, measured in the unit specified by manufacturing_time_unit.
211
- * @property {TATCategoryRequest} [category]
212
- * @property {number} [_manufacturing_time_seconds] - The manufacturing time
213
- * converted into seconds.
214
- */
215
-
216
- /**
217
- * @typedef TATLocationDetailsResponse
218
- * @property {number} [fulfillment_id] - A unique identifier of the fulfilling location.
219
- * @property {string} [from_pincode] - The postal code of the location from
220
- * which the fulfillment originates.
221
- * @property {TATArticlesResponse[]} [articles] - List of articles included in
222
- * the fulfillment request, which provides details about the items to be
223
- * processed or shipped.
224
- */
225
-
226
- /**
227
- * @typedef TATViewResponse
228
- * @property {string} [to_pincode] - The postal code of the destination location
229
- * where the fulfillment or shipment is headed.
230
- * @property {string} [request_uuid] - A unique identifier for the request.
231
- * @property {string} [payment_mode] - The mode of payment used for the transaction.
232
- * @property {boolean} [success] - Whether the request was successful (true/false).
233
- * @property {TATErrorSchemaResponse} [error]
234
- * @property {boolean} [is_cod_available] - Whether Cash on Delivery (COD) is
235
- * available for the request.
236
- * @property {string} [source] - The origin or source of the request.
237
- * @property {string} [action] - The action performed or requested (e.g.,
238
- * forward, return).
239
- * @property {string} [stormbreaker_uuid] - A unique identifier related to the
240
- * stormbreaker process.
241
- * @property {string} [to_city] - The city corresponding to the destination pincode.
242
- * @property {string} [identifier] - A unique identifier for the request or transaction.
243
- * @property {TATLocationDetailsResponse[]} [location_details] - Location
244
- * involved in the request.
245
- * @property {string} [journey] - Type of journey, either forward or return.
246
- */
247
-
248
- /**
249
- * @typedef DP
250
- * @property {number} fm_priority - First Mile Priority; focuses on the initial
251
- * segment of the logistics process, from the point of origin to the first
252
- * distribution center.
253
- * @property {number} lm_priority - Last Mile Priority; deals with the final
254
- * stage of the delivery process, where goods are delivered from the
255
- * distribution center to the final destination.
256
- * @property {number} rvp_priority - Reverse Pickup Priority; pertains to the
257
- * process of collecting goods from the customer for return or exchange.
258
- * @property {string} payment_mode - The method of payment used for
259
- * transactions, such as credit card, debit card, cash on delivery, etc.
260
- * @property {string[]} operations - Refers to the various activities and
261
- * processes involved in managing and executing the delivery and logistics operations.
262
- * @property {string} [area_code] - A code that identifies a specific geographic
263
- * area, often used for sorting and routing deliveries.
264
- * @property {boolean} [assign_dp_from_sb] - Indicates whether the delivery
265
- * partner (DP) is assigned from stormbreaker service.
266
- * @property {string} [internal_account_id] - An identifier used internally to
267
- * track accounts or entities within the organization's system.
268
- * @property {string} [external_account_id] - An identifier used to reference
269
- * accounts or entities outside the organization's system, such as partner accounts.
270
- * @property {string} [transport_mode] - The method of transportation used for
271
- * delivering goods, such as road, rail, air, or sea.
272
- */
273
-
274
- /**
275
- * @typedef LogisticsResponse
276
- * @property {Object} [dp] - Provide entity responsible for handling the
277
- * delivery of goods.
278
- */
279
-
280
- /**
281
- * @typedef CountryEntityResponse
282
- * @property {CountryMetaResponse} [meta]
283
- * @property {LogisticsResponse} [logistics]
284
- * @property {string} [display_name] - User-friendly version of the geographical
285
- * data, which may be more descriptive or formatted differently.
286
- * @property {string} [type] - Specifies the type of geographical feature or
287
- * data, typically "Point" for coordinates in geographic data systems.
288
- * @property {boolean} [is_active] - Whether the country entity is currently
289
- * active or not.
290
- * @property {string} [parent_id] - Identifier for the parent of the current locality.
291
- * @property {string} [sub_type] - Specific type of locality hierarchy the
292
- * pincode belongs to (e.g., city, state, country).
293
- * @property {string} [name] - Country name.
294
- * @property {string} [uid] - Unique identifier for the country.
295
- */
296
-
297
- /**
298
- * @typedef CountryListResponse
299
- * @property {CountryEntityResponse[]} [results] - A list of country entities,
300
- * each containing details about individual countries.
301
- */
302
-
303
- /**
304
- * @typedef GetZoneFromPincodeViewRequest
305
- * @property {string} pincode - The postal code or ZIP code used to pinpoint a
306
- * specific geographic area or location.
307
- * @property {string} country - The country where the pincode is located.
308
- */
309
-
310
- /**
311
- * @typedef GetZoneFromPincodeViewResponse
312
- * @property {string} serviceability_type - Specifies the type of serviceability
313
- * for the given pincode, indicating whether it's deliverable or serviceable
314
- * under certain conditions.
315
- * @property {string[]} zones - Lists the zones associated with the pincode,
316
- * detailing the geographical or logistical zones for service.
317
- */
318
-
319
- /**
320
- * @typedef ReAssignStoreRequest
321
- * @property {Object} configuration - Specifies the configuration settings or
322
- * parameters for the store reassignment.
323
- * @property {string} to_pincode - The postal code of the destination location
324
- * where the fulfillment or shipment is headed.
325
- * @property {number[]} ignored_locations - Locations that should be excluded
326
- * from the reassignment process.
327
- * @property {string} identifier - A unique identifier for the reassignment request.
328
- * @property {Object[]} articles - List of articles or items involved in the
329
- * store reassignment.
330
- */
331
-
332
- /**
333
- * @typedef ReAssignStoreResponse
334
- * @property {string} to_pincode - The postal code of the destination location
335
- * where the fulfillment or shipment is headed.
336
- * @property {string} pystormbreaker_uuid - A unique identifier for tracking the
337
- * reassignment operation.
338
- * @property {boolean} success - Whether the reassignment was successful or not.
339
- * @property {Object} error - Details about any errors encountered during the
340
- * reassignment.
341
- * @property {Object[]} [assigned_stores] - List of stores that have been
342
- * successfully reassigned.
343
- */
344
-
345
- /**
346
- * @typedef CountryHierarchy
347
- * @property {string} [name] - It represent a country name.
348
- * @property {string} [slug] - A URL-friendly version of the name, often used
349
- * for referencing or querying purposes.
350
- */
351
-
352
- /**
353
- * @typedef CurrencyObject
354
- * @property {string} [code] - The currency code, typically a three-letter ISO
355
- * code (e.g., "USD" for US Dollar).
356
- * @property {string} [name] - It represent a country name.
357
- * @property {string} [symbol] - The symbol used to represent the currency
358
- * (e.g., "$" for US Dollar).
359
- */
360
-
361
- /**
362
- * @typedef CountryObject
363
- * @property {string} [id] - Unique identifier for the country.
364
- * @property {string} [name] - It represent a country name.
365
- * @property {string} [display_name] - User-friendly version of the geographical
366
- * data, which may be more descriptive or formatted differently.
367
- * @property {string} [iso2] - Two-letter ISO code representing the country.
368
- * @property {string} [iso3] - Three-letter ISO code representing the country.
369
- * @property {string[]} [timezones] - List of time zones used in the country
370
- * (e.g., ["America/New_York", "America/Los_Angeles"]).
371
- * @property {CountryHierarchy[]} [hierarchy] - Levels within the country (e.g.,
372
- * states, cities) and their slugs (e.g., [{"name": "State", "slug": "state"},
373
- * {"name": "City", "slug": "city"}]).
374
- * @property {string} [phone_code] - International dialing code for the country
375
- * (e.g., "+1").
376
- * @property {string} [latitude] - Geographical latitude of the country (e.g., "37.0902").
377
- * @property {string} [longitude] - Geographical longitude of the country (e.g.,
378
- * "-95.7129").
379
- * @property {CurrencyObject} [currency]
380
- * @property {string} [type] - Indicates the type of object (e.g., "country").
381
- */
382
-
383
- /**
384
- * @typedef GetCountries
385
- * @property {CountryObject[]} [items] - List of countries, each containing
386
- * detailed information about individual country.
387
- * @property {Page} [page]
388
- */
389
-
390
- /**
391
- * @typedef GetOneOrAllPath
392
- * @property {string} [locality_type] - Specifies the type of locality to be
393
- * retrieved, such as city, state, or pincode (e.g., "city", "state", "pincode").
394
- * @property {string} [locality_value] - The specific value of the locality
395
- * being queried, such as the name of the city or the pincode (e.g., "Mumbai",
396
- * "400093").
397
- */
398
-
399
- /**
400
- * @typedef GetOneOrAllQuery
401
- * @property {string} [country] - The name of the country to filter the results.
402
- * @property {string} [state] - The name of the state within the specified country.
403
- * @property {string} [city] - The name of the city within the specified state.
404
- * @property {string} [sector] - The name of the sector or area within the specified city.
405
- */
406
-
407
- /**
408
- * @typedef GetOneOrAllParams
409
- * @property {GetOneOrAllPath} [path]
410
- * @property {GetOneOrAllQuery} [query]
411
- */
412
-
413
- /**
414
- * @typedef GetOneOrAll
415
- * @property {string} [operation_id] - Identifier for the specific operation or
416
- * query being performed.
417
- * @property {GetOneOrAllParams} [params]
418
- */
419
-
420
- /**
421
- * @typedef LengthValidation
422
- * @property {number} [min] - The minimum number of characters or digits allowed.
423
- * @property {number} [max] - The maximum number of characters or digits allowed.
424
- */
425
-
426
- /**
427
- * @typedef FieldValidationRegex
428
- * @property {string} [value] - Regular expression pattern used to validate the field.
429
- * @property {LengthValidation} [length]
430
- */
431
-
432
- /**
433
- * @typedef FieldValidation
434
- * @property {string} [type] - Specifies the validation method, such as regex
435
- * for regular expression validation.
436
- * @property {FieldValidationRegex} [regex]
437
- */
438
-
439
- /**
440
- * @typedef GetCountryFieldsAddressValues
441
- * @property {GetOneOrAll} [get_one]
442
- * @property {GetOneOrAll} [get_all]
443
- */
444
-
445
- /**
446
- * @typedef GetCountryFieldsAddress
447
- * @property {string} display_name - User-friendly version of the geographical
448
- * data, which may be more descriptive or formatted differently.
449
- * @property {string} slug - URL-friendly version of the name, often used for
450
- * referencing or querying purposes.
451
- * @property {boolean} required - Indicates whether the field is mandatory for
452
- * the user to fill out.
453
- * @property {boolean} [edit] - Specifies if the field can be edited by the user.
454
- * @property {string} input - Defines the type of input control used for the
455
- * field (e.g., textbox).
456
- * @property {FieldValidation} [validation]
457
- * @property {GetCountryFieldsAddressValues} [values]
458
- * @property {string} [error_text] - The message shown to the user if the input
459
- * does not meet the validation criteria.
460
- */
461
-
462
- /**
463
- * @typedef GetCountryFieldsAddressTemplate
464
- * @property {string} checkout_form - The format used to display or collect
465
- * address information during checkout.
466
- * @property {string} store_os_form - The format used for address entry or
467
- * display in the store's operating system.
468
- * @property {string} default_display - The general format for displaying
469
- * address information.
470
- */
471
-
472
- /**
473
- * @typedef GetCountryFields
474
- * @property {GetCountryFieldsAddress[]} address - Specifies the fields and
475
- * attributes related to address information, including display names, input
476
- * types, and validation rules. This section defines the details needed for
477
- * address collection and formatting.
478
- * @property {string[]} serviceability_fields - Lists the specific address
479
- * fields used to determine whether a location is serviceable. These fields
480
- * are crucial for validating service coverage and availability.
481
- * @property {GetCountryFieldsAddressTemplate} address_template
482
- */
483
-
484
- /**
485
- * @typedef GetCountry
486
- * @property {string} [id] - Unique identifier for the country.
487
- * @property {string} [name] - It represent a country name.
488
- * @property {string} [display_name] - User-friendly version of the geographical
489
- * data, which may be more descriptive or formatted differently.
490
- * @property {string} [iso2] - Two-letter ISO code representing the country.
491
- * @property {string} [iso3] - Three-letter ISO code representing the country.
492
- * @property {string[]} [timezones] - List of time zones used in the country
493
- * (e.g., ["America/New_York", "America/Los_Angeles"]).
494
- * @property {CountryHierarchy[]} [hierarchy] - Levels within the country (e.g.,
495
- * states, cities) and their slugs (e.g., [{"name": "State", "slug": "state"},
496
- * {"name": "City", "slug": "city"}]).
497
- * @property {string} [phone_code] - International dialing code for the country
498
- * (e.g., "+1").
499
- * @property {string} [latitude] - Geographical latitude of the country (e.g., "37.0902").
500
- * @property {string} [longitude] - Geographical longitude of the country (e.g.,
501
- * "-95.7129").
502
- * @property {CurrencyObject} [currency]
503
- * @property {string} [type] - Indicates the type of object (e.g., "country").
504
- * @property {GetCountryFields} [fields]
505
- */
506
-
507
- /**
508
- * @typedef Page
509
- * @property {number} [item_total] - The total number of items on the page.
510
- * @property {string} [next_id] - The identifier for the next page.
511
- * @property {boolean} [has_previous] - Indicates whether there is a previous page.
512
- * @property {boolean} [has_next] - Indicates whether there is a next page.
513
- * @property {number} [current] - The current page number.
514
- * @property {string} type - The type of the page, such as 'PageType'.
515
- * @property {number} [size] - The number of items per page.
516
- */
517
-
518
- /**
519
- * @typedef Localities
520
- * @property {string} [id] - A unique identifier for the locality.
521
- * @property {string} [name] - The actual geographical data, such as country
522
- * names (India), state names (Maharashtra), pin codes (400603), city names
523
- * (Dubai), or local sectors (Deira).
524
- * @property {string} [display_name] - User-friendly version of the geographical
525
- * data, which may be more descriptive or formatted differently.
526
- * @property {string[]} [parent_ids] - Identifiers for the parent of the current locality.
527
- * @property {string} [type] - Specifies the category of the address component,
528
- * such as pincode, state, city, country, or sector.
529
- * @property {LocalityParent[]} [localities] - Representing the localities that
530
- * are associated with or contained within the current locality. It provides
531
- * detailed information about the parent localities, including their names,
532
- * identifiers, and hierarchical relationships.
533
- */
534
-
535
- /**
536
- * @typedef LocalityParent
537
- * @property {string} [id] - A unique identifier for the locality.
538
- * @property {string} [name] - The actual geographical data, such as country
539
- * names (India), state names (Maharashtra), pin codes (400603), city names
540
- * (Dubai), or local sectors (Deira).
541
- * @property {string} [display_name] - User-friendly version of the geographical
542
- * data, which may be more descriptive or formatted differently.
543
- * @property {string[]} [parent_ids] - Identifiers for the parent of the current locality.
544
- * @property {string} [type] - Specifies the category of the address component,
545
- * such as pincode, state, city, country, or sector.
546
- */
547
-
548
- /**
549
- * @typedef GetLocalities
550
- * @property {Localities[]} [items] - List of localities, each containing
551
- * detailed information about individual locality.
552
- * @property {Page} [page]
553
- */
554
-
555
- /**
556
- * @typedef GetLocality
557
- * @property {string} [id] - A unique identifier for the locality.
558
- * @property {string} [name] - The actual geographical data, such as country
559
- * names (India), state names (Maharashtra), pin codes (400603), city names
560
- * (Dubai), or local sectors (Deira).
561
- * @property {string} [display_name] - User-friendly version of the geographical
562
- * data, which may be more descriptive or formatted differently.
563
- * @property {string[]} [parent_ids] - Identifiers for the parent of the current locality.
564
- * @property {string} [type] - Specifies the category of the address component,
565
- * such as pincode, state, city, country, or sector.
566
- * @property {LocalityParent[]} [localities] - Representing the localities that
567
- * are associated with or contained within the current locality. It provides
568
- * detailed information about the parent localities, including their names,
569
- * identifiers, and hierarchical relationships.
570
- */
571
-
572
- /**
573
- * @typedef ErrorResponse
574
- * @property {string} [error] - Error code identifying the type of error.
575
- * @property {string} [message] - User-friendly explanation of what went wrong.
576
- */
577
-
578
- class LogisticApplicationModel {
579
- /** @returns {GetStoreResponse} */
580
- static GetStoreResponse() {
581
- return Joi.object({
582
- items: Joi.array().items(LogisticApplicationModel.StoreItemResponse()),
583
- page: LogisticApplicationModel.Page(),
584
- });
585
- }
586
-
587
- /** @returns {StoreItemResponse} */
588
- static StoreItemResponse() {
589
- return Joi.object({
590
- id: Joi.number(),
591
- store_type: Joi.string().allow(""),
592
- fulfillment_type: Joi.string().allow(""),
593
- processing_time: Joi.number(),
594
- tags: Joi.array().items(Joi.string().allow("")),
595
- company_id: Joi.number(),
596
- latitude: Joi.number(),
597
- longitude: Joi.number(),
598
- });
599
- }
600
-
601
- /** @returns {ValidateAddressRequest} */
602
- static ValidateAddressRequest() {
603
- return Joi.object({
604
- address: Joi.string().allow(""),
605
- address1: Joi.string().allow(""),
606
- address2: Joi.string().allow(""),
607
- area: Joi.string().allow(""),
608
- landmark: Joi.string().allow(""),
609
- pincode: Joi.string().allow(""),
610
- sector: Joi.string().allow(""),
611
- city: Joi.string().allow(""),
612
- state: Joi.string().allow(""),
613
- name: Joi.string().allow(""),
614
- phone: Joi.string().allow(""),
615
- email: Joi.string().allow(""),
616
- });
617
- }
618
-
619
- /** @returns {PincodeParentsResponse} */
620
- static PincodeParentsResponse() {
621
- return Joi.object({
622
- sub_type: Joi.string().allow(""),
623
- display_name: Joi.string().allow(""),
624
- name: Joi.string().allow(""),
625
- uid: Joi.string().allow(""),
626
- });
627
- }
628
-
629
- /** @returns {PincodeMetaResponse} */
630
- static PincodeMetaResponse() {
631
- return Joi.object({
632
- zone: Joi.string().allow(""),
633
- internal_zone_id: Joi.number(),
634
- });
635
- }
636
-
637
- /** @returns {PincodeErrorSchemaResponse} */
638
- static PincodeErrorSchemaResponse() {
639
- return Joi.object({
640
- message: Joi.string().allow("").allow(null),
641
- value: Joi.string().allow("").allow(null),
642
- type: Joi.string().allow("").allow(null),
643
- });
644
- }
645
-
646
- /** @returns {CountryMetaResponse} */
647
- static CountryMetaResponse() {
648
- return Joi.object({
649
- country_code: Joi.string().allow(""),
650
- isd_code: Joi.string().allow(""),
651
- });
652
- }
653
-
654
- /** @returns {PincodeLatLongData} */
655
- static PincodeLatLongData() {
656
- return Joi.object({
657
- type: Joi.string().allow(""),
658
- coordinates: Joi.array().items(Joi.string().allow("")),
659
- });
660
- }
661
-
662
- /** @returns {PincodeDataResponse} */
663
- static PincodeDataResponse() {
664
- return Joi.object({
665
- parents: Joi.array().items(
666
- LogisticApplicationModel.PincodeParentsResponse()
667
- ),
668
- meta: LogisticApplicationModel.PincodeMetaResponse(),
669
- display_name: Joi.string().allow(""),
670
- error: LogisticApplicationModel.PincodeErrorSchemaResponse().required(),
671
- meta_code: LogisticApplicationModel.CountryMetaResponse(),
672
- lat_long: LogisticApplicationModel.PincodeLatLongData(),
673
- sub_type: Joi.string().allow(""),
674
- name: Joi.string().allow(""),
675
- uid: Joi.string().allow(""),
676
- });
677
- }
678
-
679
- /** @returns {PincodeApiResponse} */
680
- static PincodeApiResponse() {
681
- return Joi.object({
682
- success: Joi.boolean().required(),
683
- data: Joi.array().items(LogisticApplicationModel.PincodeDataResponse()),
684
- error: LogisticApplicationModel.PincodeErrorSchemaResponse().required(),
685
- });
686
- }
687
-
688
- /** @returns {TATCategoryRequest} */
689
- static TATCategoryRequest() {
690
- return Joi.object({
691
- level: Joi.string().allow(""),
692
- id: Joi.number(),
693
- });
694
- }
695
-
696
- /** @returns {TATArticlesRequest} */
697
- static TATArticlesRequest() {
698
- return Joi.object({
699
- category: LogisticApplicationModel.TATCategoryRequest(),
700
- manufacturing_time_unit: Joi.string().allow(""),
701
- manufacturing_time: Joi.number(),
702
- });
703
- }
704
-
705
- /** @returns {TATLocationDetailsRequest} */
706
- static TATLocationDetailsRequest() {
707
- return Joi.object({
708
- fulfillment_id: Joi.number(),
709
- from_pincode: Joi.string().allow(""),
710
- articles: Joi.array().items(
711
- LogisticApplicationModel.TATArticlesRequest()
712
- ),
713
- });
714
- }
715
-
716
- /** @returns {TATViewRequest} */
717
- static TATViewRequest() {
718
- return Joi.object({
719
- to_pincode: Joi.string().allow(""),
720
- source: Joi.string().allow(""),
721
- action: Joi.string().allow(""),
722
- identifier: Joi.string().allow(""),
723
- location_details: Joi.array().items(
724
- LogisticApplicationModel.TATLocationDetailsRequest()
725
- ),
726
- journey: Joi.string().allow(""),
727
- });
728
- }
729
-
730
- /** @returns {TATErrorSchemaResponse} */
731
- static TATErrorSchemaResponse() {
732
- return Joi.object({
733
- message: Joi.string().allow("").allow(null),
734
- value: Joi.string().allow("").allow(null),
735
- type: Joi.string().allow("").allow(null),
736
- });
737
- }
738
-
739
- /** @returns {TATTimestampResponse} */
740
- static TATTimestampResponse() {
741
- return Joi.object({
742
- min: Joi.number(),
743
- max: Joi.number(),
744
- });
745
- }
746
-
747
- /** @returns {TATFormattedResponse} */
748
- static TATFormattedResponse() {
749
- return Joi.object({
750
- min: Joi.string().allow(""),
751
- max: Joi.string().allow(""),
752
- });
753
- }
754
-
755
- /** @returns {TATPromiseResponse} */
756
- static TATPromiseResponse() {
757
- return Joi.object({
758
- timestamp: LogisticApplicationModel.TATTimestampResponse(),
759
- formatted: LogisticApplicationModel.TATFormattedResponse(),
760
- });
761
- }
762
-
763
- /** @returns {TATArticlesResponse} */
764
- static TATArticlesResponse() {
765
- return Joi.object({
766
- manufacturing_time_unit: Joi.string().allow(""),
767
- error: LogisticApplicationModel.TATErrorSchemaResponse(),
768
- is_cod_available: Joi.boolean(),
769
- promise: LogisticApplicationModel.TATPromiseResponse(),
770
- manufacturing_time: Joi.number(),
771
- category: LogisticApplicationModel.TATCategoryRequest(),
772
- _manufacturing_time_seconds: Joi.number(),
773
- });
774
- }
775
-
776
- /** @returns {TATLocationDetailsResponse} */
777
- static TATLocationDetailsResponse() {
778
- return Joi.object({
779
- fulfillment_id: Joi.number(),
780
- from_pincode: Joi.string().allow(""),
781
- articles: Joi.array().items(
782
- LogisticApplicationModel.TATArticlesResponse()
783
- ),
784
- });
785
- }
786
-
787
- /** @returns {TATViewResponse} */
788
- static TATViewResponse() {
789
- return Joi.object({
790
- to_pincode: Joi.string().allow(""),
791
- request_uuid: Joi.string().allow(""),
792
- payment_mode: Joi.string().allow(""),
793
- success: Joi.boolean(),
794
- error: LogisticApplicationModel.TATErrorSchemaResponse(),
795
- is_cod_available: Joi.boolean(),
796
- source: Joi.string().allow(""),
797
- action: Joi.string().allow(""),
798
- stormbreaker_uuid: Joi.string().allow(""),
799
- to_city: Joi.string().allow(""),
800
- identifier: Joi.string().allow(""),
801
- location_details: Joi.array().items(
802
- LogisticApplicationModel.TATLocationDetailsResponse()
803
- ),
804
- journey: Joi.string().allow(""),
805
- });
806
- }
807
-
808
- /** @returns {DP} */
809
- static DP() {
810
- return Joi.object({
811
- fm_priority: Joi.number().required(),
812
- lm_priority: Joi.number().required(),
813
- rvp_priority: Joi.number().required(),
814
- payment_mode: Joi.string().allow("").required(),
815
- operations: Joi.array().items(Joi.string().allow("")).required(),
816
- area_code: Joi.string().allow("").allow(null),
817
- assign_dp_from_sb: Joi.boolean(),
818
- internal_account_id: Joi.string().allow(""),
819
- external_account_id: Joi.string().allow("").allow(null),
820
- transport_mode: Joi.string().allow(""),
821
- });
822
- }
823
-
824
- /** @returns {LogisticsResponse} */
825
- static LogisticsResponse() {
826
- return Joi.object({
827
- dp: Joi.object().pattern(/\S/, LogisticApplicationModel.DP()),
828
- });
829
- }
830
-
831
- /** @returns {CountryEntityResponse} */
832
- static CountryEntityResponse() {
833
- return Joi.object({
834
- meta: LogisticApplicationModel.CountryMetaResponse(),
835
- logistics: LogisticApplicationModel.LogisticsResponse(),
836
- display_name: Joi.string().allow(""),
837
- type: Joi.string().allow(""),
838
- is_active: Joi.boolean(),
839
- parent_id: Joi.string().allow(""),
840
- sub_type: Joi.string().allow(""),
841
- name: Joi.string().allow(""),
842
- uid: Joi.string().allow(""),
843
- });
844
- }
845
-
846
- /** @returns {CountryListResponse} */
847
- static CountryListResponse() {
848
- return Joi.object({
849
- results: Joi.array().items(
850
- LogisticApplicationModel.CountryEntityResponse()
851
- ),
852
- });
853
- }
854
-
855
- /** @returns {GetZoneFromPincodeViewRequest} */
856
- static GetZoneFromPincodeViewRequest() {
857
- return Joi.object({
858
- pincode: Joi.string().allow("").required(),
859
- country: Joi.string().allow("").required(),
860
- });
861
- }
862
-
863
- /** @returns {GetZoneFromPincodeViewResponse} */
864
- static GetZoneFromPincodeViewResponse() {
865
- return Joi.object({
866
- serviceability_type: Joi.string().allow("").required(),
867
- zones: Joi.array().items(Joi.string().allow("")).required(),
868
- });
869
- }
870
-
871
- /** @returns {ReAssignStoreRequest} */
872
- static ReAssignStoreRequest() {
873
- return Joi.object({
874
- configuration: Joi.any().required(),
875
- to_pincode: Joi.string().allow("").required(),
876
- ignored_locations: Joi.array().items(Joi.number()).required(),
877
- identifier: Joi.string().allow("").required(),
878
- articles: Joi.array().items(Joi.any()).required(),
879
- });
880
- }
881
-
882
- /** @returns {ReAssignStoreResponse} */
883
- static ReAssignStoreResponse() {
884
- return Joi.object({
885
- to_pincode: Joi.string().allow("").required(),
886
- pystormbreaker_uuid: Joi.string().allow("").required(),
887
- success: Joi.boolean().required(),
888
- error: Joi.any().required(),
889
- assigned_stores: Joi.array().items(Joi.any()),
890
- });
891
- }
892
-
893
- /** @returns {CountryHierarchy} */
894
- static CountryHierarchy() {
895
- return Joi.object({
896
- name: Joi.string().allow(""),
897
- slug: Joi.string().allow(""),
898
- });
899
- }
900
-
901
- /** @returns {CurrencyObject} */
902
- static CurrencyObject() {
903
- return Joi.object({
904
- code: Joi.string().allow(""),
905
- name: Joi.string().allow(""),
906
- symbol: Joi.string().allow(""),
907
- });
908
- }
909
-
910
- /** @returns {CountryObject} */
911
- static CountryObject() {
912
- return Joi.object({
913
- id: Joi.string().allow(""),
914
- name: Joi.string().allow(""),
915
- display_name: Joi.string().allow(""),
916
- iso2: Joi.string().allow(""),
917
- iso3: Joi.string().allow(""),
918
- timezones: Joi.array().items(Joi.string().allow("")).allow(null, ""),
919
- hierarchy: Joi.array().items(LogisticApplicationModel.CountryHierarchy()),
920
- phone_code: Joi.string().allow(""),
921
- latitude: Joi.string().allow(""),
922
- longitude: Joi.string().allow(""),
923
- currency: LogisticApplicationModel.CurrencyObject(),
924
- type: Joi.string().allow(""),
925
- });
926
- }
927
-
928
- /** @returns {GetCountries} */
929
- static GetCountries() {
930
- return Joi.object({
931
- items: Joi.array().items(LogisticApplicationModel.CountryObject()),
932
- page: LogisticApplicationModel.Page(),
933
- });
934
- }
935
-
936
- /** @returns {GetOneOrAllPath} */
937
- static GetOneOrAllPath() {
938
- return Joi.object({
939
- locality_type: Joi.string().allow(""),
940
- locality_value: Joi.string().allow(""),
941
- });
942
- }
943
-
944
- /** @returns {GetOneOrAllQuery} */
945
- static GetOneOrAllQuery() {
946
- return Joi.object({
947
- country: Joi.string().allow("").allow(null),
948
- state: Joi.string().allow("").allow(null),
949
- city: Joi.string().allow("").allow(null),
950
- sector: Joi.string().allow("").allow(null),
951
- });
952
- }
953
-
954
- /** @returns {GetOneOrAllParams} */
955
- static GetOneOrAllParams() {
956
- return Joi.object({
957
- path: LogisticApplicationModel.GetOneOrAllPath(),
958
- query: LogisticApplicationModel.GetOneOrAllQuery(),
959
- });
960
- }
961
-
962
- /** @returns {GetOneOrAll} */
963
- static GetOneOrAll() {
964
- return Joi.object({
965
- operation_id: Joi.string().allow(""),
966
- params: LogisticApplicationModel.GetOneOrAllParams(),
967
- }).allow(null);
968
- }
969
-
970
- /** @returns {LengthValidation} */
971
- static LengthValidation() {
972
- return Joi.object({
973
- min: Joi.number().allow(null),
974
- max: Joi.number().allow(null),
975
- });
976
- }
977
-
978
- /** @returns {FieldValidationRegex} */
979
- static FieldValidationRegex() {
980
- return Joi.object({
981
- value: Joi.string().allow(""),
982
- length: LogisticApplicationModel.LengthValidation(),
983
- });
984
- }
985
-
986
- /** @returns {FieldValidation} */
987
- static FieldValidation() {
988
- return Joi.object({
989
- type: Joi.string().allow(""),
990
- regex: LogisticApplicationModel.FieldValidationRegex(),
991
- }).allow(null);
992
- }
993
-
994
- /** @returns {GetCountryFieldsAddressValues} */
995
- static GetCountryFieldsAddressValues() {
996
- return Joi.object({
997
- get_one: LogisticApplicationModel.GetOneOrAll(),
998
- get_all: LogisticApplicationModel.GetOneOrAll(),
999
- }).allow(null);
1000
- }
1001
-
1002
- /** @returns {GetCountryFieldsAddress} */
1003
- static GetCountryFieldsAddress() {
1004
- return Joi.object({
1005
- display_name: Joi.string().allow("").required(),
1006
- slug: Joi.string().allow("").required(),
1007
- required: Joi.boolean().required(),
1008
- edit: Joi.boolean(),
1009
- input: Joi.string().allow("").required(),
1010
- validation: LogisticApplicationModel.FieldValidation(),
1011
- values: LogisticApplicationModel.GetCountryFieldsAddressValues(),
1012
- error_text: Joi.string().allow("").allow(null),
1013
- });
1014
- }
1015
-
1016
- /** @returns {GetCountryFieldsAddressTemplate} */
1017
- static GetCountryFieldsAddressTemplate() {
1018
- return Joi.object({
1019
- checkout_form: Joi.string().allow("").required(),
1020
- store_os_form: Joi.string().allow("").required(),
1021
- default_display: Joi.string().allow("").required(),
1022
- });
1023
- }
1024
-
1025
- /** @returns {GetCountryFields} */
1026
- static GetCountryFields() {
1027
- return Joi.object({
1028
- address: Joi.array()
1029
- .items(LogisticApplicationModel.GetCountryFieldsAddress())
1030
- .required(),
1031
- serviceability_fields: Joi.array()
1032
- .items(Joi.string().allow(""))
1033
- .required(),
1034
- address_template: LogisticApplicationModel.GetCountryFieldsAddressTemplate().required(),
1035
- });
1036
- }
1037
-
1038
- /** @returns {GetCountry} */
1039
- static GetCountry() {
1040
- return Joi.object({
1041
- id: Joi.string().allow(""),
1042
- name: Joi.string().allow(""),
1043
- display_name: Joi.string().allow(""),
1044
- iso2: Joi.string().allow(""),
1045
- iso3: Joi.string().allow(""),
1046
- timezones: Joi.array().items(Joi.string().allow("")).allow(null, ""),
1047
- hierarchy: Joi.array().items(LogisticApplicationModel.CountryHierarchy()),
1048
- phone_code: Joi.string().allow(""),
1049
- latitude: Joi.string().allow(""),
1050
- longitude: Joi.string().allow(""),
1051
- currency: LogisticApplicationModel.CurrencyObject(),
1052
- type: Joi.string().allow(""),
1053
- fields: LogisticApplicationModel.GetCountryFields(),
1054
- });
1055
- }
1056
-
1057
- /** @returns {Page} */
1058
- static Page() {
1059
- return Joi.object({
1060
- item_total: Joi.number(),
1061
- next_id: Joi.string().allow(""),
1062
- has_previous: Joi.boolean(),
1063
- has_next: Joi.boolean(),
1064
- current: Joi.number(),
1065
- type: Joi.string().allow("").required(),
1066
- size: Joi.number(),
1067
- });
1068
- }
1069
-
1070
- /** @returns {Localities} */
1071
- static Localities() {
1072
- return Joi.object({
1073
- id: Joi.string().allow(""),
1074
- name: Joi.string().allow(""),
1075
- display_name: Joi.string().allow(""),
1076
- parent_ids: Joi.array().items(Joi.string().allow("")),
1077
- type: Joi.string().allow(""),
1078
- localities: Joi.array().items(LogisticApplicationModel.LocalityParent()),
1079
- });
1080
- }
1081
-
1082
- /** @returns {LocalityParent} */
1083
- static LocalityParent() {
1084
- return Joi.object({
1085
- id: Joi.string().allow(""),
1086
- name: Joi.string().allow(""),
1087
- display_name: Joi.string().allow(""),
1088
- parent_ids: Joi.array().items(Joi.string().allow("")),
1089
- type: Joi.string().allow(""),
1090
- });
1091
- }
1092
-
1093
- /** @returns {GetLocalities} */
1094
- static GetLocalities() {
1095
- return Joi.object({
1096
- items: Joi.array().items(LogisticApplicationModel.Localities()),
1097
- page: LogisticApplicationModel.Page(),
1098
- });
1099
- }
1100
-
1101
- /** @returns {GetLocality} */
1102
- static GetLocality() {
1103
- return Joi.object({
1104
- id: Joi.string().allow(""),
1105
- name: Joi.string().allow(""),
1106
- display_name: Joi.string().allow(""),
1107
- parent_ids: Joi.array().items(Joi.string().allow("")),
1108
- type: Joi.string().allow(""),
1109
- localities: Joi.array().items(LogisticApplicationModel.LocalityParent()),
1110
- });
1111
- }
1112
-
1113
- /** @returns {ErrorResponse} */
1114
- static ErrorResponse() {
1115
- return Joi.object({
1116
- error: Joi.string().allow(""),
1117
- message: Joi.string().allow(""),
1118
- });
1119
- }
1120
- }
1121
- module.exports = LogisticApplicationModel;