@gofynd/fdk-client-javascript 1.4.2-beta.1 → 1.4.2-beta.3

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 (106) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/Cart/CartApplicationModel.d.ts +1742 -1726
  4. package/sdk/application/Cart/CartApplicationModel.js +1497 -1481
  5. package/sdk/application/Catalog/CatalogApplicationModel.d.ts +1917 -1917
  6. package/sdk/application/Catalog/CatalogApplicationModel.js +1611 -1611
  7. package/sdk/application/Common/CommonApplicationModel.d.ts +235 -235
  8. package/sdk/application/Common/CommonApplicationModel.js +172 -172
  9. package/sdk/application/Communication/CommunicationApplicationModel.d.ts +72 -72
  10. package/sdk/application/Communication/CommunicationApplicationModel.js +64 -64
  11. package/sdk/application/Configuration/ConfigurationApplicationModel.d.ts +1614 -1614
  12. package/sdk/application/Configuration/ConfigurationApplicationModel.js +1151 -1151
  13. package/sdk/application/Content/ContentApplicationModel.d.ts +797 -797
  14. package/sdk/application/Content/ContentApplicationModel.js +757 -757
  15. package/sdk/application/FileStorage/FileStorageApplicationModel.d.ts +79 -79
  16. package/sdk/application/FileStorage/FileStorageApplicationModel.js +84 -84
  17. package/sdk/application/Lead/LeadApplicationModel.d.ts +417 -417
  18. package/sdk/application/Lead/LeadApplicationModel.js +301 -301
  19. package/sdk/application/Logistic/LogisticApplicationModel.d.ts +666 -666
  20. package/sdk/application/Logistic/LogisticApplicationModel.js +601 -601
  21. package/sdk/application/Order/OrderApplicationModel.d.ts +846 -846
  22. package/sdk/application/Order/OrderApplicationModel.js +822 -822
  23. package/sdk/application/Payment/PaymentApplicationClient.d.ts +5 -5
  24. package/sdk/application/Payment/PaymentApplicationClient.js +10 -10
  25. package/sdk/application/Payment/PaymentApplicationModel.d.ts +2155 -2150
  26. package/sdk/application/Payment/PaymentApplicationModel.js +1460 -1458
  27. package/sdk/application/Payment/PaymentApplicationValidator.d.ts +5 -5
  28. package/sdk/application/Payment/PaymentApplicationValidator.js +3 -3
  29. package/sdk/application/PosCart/PosCartApplicationModel.d.ts +1462 -1462
  30. package/sdk/application/PosCart/PosCartApplicationModel.js +1260 -1260
  31. package/sdk/application/Rewards/RewardsApplicationModel.d.ts +214 -214
  32. package/sdk/application/Rewards/RewardsApplicationModel.js +211 -211
  33. package/sdk/application/Share/ShareApplicationModel.d.ts +114 -114
  34. package/sdk/application/Share/ShareApplicationModel.js +121 -121
  35. package/sdk/application/Theme/ThemeApplicationModel.d.ts +895 -895
  36. package/sdk/application/Theme/ThemeApplicationModel.js +684 -684
  37. package/sdk/application/User/UserApplicationModel.d.ts +762 -762
  38. package/sdk/application/User/UserApplicationModel.js +738 -738
  39. package/sdk/partner/FileStorage/FileStoragePartnerModel.d.ts +63 -63
  40. package/sdk/partner/FileStorage/FileStoragePartnerModel.js +65 -65
  41. package/sdk/partner/Lead/LeadPartnerModel.d.ts +661 -661
  42. package/sdk/partner/Lead/LeadPartnerModel.js +491 -491
  43. package/sdk/partner/Logistics/LogisticsPartnerModel.d.ts +223 -223
  44. package/sdk/partner/Logistics/LogisticsPartnerModel.js +235 -235
  45. package/sdk/partner/Theme/ThemePartnerModel.d.ts +1087 -1087
  46. package/sdk/partner/Theme/ThemePartnerModel.js +819 -819
  47. package/sdk/partner/Webhook/WebhookPartnerModel.d.ts +386 -386
  48. package/sdk/partner/Webhook/WebhookPartnerModel.js +342 -342
  49. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.d.ts +123 -123
  50. package/sdk/platform/AuditTrail/AuditTrailPlatformModel.js +109 -109
  51. package/sdk/platform/Billing/BillingPlatformModel.d.ts +801 -801
  52. package/sdk/platform/Billing/BillingPlatformModel.js +783 -783
  53. package/sdk/platform/Cart/CartPlatformModel.d.ts +3333 -3317
  54. package/sdk/platform/Cart/CartPlatformModel.js +2936 -2920
  55. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1013 -1013
  56. package/sdk/platform/Catalog/CatalogPlatformModel.js +923 -923
  57. package/sdk/platform/Common/CommonPlatformModel.d.ts +255 -255
  58. package/sdk/platform/Common/CommonPlatformModel.js +187 -187
  59. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +1238 -1238
  60. package/sdk/platform/Communication/CommunicationPlatformModel.js +1273 -1273
  61. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.d.ts +661 -661
  62. package/sdk/platform/CompanyProfile/CompanyProfilePlatformModel.js +692 -692
  63. package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +3198 -3198
  64. package/sdk/platform/Configuration/ConfigurationPlatformModel.js +2247 -2247
  65. package/sdk/platform/Content/ContentPlatformModel.d.ts +1833 -1833
  66. package/sdk/platform/Content/ContentPlatformModel.js +1837 -1837
  67. package/sdk/platform/Discount/DiscountPlatformModel.d.ts +245 -245
  68. package/sdk/platform/Discount/DiscountPlatformModel.js +248 -248
  69. package/sdk/platform/FileStorage/FileStoragePlatformModel.d.ts +865 -865
  70. package/sdk/platform/FileStorage/FileStoragePlatformModel.js +877 -877
  71. package/sdk/platform/Finance/FinancePlatformModel.d.ts +1044 -1044
  72. package/sdk/platform/Finance/FinancePlatformModel.js +974 -974
  73. package/sdk/platform/Inventory/InventoryPlatformModel.d.ts +942 -942
  74. package/sdk/platform/Inventory/InventoryPlatformModel.js +1003 -1003
  75. package/sdk/platform/Lead/LeadPlatformModel.d.ts +608 -608
  76. package/sdk/platform/Lead/LeadPlatformModel.js +465 -465
  77. package/sdk/platform/Order/OrderPlatformModel.d.ts +5180 -5176
  78. package/sdk/platform/Order/OrderPlatformModel.js +4740 -4736
  79. package/sdk/platform/Partner/PartnerPlatformModel.d.ts +22 -22
  80. package/sdk/platform/Partner/PartnerPlatformModel.js +22 -22
  81. package/sdk/platform/Payment/PaymentPlatformModel.d.ts +2670 -2660
  82. package/sdk/platform/Payment/PaymentPlatformModel.js +1831 -1827
  83. package/sdk/platform/Rewards/RewardsPlatformModel.d.ts +204 -204
  84. package/sdk/platform/Rewards/RewardsPlatformModel.js +199 -199
  85. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.d.ts +1505 -1507
  86. package/sdk/platform/Serviceability/ServiceabilityPlatformModel.js +1532 -1536
  87. package/sdk/platform/Share/SharePlatformModel.d.ts +147 -147
  88. package/sdk/platform/Share/SharePlatformModel.js +139 -139
  89. package/sdk/platform/Theme/ThemePlatformModel.d.ts +1046 -1046
  90. package/sdk/platform/Theme/ThemePlatformModel.js +789 -789
  91. package/sdk/platform/User/UserPlatformModel.d.ts +758 -758
  92. package/sdk/platform/User/UserPlatformModel.js +643 -643
  93. package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +439 -439
  94. package/sdk/platform/Webhook/WebhookPlatformModel.js +364 -364
  95. package/sdk/public/Billing/BillingPublicModel.d.ts +55 -55
  96. package/sdk/public/Billing/BillingPublicModel.js +51 -51
  97. package/sdk/public/Configuration/ConfigurationPublicModel.d.ts +237 -237
  98. package/sdk/public/Configuration/ConfigurationPublicModel.js +174 -174
  99. package/sdk/public/Content/ContentPublicModel.d.ts +26 -26
  100. package/sdk/public/Content/ContentPublicModel.js +28 -28
  101. package/sdk/public/Inventory/InventoryPublicModel.d.ts +237 -237
  102. package/sdk/public/Inventory/InventoryPublicModel.js +257 -257
  103. package/sdk/public/Partner/PartnerPublicModel.d.ts +104 -104
  104. package/sdk/public/Partner/PartnerPublicModel.js +113 -113
  105. package/sdk/public/Webhook/WebhookPublicModel.d.ts +87 -87
  106. package/sdk/public/Webhook/WebhookPublicModel.js +93 -93
