@gofynd/fdk-client-javascript 3.19.0 → 3.21.0

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 (41) hide show
  1. package/README.md +1 -1
  2. package/package.json +1 -1
  3. package/sdk/application/ApplicationClient.d.ts +0 -2
  4. package/sdk/application/ApplicationClient.js +0 -2
  5. package/sdk/application/Cart/CartApplicationClient.d.ts +2 -2
  6. package/sdk/application/Cart/CartApplicationClient.js +12 -4
  7. package/sdk/partner/Logistics/LogisticsPartnerClient.d.ts +1 -1
  8. package/sdk/partner/Logistics/LogisticsPartnerClient.js +11 -3
  9. package/sdk/partner/Logistics/LogisticsPartnerValidator.js +1 -0
  10. package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +5 -5
  11. package/sdk/platform/Cart/CartPlatformApplicationClient.js +50 -7
  12. package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +69 -10
  13. package/sdk/platform/Cart/CartPlatformApplicationValidator.js +30 -5
  14. package/sdk/platform/Cart/CartPlatformModel.d.ts +97 -72
  15. package/sdk/platform/Cart/CartPlatformModel.js +54 -35
  16. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +1 -1
  17. package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +1 -1
  18. package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +17 -11
  19. package/sdk/platform/Catalog/CatalogPlatformClient.js +18 -12
  20. package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +353 -156
  21. package/sdk/platform/Catalog/CatalogPlatformModel.js +176 -87
  22. package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +40 -38
  23. package/sdk/platform/Catalog/CatalogPlatformValidator.js +22 -21
  24. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.d.ts +1 -1
  25. package/sdk/platform/Communication/CommunicationPlatformApplicationClient.js +1 -1
  26. package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +9 -0
  27. package/sdk/platform/Communication/CommunicationPlatformModel.js +4 -0
  28. package/sdk/platform/Content/ContentPlatformModel.d.ts +7 -7
  29. package/sdk/platform/Content/ContentPlatformModel.js +5 -5
  30. package/sdk/platform/Order/OrderPlatformModel.d.ts +2 -2
  31. package/sdk/platform/Order/OrderPlatformModel.js +1 -1
  32. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.d.ts +1 -1
  33. package/sdk/platform/Serviceability/ServiceabilityPlatformClient.js +12 -3
  34. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.d.ts +5 -0
  35. package/sdk/platform/Serviceability/ServiceabilityPlatformValidator.js +2 -0
  36. package/sdk/platform/User/UserPlatformApplicationClient.d.ts +4 -2
  37. package/sdk/platform/User/UserPlatformApplicationClient.js +9 -5
  38. package/sdk/platform/User/UserPlatformModel.d.ts +17 -1
  39. package/sdk/platform/User/UserPlatformModel.js +17 -1
  40. package/sdk/application/Webhook/WebhookApplicationClient.d.ts +0 -19
  41. package/sdk/application/Webhook/WebhookApplicationClient.js +0 -72
@@ -2044,7 +2044,9 @@ class User {
2044
2044
  *
2045
2045
  * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
2046
2046
  * @param {import("../PlatformAPIClient").Options} - Options
2047
- * @returns {Promise<Object>} - Success response
2047
+ * @returns {Promise<UserPlatformModel.UserAttributeDefinitionsResponseSchema>}
2048
+ * - Success response
2049
+ *
2048
2050
  * @name getUserAttributesForUser
2049
2051
  * @summary: Get All Customer Attributes
2050
2052
  * @description: Retrieve all user attributes for a specific user - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/platform/user/getUserAttributesForUser/).
@@ -2106,10 +2108,12 @@ class User {
2106
2108
  responseData = response[0];
2107
2109
  }
2108
2110
 
2109
- const { error: res_error } = Joi.any().validate(responseData, {
2110
- abortEarly: false,
2111
- allowUnknown: true,
2112
- });
2111
+ const {
2112
+ error: res_error,
2113
+ } = UserPlatformModel.UserAttributeDefinitionsResponseSchema().validate(
2114
+ responseData,
2115
+ { abortEarly: false, allowUnknown: true }
2116
+ );
2113
2117
 