@@ -1,191 +1,191 @@
1
1
  export = AuditTrailPlatformModel;
2
2
  /**
3
- * @typedef BadRequest
4
- * @property {string} [message] - Failure message.
3
+ * @typedef RequestBodyAuditLog
4
+ * @property {LogMetaObj} log_meta
5
+ * @property {Object} log_payload
5
6
  */
6
7
  /**
7
8
  * @typedef CreateLogResponse
8
- * @property {string} [internal_message]
9
9
  * @property {string} [message]
10
+ * @property {string} [internal_message]
10
11
  */
11
12
  /**
12
- * @typedef DeviceInfo
13
- * @property {Object} [extra_meta]
14
- * @property {string} [user_agent]
13
+ * @typedef LogMetaObj
14
+ * @property {Object} [modifier]
15
+ * @property {string} [application]
16
+ * @property {EntityObject} [entity]
17
+ * @property {Object} [device_info]
18
+ * @property {Object} [location]
15
19
  */
16
20
  /**
17
- * @typedef EntityObj
18
- * @property {string} [action]
19
- * @property {Object} [entity_details]
21
+ * @typedef EntityObject
20
22
  * @property {string} [id]
21
23
  * @property {string} [type]
24
+ * @property {string} [action]
22
25
  */
23
26
  /**
24
- * @typedef EntityObject
25
- * @property {string} [action]
26
- * @property {string} [id]
27
- * @property {string} [type]
27
+ * @typedef LogSchemaResponse
28
+ * @property {LogDocs[]} [docs]
28
29
  */