2114
2118
  if (res_error) {
2115
2119
  if (this.config.options.strictResponseCheck === true) {
@@ -9,6 +9,11 @@ export = UserPlatformModel;
9
9
  * definition objects.
10
10
  * @property {PaginationSchema} [page]
11
11
  */
12
+ /**
13
+ * @typedef UserAttributeDefinitionsResponseSchema
14
+ * @property {UserAttribute[]} [items]
15
+ * @property {PaginationSchema} [page]
16
+ */
12
17
  /**
13
18
  * @typedef UserAttributeDefinition
14
19
  * @property {string} [_id] - The unique identifier for the attribute definition.
@@ -34,6 +39,7 @@ export = UserPlatformModel;
34
39
  * @property {string} [created_at] - The creation date of the attribute.
35
40
  * @property {string} [modified_at] - The modification date of the attribute.
36
41
  * @property {number} [__v] - The version number of the attribute.
42
+ * @property {string[]} [options] - List of possible values for the attribute
37
43
  */
38
44
  /**
39
45
  * @typedef UserAttributeDefinitionDetails
@@ -716,7 +722,7 @@ export = UserPlatformModel;
716
722
  declare class UserPlatformModel {
717
723
  }
718
724
  declare namespace UserPlatformModel {
719
- export { SuccessMessage, UserAttributeDefinitionList, UserAttributeDefinition, UserAttributeDefinitionDetails, AttributeMaskingProperties, AttributeRegistrationProperties, UserAttributeDefinitionValidation, BulkUserAttribute, UserAttribute, CreateBulkUserAttribute, BulkUserAttributeRequestBody, CreateUserAttribute, CreateUserAttributeDefinition, CreateStoreFrontUsersPayload, BulkUserExportSchema, BulkActionModel, CreatedBySchema, BulkActionLinkSchema, FileLinks, BulkActionCountSchema, BlockUserRequestSchema, ArchiveUserRequestSchema, UnDeleteUserRequestSchema, BlockUserSuccess, ArchiveUserSuccess, UnDeleteUserSuccess, UserSearchResponseSchema, CustomerListResponseSchema, BulkActionPaginationSchema, PaginationSchema, SessionListResponseSchema, SessionDeleteResponseSchema, SessionsDeleteResponseSchema, APIError, SessionListResponseInfo, Conditions, UserResponseErrorSchema, UserGroupResponseSchema, UserGroupListResponseSchema, ConditionsSchema, DeleteBulkUserAttribute, UserAttributeFilter, UserAttributeFilterQuery, UserAttributeFilterRequestConditions, UserAttributeFiltered, UserAttributeFilteredList, CreateUserGroup, CreateUserRequestSchema, CreateUserResponseSchema, CreateUserSessionRequestSchema, CreateUserSessionResponseSchema, PlatformSchema, LookAndFeel, Login, MetaSchema, Social, RequiredFields, PlatformEmail, PlatformMobile, RegisterRequiredFields, RegisterRequiredFieldsEmail, RegisterRequiredFieldsMobile, FlashCard, SocialTokens, DeleteAccountReasons, DeleteAccountConsent, GetUserTimeline, UserTimeline, Facebook, Accountkit, Google, SessionExpiry, UpdateUserGroupSchema, PartialUserGroupUpdateSchema, UserGroupUpdateData, UpdateUserRequestSchema, UserEmails, UserPhoneNumbers, UserSchema, UserSearchSchema, PhoneNumber, Email, UserConsent, DeleteUserGroupSuccess, PrivacyPolicyConsentSchema };
725
+ export { SuccessMessage, UserAttributeDefinitionList, UserAttributeDefinitionsResponseSchema, UserAttributeDefinition, UserAttributeDefinitionDetails, AttributeMaskingProperties, AttributeRegistrationProperties, UserAttributeDefinitionValidation, BulkUserAttribute, UserAttribute, CreateBulkUserAttribute, BulkUserAttributeRequestBody, CreateUserAttribute, CreateUserAttributeDefinition, CreateStoreFrontUsersPayload, BulkUserExportSchema, BulkActionModel, CreatedBySchema, BulkActionLinkSchema, FileLinks, BulkActionCountSchema, BlockUserRequestSchema, ArchiveUserRequestSchema, UnDeleteUserRequestSchema, BlockUserSuccess, ArchiveUserSuccess, UnDeleteUserSuccess, UserSearchResponseSchema, CustomerListResponseSchema, BulkActionPaginationSchema, PaginationSchema, SessionListResponseSchema, SessionDeleteResponseSchema, SessionsDeleteResponseSchema, APIError, SessionListResponseInfo, Conditions, UserResponseErrorSchema, UserGroupResponseSchema, UserGroupListResponseSchema, ConditionsSchema, DeleteBulkUserAttribute, UserAttributeFilter, UserAttributeFilterQuery, UserAttributeFilterRequestConditions, UserAttributeFiltered, UserAttributeFilteredList, CreateUserGroup, CreateUserRequestSchema, CreateUserResponseSchema, CreateUserSessionRequestSchema, CreateUserSessionResponseSchema, PlatformSchema, LookAndFeel, Login, MetaSchema, Social, RequiredFields, PlatformEmail, PlatformMobile, RegisterRequiredFields, RegisterRequiredFieldsEmail, RegisterRequiredFieldsMobile, FlashCard, SocialTokens, DeleteAccountReasons, DeleteAccountConsent, GetUserTimeline, UserTimeline, Facebook, Accountkit, Google, SessionExpiry, UpdateUserGroupSchema, PartialUserGroupUpdateSchema, UserGroupUpdateData, UpdateUserRequestSchema, UserEmails, UserPhoneNumbers, UserSchema, UserSearchSchema, PhoneNumber, Email, UserConsent, DeleteUserGroupSuccess, PrivacyPolicyConsentSchema };
720
726
  }
721
727
  /** @returns {SuccessMessage} */
722
728
  declare function SuccessMessage(): SuccessMessage;
@@ -733,6 +739,12 @@ type UserAttributeDefinitionList = {
733
739
  items?: UserAttributeDefinition[];
734
740
  page?: PaginationSchema;
735
741
  };
742
+ /** @returns {UserAttributeDefinitionsResponseSchema} */
743
+ declare function UserAttributeDefinitionsResponseSchema(): UserAttributeDefinitionsResponseSchema;
744
+ type UserAttributeDefinitionsResponseSchema = {
745
+ items?: UserAttribute[];
746
+ page?: PaginationSchema;
747
+ };
736
748
  /** @returns {UserAttributeDefinition} */
737
749
  declare function UserAttributeDefinition(): UserAttributeDefinition;
738
750
  type UserAttributeDefinition = {
@@ -810,6 +822,10 @@ type UserAttributeDefinition = {
810
822
  * - The version number of the attribute.
811
823
  */
812
824
  __v?: number;
825
+ /**
826
+ * - List of possible values for the attribute
827
+ */
828
+ options?: string[];
813
829
  };
814
830
  /** @returns {UserAttributeDefinitionDetails} */
815
831
  declare function UserAttributeDefinitionDetails(): UserAttributeDefinitionDetails;
@@ -12,6 +12,12 @@ const Joi = require("joi");
12
12
  * @property {PaginationSchema} [page]
13
13
  */
14
14
 
15
+ /**
16
+ * @typedef UserAttributeDefinitionsResponseSchema
17
+ * @property {UserAttribute[]} [items]
18
+ * @property {PaginationSchema} [page]
19
+ */
20
+
15
21
  /**
16
22
  * @typedef UserAttributeDefinition
17
23
  * @property {string} [_id] - The unique identifier for the attribute definition.
@@ -37,6 +43,7 @@ const Joi = require("joi");
37
43
  * @property {string} [created_at] - The creation date of the attribute.
38
44
  * @property {string} [modified_at] - The modification date of the attribute.
39
45
  * @property {number} [__v] - The version number of the attribute.
46
+ * @property {string[]} [options] - List of possible values for the attribute
40
47
  */
41
48
 
42
49
  /**
@@ -815,6 +822,14 @@ class UserPlatformModel {
815
822
  });
816
823
  }
817
824
 
825
+ /** @returns {UserAttributeDefinitionsResponseSchema} */
826
+ static UserAttributeDefinitionsResponseSchema() {
827
+ return Joi.object({
828
+ items: Joi.array().items(UserPlatformModel.UserAttribute()),
829
+ page: UserPlatformModel.PaginationSchema(),
830
+ });
831
+ }
832
+
818
833
  /** @returns {UserAttributeDefinition} */
819
834
  static UserAttributeDefinition() {
820
835
  return Joi.object({
@@ -838,6 +853,7 @@ class UserPlatformModel {
838
853
  created_at: Joi.string().allow(""),
839
854
  modified_at: Joi.string().allow(""),
840
855
  __v: Joi.number(),
856
+ options: Joi.array().items(Joi.string().allow("")),
841
857
  });
842
858
  }
843
859
 
@@ -932,7 +948,7 @@ class UserPlatformModel {
932
948
  static BulkUserAttributeRequestBody() {
933
949
  return Joi.object({
934
950
  definition_id: Joi.string().allow("").required(),
935
- value: Joi.object().pattern(/\S/, Joi.any()).required(),
951
+ value: Joi.any().required(),
936
952
  });
937
953
  }
938
954
 
@@ -1,19 +0,0 @@
1
- export = Webhook;
2
- declare class Webhook {
3
- constructor(_conf: any);
4
- _conf: any;
5
- _relativeUrls: {
6
- saveClickEvent: string;
7
- };
8
- _urls: {};
9
- updateUrls(urls: any): void;
10
- /**
11
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
12
- * @param {import("../ApplicationAPIClient").Options} - Options
13
- * @returns {Promise<ClickEventDetails>} - Success response
14
- * @name saveClickEvent
15
- * @summary: Capture and save click events from various sales channels
16
- * @description: Send click events from various sales channels to enable insightful data collection and analysis. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/webhook/saveClickEvent/).
17
- */
18
- saveClickEvent({ body, requestHeaders }?: object, { responseHeaders }?: import("../ApplicationAPIClient").Options): Promise<ClickEventDetails>;
19
- }
@@ -1,72 +0,0 @@
1
- const {
2
- FDKClientValidationError,
3
- FDKResponseValidationError,
4
- } = require("../../common/FDKError");
5
-
6
- const ApplicationAPIClient = require("../ApplicationAPIClient");
7
- const constructUrl = require("../constructUrl");
8
- const Paginator = require("../../common/Paginator");
9
- const { validateRequiredParams } = require("../../common/Validator");
10
-
11
- class Webhook {
12
- constructor(_conf) {
13
- this._conf = _conf;
14
- this._relativeUrls = {
15
- saveClickEvent:
16
- "/service/application/webhook/v1.0/click-analytics/events",
17
- };
18
- this._urls = Object.entries(this._relativeUrls).reduce(
19
- (urls, [method, relativeUrl]) => {
20
- urls[method] = `${_conf.domain}${relativeUrl}`;
21
- return urls;
22
- },
23
- {}
24
- );
25
- }
26
-
27
- updateUrls(urls) {
28
- this._urls = {
29
- ...this._urls,
30
- ...urls,
31
- };
32
- }
33
-
34
- /**
35
- * @param {object} [arg.requestHeaders={}] - Request headers. Default is `{}`
36
- * @param {import("../ApplicationAPIClient").Options} - Options
37
- * @returns {Promise<ClickEventDetails>} - Success response
38
- * @name saveClickEvent
39
- * @summary: Capture and save click events from various sales channels
40
- * @description: Send click events from various sales channels to enable insightful data collection and analysis. - Check out [method documentation](https://docs.fynd.com/partners/commerce/sdk/application/webhook/saveClickEvent/).
41
- */
42
- async saveClickEvent(
43
- { body, requestHeaders } = { requestHeaders: {} },
44
- { responseHeaders } = { responseHeaders: false }
45
- ) {
46
- const query_params = {};
47
-
48
- const xHeaders = {};
49
-
50
- const response = await ApplicationAPIClient.execute(
51
- this._conf,
52
- "post",
53
- constructUrl({
54
- url: this._urls["saveClickEvent"],
55
- params: {},
56
- }),
57
- query_params,
58
- body,
59
- { ...xHeaders, ...requestHeaders },
60
- { responseHeaders }
61
- );
62
-
63
- let responseData = response;
64
- if (responseHeaders) {
65
- responseData = response[0];
66
- }
67
-
68
- return response;
69
- }
70
- }
71
-
72
- module.exports = Webhook;