29
30
  /**
30
- * @typedef EntityTypeObj
31
- * @property {string} [display_name]
32
- * @property {string} [entity_value]
31
+ * @typedef LogDocs
32
+ * @property {EntityObj} [entity]
33
+ * @property {Modifier} [modifier]
34
+ * @property {DeviceInfo} [device_info]
35
+ * @property {Location} [location]
36
+ * @property {string} [_id]
37
+ * @property {string} [company]
38
+ * @property {string} [application]
39
+ * @property {string} [sessions]
40
+ * @property {string} [date]
41
+ * @property {Object} [logs]
33
42
  */
34
43
  /**
35
- * @typedef EntityTypesResponse
36
- * @property {EntityTypeObj[]} [items]
44
+ * @typedef EntityObj
45
+ * @property {string} [id]
46
+ * @property {string} [type]
47
+ * @property {string} [action]
48
+ * @property {Object} [entity_details]
37
49
  */
38
50
  /**
39
- * @typedef InternalServerError
40
- * @property {string} [code] - Error code
41
- * @property {string} [message] - Internal server Server error
51
+ * @typedef Modifier
52
+ * @property {string} [user_id]
53
+ * @property {boolean} [as_administrator]
54
+ * @property {Object} [user_details]
42
55
  */
43
56
  /**
44
- * @typedef Location
57
+ * @typedef DeviceInfo
58
+ * @property {string} [user_agent]
45
59
  * @property {Object} [extra_meta]
46
60
  */
47
61
  /**
48
- * @typedef LogDocs
49
- * @property {string} [_id]
50
- * @property {string} [application]
51
- * @property {string} [company]
52
- * @property {string} [date]
53
- * @property {DeviceInfo} [device_info]
54
- * @property {EntityObj} [entity]
55
- * @property {Location} [location]
56
- * @property {Object} [logs]
57
- * @property {Modifier} [modifier]
58
- * @property {string} [sessions]
62
+ * @typedef Location
63
+ * @property {Object} [extra_meta]
59
64
  */
60
65
  /**
61
- * @typedef LogMetaObj
62
- * @property {string} [application]
63
- * @property {Object} [device_info]
64
- * @property {EntityObject} [entity]
65
- * @property {Object} [location]
66
- * @property {Object} [modifier]
66
+ * @typedef BadRequest
67
+ * @property {string} [message] - Failure message.
67
68
  */
68
69
  /**
69
- * @typedef LogSchemaResponse
70
- * @property {LogDocs[]} [docs]
70
+ * @typedef InternalServerError
71
+ * @property {string} [message] - Internal server Server error
72
+ * @property {string} [code] - Error code
71
73
  */
72
74
  /**
73
- * @typedef Modifier
74
- * @property {boolean} [as_administrator]
75
- * @property {Object} [user_details]
76
- * @property {string} [user_id]
75
+ * @typedef EntityTypesResponse
76
+ * @property {EntityTypeObj[]} [items]
77
77
  */
78
78
  /**
79
- * @typedef RequestBodyAuditLog
80
- * @property {LogMetaObj} log_meta
81
- * @property {Object} log_payload
79
+ * @typedef EntityTypeObj
80
+ * @property {string} [entity_value]
81
+ * @property {string} [display_name]
82
82
  */
83
83
  declare class AuditTrailPlatformModel {
84
84
  }
85
85
  declare namespace AuditTrailPlatformModel {
86
- export { BadRequest, CreateLogResponse, DeviceInfo, EntityObj, EntityObject, EntityTypeObj, EntityTypesResponse, InternalServerError, Location, LogDocs, LogMetaObj, LogSchemaResponse, Modifier, RequestBodyAuditLog };
86
+ export { RequestBodyAuditLog, CreateLogResponse, LogMetaObj, EntityObject, LogSchemaResponse, LogDocs, EntityObj, Modifier, DeviceInfo, Location, BadRequest, InternalServerError, EntityTypesResponse, EntityTypeObj };
87
87
  }
88
- /** @returns {BadRequest} */
89
- declare function BadRequest(): BadRequest;
90
- type BadRequest = {
91
- /**
92
- * - Failure message.
93
- */
94
- message?: string;
88
+ /** @returns {RequestBodyAuditLog} */
89
+ declare function RequestBodyAuditLog(): RequestBodyAuditLog;
90
+ type RequestBodyAuditLog = {
91
+ log_meta: LogMetaObj;
92
+ log_payload: any;
95
93
  };
96
94
  /** @returns {CreateLogResponse} */
97
95
  declare function CreateLogResponse(): CreateLogResponse;
98
96
  type CreateLogResponse = {
99
- internal_message?: string;
100
97
  message?: string;
98
+ internal_message?: string;
101
99
  };
102
- /** @returns {DeviceInfo} */
103
- declare function DeviceInfo(): DeviceInfo;
104
- type DeviceInfo = {
105
- extra_meta?: any;
106
- user_agent?: string;
107
- };
108
- /** @returns {EntityObj} */
109
- declare function EntityObj(): EntityObj;
110
- type EntityObj = {
111
- action?: string;
112
- entity_details?: any;
113
- id?: string;
114
- type?: string;
100
+ /** @returns {LogMetaObj} */
101
+ declare function LogMetaObj(): LogMetaObj;
102
+ type LogMetaObj = {
103
+ modifier?: any;
104
+ application?: string;
105
+ entity?: EntityObject;
106
+ device_info?: any;
107
+ location?: any;
115
108
  };
116
109
  /** @returns {EntityObject} */
117
110
  declare function EntityObject(): EntityObject;
118
111
  type EntityObject = {
119
- action?: string;
120
112
  id?: string;
121
113
  type?: string;
114
+ action?: string;
122
115
  };
123
- /** @returns {EntityTypeObj} */
124
- declare function EntityTypeObj(): EntityTypeObj;
125
- type EntityTypeObj = {
126
- display_name?: string;
127
- entity_value?: string;
128
- };
129
- /** @returns {EntityTypesResponse} */
130
- declare function EntityTypesResponse(): EntityTypesResponse;
131
- type EntityTypesResponse = {
132
- items?: EntityTypeObj[];
133
- };
134
- /** @returns {InternalServerError} */
135
- declare function InternalServerError(): InternalServerError;
136
- type InternalServerError = {
137
- /**
138
- * - Error code
139
- */
140
- code?: string;
141
- /**
142
- * - Internal server Server error
143
- */
144
- message?: string;
145
- };
146
- /** @returns {Location} */
147
- declare function Location(): Location;
148
- type Location = {
149
- extra_meta?: any;
116
+ /** @returns {LogSchemaResponse} */
117
+ declare function LogSchemaResponse(): LogSchemaResponse;
118
+ type LogSchemaResponse = {
119
+ docs?: LogDocs[];
150
120
  };
151
121
  /** @returns {LogDocs} */
152
122
  declare function LogDocs(): LogDocs;
153
123
  type LogDocs = {
124
+ entity?: EntityObj;
125
+ modifier?: Modifier;
126
+ device_info?: DeviceInfo;
127
+ location?: Location;
154
128
  _id?: string;
155
- application?: string;
156
129
  company?: string;
130
+ application?: string;
131
+ sessions?: string;
157
132
  date?: string;
158
- device_info?: DeviceInfo;
159
- entity?: EntityObj;
160
- location?: Location;
161
133
  logs?: any;
162
- modifier?: Modifier;
163
- sessions?: string;
164
- };
165
- /** @returns {LogMetaObj} */
166
- declare function LogMetaObj(): LogMetaObj;
167
- type LogMetaObj = {
168
- application?: string;
169
- device_info?: any;
170
- entity?: EntityObject;
171
- location?: any;
172
- modifier?: any;
173
134
  };
174
- /** @returns {LogSchemaResponse} */
175
- declare function LogSchemaResponse(): LogSchemaResponse;
176
- type LogSchemaResponse = {
177
- docs?: LogDocs[];
135
+ /** @returns {EntityObj} */
136
+ declare function EntityObj(): EntityObj;
137
+ type EntityObj = {
138
+ id?: string;
139
+ type?: string;
140
+ action?: string;
141
+ entity_details?: any;
178
142
  };
179
143
  /** @returns {Modifier} */
180
144
  declare function Modifier(): Modifier;
181
145
  type Modifier = {
146
+ user_id?: string;
182
147
  as_administrator?: boolean;
183
148
  user_details?: any;
184
- user_id?: string;
185
149
  };
186
- /** @returns {RequestBodyAuditLog} */
187
- declare function RequestBodyAuditLog(): RequestBodyAuditLog;
188
- type RequestBodyAuditLog = {
189
- log_meta: LogMetaObj;
190
- log_payload: any;
150
+ /** @returns {DeviceInfo} */
151
+ declare function DeviceInfo(): DeviceInfo;
152
+ type DeviceInfo = {
153
+ user_agent?: string;
154
+ extra_meta?: any;
155
+ };
156
+ /** @returns {Location} */
157
+ declare function Location(): Location;
158
+ type Location = {
159
+ extra_meta?: any;
160
+ };
161
+ /** @returns {BadRequest} */
162
+ declare function BadRequest(): BadRequest;
163
+ type BadRequest = {
164
+ /**
165
+ * - Failure message.
166
+ */
167
+ message?: string;
168
+ };
169
+ /** @returns {InternalServerError} */
170
+ declare function InternalServerError(): InternalServerError;
171
+ type InternalServerError = {
172
+ /**
173
+ * - Internal server Server error
174
+ */
175
+ message?: string;
176
+ /**
177
+ * - Error code
178
+ */
179
+ code?: string;
180
+ };
181
+ /** @returns {EntityTypesResponse} */
182
+ declare function EntityTypesResponse(): EntityTypesResponse;
183
+ type EntityTypesResponse = {
184
+ items?: EntityTypeObj[];
185
+ };
186
+ /** @returns {EntityTypeObj} */
187
+ declare function EntityTypeObj(): EntityTypeObj;
188
+ type EntityTypeObj = {
189
+ entity_value?: string;
190
+ display_name?: string;
191
191
  };
@@ -1,221 +1,221 @@
1
1
  const Joi = require("joi");
2
2
 
3
3
  /**
4
- * @typedef BadRequest
5
- * @property {string} [message] - Failure message.
4
+ * @typedef RequestBodyAuditLog
5
+ * @property {LogMetaObj} log_meta
6
+ * @property {Object} log_payload
6
7
  */
7
8
 
8
9
  /**
9
10
  * @typedef CreateLogResponse
10
- * @property {string} [internal_message]
11
11
  * @property {string} [message]
12
+ * @property {string} [internal_message]
12
13
  */
13
14
 
14
15
  /**
15
- * @typedef DeviceInfo
16
- * @property {Object} [extra_meta]
17
- * @property {string} [user_agent]
16
+ * @typedef LogMetaObj
17
+ * @property {Object} [modifier]
18
+ * @property {string} [application]
19
+ * @property {EntityObject} [entity]
20
+ * @property {Object} [device_info]
21
+ * @property {Object} [location]
18
22
  */
19
23
 
20
24
  /**
21
- * @typedef EntityObj
22
- * @property {string} [action]
23
- * @property {Object} [entity_details]
25
+ * @typedef EntityObject
24
26
  * @property {string} [id]
25
27
  * @property {string} [type]
28
+ * @property {string} [action]
26
29
  */
27
30
 
28
31
  /**
29
- * @typedef EntityObject
30
- * @property {string} [action]
31
- * @property {string} [id]
32
- * @property {string} [type]
32
+ * @typedef LogSchemaResponse
33
+ * @property {LogDocs[]} [docs]
33
34
  */
34
35
 
35
36
  /**
36
- * @typedef EntityTypeObj
37
- * @property {string} [display_name]
38
- * @property {string} [entity_value]
37
+ * @typedef LogDocs
38
+ * @property {EntityObj} [entity]
39
+ * @property {Modifier} [modifier]
40
+ * @property {DeviceInfo} [device_info]
41
+ * @property {Location} [location]
42
+ * @property {string} [_id]
43
+ * @property {string} [company]
44
+ * @property {string} [application]
45
+ * @property {string} [sessions]
46
+ * @property {string} [date]
47
+ * @property {Object} [logs]
39
48
  */
40
49
 
41
50
  /**
42
- * @typedef EntityTypesResponse
43
- * @property {EntityTypeObj[]} [items]
51
+ * @typedef EntityObj
52
+ * @property {string} [id]
53
+ * @property {string} [type]
54
+ * @property {string} [action]
55
+ * @property {Object} [entity_details]
44
56
  */
45
57
 
46
58
  /**
47
- * @typedef InternalServerError
48
- * @property {string} [code] - Error code
49
- * @property {string} [message] - Internal server Server error
59
+ * @typedef Modifier
60
+ * @property {string} [user_id]
61
+ * @property {boolean} [as_administrator]
62
+ * @property {Object} [user_details]
50
63
  */
51
64
 
52
65
  /**
53
- * @typedef Location
66
+ * @typedef DeviceInfo
67
+ * @property {string} [user_agent]
54
68
  * @property {Object} [extra_meta]
55
69
  */
56
70
 
57
71
  /**
58
- * @typedef LogDocs
59
- * @property {string} [_id]
60
- * @property {string} [application]
61
- * @property {string} [company]
62
- * @property {string} [date]
63
- * @property {DeviceInfo} [device_info]
64
- * @property {EntityObj} [entity]
65
- * @property {Location} [location]
66
- * @property {Object} [logs]
67
- * @property {Modifier} [modifier]
68
- * @property {string} [sessions]
72
+ * @typedef Location
73
+ * @property {Object} [extra_meta]
69
74
  */
70
75
 
71
76
  /**
72
- * @typedef LogMetaObj
73
- * @property {string} [application]
74
- * @property {Object} [device_info]
75
- * @property {EntityObject} [entity]
76
- * @property {Object} [location]
77
- * @property {Object} [modifier]
77
+ * @typedef BadRequest
78
+ * @property {string} [message] - Failure message.
78
79
  */
79
80
 
80
81
  /**
81
- * @typedef LogSchemaResponse
82
- * @property {LogDocs[]} [docs]
82
+ * @typedef InternalServerError
83
+ * @property {string} [message] - Internal server Server error
84
+ * @property {string} [code] - Error code
83
85
  */
84
86
 
85
87
  /**
86
- * @typedef Modifier
87
- * @property {boolean} [as_administrator]
88
- * @property {Object} [user_details]
89
- * @property {string} [user_id]
88
+ * @typedef EntityTypesResponse
89
+ * @property {EntityTypeObj[]} [items]
90
90
  */
91
91
 
92
92
  /**
93
- * @typedef RequestBodyAuditLog
94
- * @property {LogMetaObj} log_meta
95
- * @property {Object} log_payload
93
+ * @typedef EntityTypeObj
94
+ * @property {string} [entity_value]
95
+ * @property {string} [display_name]
96
96
  */
97
97
 
98
98
  class AuditTrailPlatformModel {
99
- /** @returns {BadRequest} */
100
- static BadRequest() {
99
+ /** @returns {RequestBodyAuditLog} */
100
+ static RequestBodyAuditLog() {
101
101
  return Joi.object({
102
- message: Joi.string().allow(""),
102
+ log_meta: AuditTrailPlatformModel.LogMetaObj().required(),
103
+ log_payload: Joi.any().required(),
103
104
  });
104
105
  }
105
106
 
106
107
  /** @returns {CreateLogResponse} */
107
108
  static CreateLogResponse() {
108
109
  return Joi.object({
109
- internal_message: Joi.string().allow(""),
110
110
  message: Joi.string().allow(""),
111
+ internal_message: Joi.string().allow(""),
111
112
  });
112
113
  }
113
114
 
114
- /** @returns {DeviceInfo} */
115
- static DeviceInfo() {
115
+ /** @returns {LogMetaObj} */
116
+ static LogMetaObj() {
116
117
  return Joi.object({
117
- extra_meta: Joi.any(),
118
- user_agent: Joi.string().allow(""),
118
+ modifier: Joi.any(),
119
+ application: Joi.string().allow(""),
120
+ entity: AuditTrailPlatformModel.EntityObject(),
121
+ device_info: Joi.any(),
122
+ location: Joi.any(),
119
123
  });
120
124
  }
121
125
 
122
- /** @returns {EntityObj} */
123
- static EntityObj() {
126
+ /** @returns {EntityObject} */
127
+ static EntityObject() {
124
128
  return Joi.object({
125
- action: Joi.string().allow(""),
126
- entity_details: Joi.any(),
127
129
  id: Joi.string().allow(""),
128
130
  type: Joi.string().allow(""),
131
+ action: Joi.string().allow(""),
129
132
  });
130
133
  }
131
134
 
132
- /** @returns {EntityObject} */
133
- static EntityObject() {
135
+ /** @returns {LogSchemaResponse} */
136
+ static LogSchemaResponse() {
134
137
  return Joi.object({
135
- action: Joi.string().allow(""),
136
- id: Joi.string().allow(""),
137
- type: Joi.string().allow(""),
138
+ docs: Joi.array().items(AuditTrailPlatformModel.LogDocs()),
138
139
  });
139
140
  }
140
141
 
141
- /** @returns {EntityTypeObj} */
142
- static EntityTypeObj() {
142
+ /** @returns {LogDocs} */
143
+ static LogDocs() {
143
144
  return Joi.object({
144
- display_name: Joi.string().allow(""),
145
- entity_value: Joi.string().allow(""),
145
+ entity: AuditTrailPlatformModel.EntityObj(),
146
+ modifier: AuditTrailPlatformModel.Modifier(),
147
+ device_info: AuditTrailPlatformModel.DeviceInfo(),
148
+ location: AuditTrailPlatformModel.Location(),
149
+ _id: Joi.string().allow(""),
150
+ company: Joi.string().allow(""),
151
+ application: Joi.string().allow(""),
152
+ sessions: Joi.string().allow(""),
153
+ date: Joi.string().allow(""),
154
+ logs: Joi.any(),
146
155
  });
147
156
  }
148
157
 
149
- /** @returns {EntityTypesResponse} */
150
- static EntityTypesResponse() {
158
+ /** @returns {EntityObj} */
159
+ static EntityObj() {
151
160
  return Joi.object({
152
- items: Joi.array().items(AuditTrailPlatformModel.EntityTypeObj()),
161
+ id: Joi.string().allow(""),
162
+ type: Joi.string().allow(""),
163
+ action: Joi.string().allow(""),
164
+ entity_details: Joi.any(),
153
165
  });
154
166
  }
155
167
 
156
- /** @returns {InternalServerError} */
157
- static InternalServerError() {
168
+ /** @returns {Modifier} */
169
+ static Modifier() {
158
170
  return Joi.object({
159
- code: Joi.string().allow(""),
160
- message: Joi.string().allow(""),
171
+ user_id: Joi.string().allow(""),
172
+ as_administrator: Joi.boolean(),
173
+ user_details: Joi.any(),
161
174
  });
162
175
  }
163
176
 
164
- /** @returns {Location} */
165
- static Location() {
177
+ /** @returns {DeviceInfo} */
178
+ static DeviceInfo() {
166
179
  return Joi.object({
180
+ user_agent: Joi.string().allow(""),
167
181
  extra_meta: Joi.any(),
168
182
  });
169
183
  }
170
184
 
171
- /** @returns {LogDocs} */
172
- static LogDocs() {
185
+ /** @returns {Location} */
186
+ static Location() {
173
187
  return Joi.object({
174
- _id: Joi.string().allow(""),
175
- application: Joi.string().allow(""),
176
- company: Joi.string().allow(""),
177
- date: Joi.string().allow(""),
178
- device_info: AuditTrailPlatformModel.DeviceInfo(),
179
- entity: AuditTrailPlatformModel.EntityObj(),
180
- location: AuditTrailPlatformModel.Location(),
181
- logs: Joi.any(),
182
- modifier: AuditTrailPlatformModel.Modifier(),
183
- sessions: Joi.string().allow(""),
188
+ extra_meta: Joi.any(),
184
189
  });
185
190
  }
186
191
 
187
- /** @returns {LogMetaObj} */
188
- static LogMetaObj() {
192
+ /** @returns {BadRequest} */
193
+ static BadRequest() {
189
194
  return Joi.object({
190
- application: Joi.string().allow(""),
191
- device_info: Joi.any(),
192
- entity: AuditTrailPlatformModel.EntityObject(),
193
- location: Joi.any(),
194
- modifier: Joi.any(),
195
+ message: Joi.string().allow(""),
195
196
  });
196
197
  }
197
198
 
198
- /** @returns {LogSchemaResponse} */
199
- static LogSchemaResponse() {
199
+ /** @returns {InternalServerError} */
200
+ static InternalServerError() {
200
201
  return Joi.object({
201
- docs: Joi.array().items(AuditTrailPlatformModel.LogDocs()),
202
+ message: Joi.string().allow(""),
203
+ code: Joi.string().allow(""),
202
204
  });
203
205
  }
204
206
 
205
- /** @returns {Modifier} */
206
- static Modifier() {
207
+ /** @returns {EntityTypesResponse} */
208
+ static EntityTypesResponse() {
207
209
  return Joi.object({
208
- as_administrator: Joi.boolean(),
209
- user_details: Joi.any(),
210
- user_id: Joi.string().allow(""),
210
+ items: Joi.array().items(AuditTrailPlatformModel.EntityTypeObj()),
211
211
  });
212
212
  }
213
213
 
214
- /** @returns {RequestBodyAuditLog} */
215
- static RequestBodyAuditLog() {
214
+ /** @returns {EntityTypeObj} */
215
+ static EntityTypeObj() {
216
216
  return Joi.object({
217
- log_meta: AuditTrailPlatformModel.LogMetaObj().required(),
218
- log_payload: Joi.any().required(),
217
+ entity_value: Joi.string().allow(""),
218
+ display_name: Joi.string().allow(""),
219
219
  });
220
220
  }
221
221
  }