@wix/auto_sdk_consent-policy_cmp 1.0.5 → 1.0.6

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.
@@ -68,6 +68,9 @@ function getCmpConfig(payload) {
68
68
  method: "GET",
69
69
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
70
70
  packageName: PACKAGE_NAME,
71
+ migrationOptions: {
72
+ optInTransformResponse: true
73
+ },
71
74
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
72
75
  protoPath: "/v2/cmp-configs",
73
76
  data: payload,
@@ -108,6 +111,9 @@ function updateCmpConfig(payload) {
108
111
  method: "PATCH",
109
112
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
110
113
  packageName: PACKAGE_NAME,
114
+ migrationOptions: {
115
+ optInTransformResponse: true
116
+ },
111
117
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
112
118
  protoPath: "/v2/cmp-configs",
113
119
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../src/bu-legal-v2-cmp-config-cmp.public.ts","../../src/bu-legal-v2-cmp-config-cmp.context.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CmpConfig,\n UpdateCmpConfigApplicationErrors,\n getCmpConfig as universalGetCmpConfig,\n updateCmpConfig as universalUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/consent-policy' };\n\nexport function getCmpConfig(httpClient: HttpClient): GetCmpConfigSignature {\n return () =>\n universalGetCmpConfig(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCmpConfigSignature {\n /**\n * Retrieves a CMP config.\n * @returns Requested CMP config.\n */\n (): Promise<CmpConfig>;\n}\n\nexport function updateCmpConfig(\n httpClient: HttpClient\n): UpdateCmpConfigSignature {\n return (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>) =>\n universalUpdateCmpConfig(\n cmpConfig,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCmpConfigSignature {\n /**\n * Updates a CMP config.\n * @param - CMP config to be updated.\n * @returns Updated CMP config.\n */\n (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n >;\n}\n\nexport {\n ActionEvent,\n CmpConfig,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n WebhookIdentityType,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n","import {\n getCmpConfig as publicGetCmpConfig,\n updateCmpConfig as publicUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicGetCmpConfig> & typeof publicGetCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicGetCmpConfig);\nexport const updateCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCmpConfig> & typeof publicUpdateCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicUpdateCmpConfig);\n\nexport { WebhookIdentityType } from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n CmpConfig,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n WebhookIdentityTypeWithLiterals,\n UpdateCmpConfigApplicationErrors,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA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D;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AErSO,SAASE,cAAa,YAA+C;AAC1E,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,cACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC/BA,IAAAC,uBAAiC;AAG1B,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","WebhookIdentityType","getCmpConfig","sdkTransformError","updateCmpConfig","getCmpConfig","updateCmpConfig","import_rest_modules","getCmpConfig","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../src/bu-legal-v2-cmp-config-cmp.public.ts","../../src/bu-legal-v2-cmp-config-cmp.context.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CmpConfig,\n UpdateCmpConfigApplicationErrors,\n getCmpConfig as universalGetCmpConfig,\n updateCmpConfig as universalUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/consent-policy' };\n\nexport function getCmpConfig(httpClient: HttpClient): GetCmpConfigSignature {\n return () =>\n universalGetCmpConfig(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCmpConfigSignature {\n /**\n * Retrieves a CMP config.\n * @returns Requested CMP config.\n */\n (): Promise<CmpConfig>;\n}\n\nexport function updateCmpConfig(\n httpClient: HttpClient\n): UpdateCmpConfigSignature {\n return (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>) =>\n universalUpdateCmpConfig(\n cmpConfig,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCmpConfigSignature {\n /**\n * Updates a CMP config.\n * @param - CMP config to be updated.\n * @returns Updated CMP config.\n */\n (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n >;\n}\n\nexport {\n ActionEvent,\n CmpConfig,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n WebhookIdentityType,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n","import {\n getCmpConfig as publicGetCmpConfig,\n updateCmpConfig as publicUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicGetCmpConfig> & typeof publicGetCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicGetCmpConfig);\nexport const updateCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCmpConfig> & typeof publicUpdateCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicUpdateCmpConfig);\n\nexport { WebhookIdentityType } from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n CmpConfig,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n WebhookIdentityTypeWithLiterals,\n UpdateCmpConfigApplicationErrors,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA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eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AErSO,SAASE,cAAa,YAA+C;AAC1E,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,cACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC/BA,IAAAC,uBAAiC;AAG1B,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","WebhookIdentityType","getCmpConfig","sdkTransformError","updateCmpConfig","getCmpConfig","updateCmpConfig","import_rest_modules","getCmpConfig","updateCmpConfig"]}
@@ -68,6 +68,9 @@ function getCmpConfig(payload) {
68
68
  method: "GET",
69
69
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
70
70
  packageName: PACKAGE_NAME,
71
+ migrationOptions: {
72
+ optInTransformResponse: true
73
+ },
71
74
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
72
75
  protoPath: "/v2/cmp-configs",
73
76
  data: payload,
@@ -108,6 +111,9 @@ function updateCmpConfig(payload) {
108
111
  method: "PATCH",
109
112
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
110
113
  packageName: PACKAGE_NAME,
114
+ migrationOptions: {
115
+ optInTransformResponse: true
116
+ },
111
117
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
112
118
  protoPath: "/v2/cmp-configs",
113
119
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../src/bu-legal-v2-cmp-config-cmp.http.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,U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C/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","WebhookIdentityType","getCmpConfig","sdkTransformError","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../src/bu-legal-v2-cmp-config-cmp.http.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;A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,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAcA,eAAsBC,iBACpB,WAKA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAA0C,gBAAgB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","WebhookIdentityType","getCmpConfig","sdkTransformError","updateCmpConfig"]}
package/build/cjs/meta.js CHANGED
@@ -63,6 +63,9 @@ function getCmpConfig(payload) {
63
63
  method: "GET",
64
64
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
65
65
  packageName: PACKAGE_NAME,
66
+ migrationOptions: {
67
+ optInTransformResponse: true
68
+ },
66
69
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
67
70
  protoPath: "/v2/cmp-configs",
68
71
  data: payload,
@@ -103,6 +106,9 @@ function updateCmpConfig(payload) {
103
106
  method: "PATCH",
104
107
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
105
108
  packageName: PACKAGE_NAME,
109
+ migrationOptions: {
110
+ optInTransformResponse: true
111
+ },
106
112
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
107
113
  protoPath: "/v2/cmp-configs",
108
114
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../meta.ts","../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../src/bu-legal-v2-cmp-config-cmp.meta.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.meta.js';\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\nimport * as ambassadorWixBuLegalV2CmpConfigTypes from './bu-legal-v2-cmp-config-cmp.types.js';\nimport * as ambassadorWixBuLegalV2CmpConfigUniversalTypes from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getCmpConfig(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateCmpConfig(): __PublicMethodMetaInfo<\n 'PATCH',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'PATCH',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,uCACP,M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AAA,IACF,CAAC;AACD,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,MAAM;AAAA,MACN,mBAAmB,CAACA,iBAClB,uCAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO;AAAA,YACL,EAAE,MAAM,wBAAwB;AAAA,YAChC,EAAE,MAAM,wBAAwB;AAAA,UAClC;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACL;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC3FO,SAASC,gBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC4B,aAAa,OAAO;AAEtD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,mBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC4B,gBAAgB,OAAO;AAEzD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","getCmpConfig","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../meta.ts","../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../src/bu-legal-v2-cmp-config-cmp.meta.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.meta.js';\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\nimport * as ambassadorWixBuLegalV2CmpConfigTypes from './bu-legal-v2-cmp-config-cmp.types.js';\nimport * as ambassadorWixBuLegalV2CmpConfigUniversalTypes from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getCmpConfig(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateCmpConfig(): __PublicMethodMetaInfo<\n 'PATCH',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'PATCH',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uB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AuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","getCmpConfig","updateCmpConfig"]}
@@ -43,6 +43,9 @@ function getCmpConfig(payload) {
43
43
  method: "GET",
44
44
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
45
45
  packageName: PACKAGE_NAME,
46
+ migrationOptions: {
47
+ optInTransformResponse: true
48
+ },
46
49
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
47
50
  protoPath: "/v2/cmp-configs",
48
51
  data: payload,
@@ -83,6 +86,9 @@ function updateCmpConfig(payload) {
83
86
  method: "PATCH",
84
87
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
85
88
  packageName: PACKAGE_NAME,
89
+ migrationOptions: {
90
+ optInTransformResponse: true
91
+ },
86
92
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
87
93
  protoPath: "/v2/cmp-configs",
88
94
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../src/bu-legal-v2-cmp-config-cmp.public.ts","../../src/bu-legal-v2-cmp-config-cmp.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CmpConfig,\n UpdateCmpConfigApplicationErrors,\n getCmpConfig as universalGetCmpConfig,\n updateCmpConfig as universalUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/consent-policy' };\n\nexport function getCmpConfig(httpClient: HttpClient): GetCmpConfigSignature {\n return () =>\n universalGetCmpConfig(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCmpConfigSignature {\n /**\n * Retrieves a CMP config.\n * @returns Requested CMP config.\n */\n (): Promise<CmpConfig>;\n}\n\nexport function updateCmpConfig(\n httpClient: HttpClient\n): UpdateCmpConfigSignature {\n return (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>) =>\n universalUpdateCmpConfig(\n cmpConfig,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCmpConfigSignature {\n /**\n * Updates a CMP config.\n * @param - CMP config to be updated.\n * @returns Updated CMP config.\n */\n (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n >;\n}\n\nexport {\n ActionEvent,\n CmpConfig,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n WebhookIdentityType,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n","import {\n getCmpConfig as publicGetCmpConfig,\n updateCmpConfig as publicUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicGetCmpConfig> & typeof publicGetCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicGetCmpConfig);\nexport const updateCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCmpConfig> & typeof publicUpdateCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicUpdateCmpConfig);\n\nexport { WebhookIdentityType } from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n CmpConfig,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n WebhookIdentityTypeWithLiterals,\n UpdateCmpConfigApplicationErrors,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;A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AAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AErSO,SAASC,cAAa,YAA+C;AAC1E,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,cACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC/BA,SAAS,wBAAwB;AAG1B,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,iCAAiBA,gBAAqB;","names":["payload","WebhookIdentityType","getCmpConfig","updateCmpConfig","getCmpConfig","updateCmpConfig","getCmpConfig","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../src/bu-legal-v2-cmp-config-cmp.public.ts","../../src/bu-legal-v2-cmp-config-cmp.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CmpConfig,\n UpdateCmpConfigApplicationErrors,\n getCmpConfig as universalGetCmpConfig,\n updateCmpConfig as universalUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/consent-policy' };\n\nexport function getCmpConfig(httpClient: HttpClient): GetCmpConfigSignature {\n return () =>\n universalGetCmpConfig(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCmpConfigSignature {\n /**\n * Retrieves a CMP config.\n * @returns Requested CMP config.\n */\n (): Promise<CmpConfig>;\n}\n\nexport function updateCmpConfig(\n httpClient: HttpClient\n): UpdateCmpConfigSignature {\n return (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>) =>\n universalUpdateCmpConfig(\n cmpConfig,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCmpConfigSignature {\n /**\n * Updates a CMP config.\n * @param - CMP config to be updated.\n * @returns Updated CMP config.\n */\n (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n >;\n}\n\nexport {\n ActionEvent,\n CmpConfig,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n WebhookIdentityType,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n","import {\n getCmpConfig as publicGetCmpConfig,\n updateCmpConfig as publicUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicGetCmpConfig> & typeof publicGetCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicGetCmpConfig);\nexport const updateCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCmpConfig> & typeof publicUpdateCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicUpdateCmpConfig);\n\nexport { WebhookIdentityType } from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n CmpConfig,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n WebhookIdentityTypeWithLiterals,\n UpdateCmpConfigApplicationErrors,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;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BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AErSO,SAASC,cAAa,YAA+C;AAC1E,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,cACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC/BA,SAAS,wBAAwB;AAG1B,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,iCAAiBA,gBAAqB;","names":["payload","WebhookIdentityType","getCmpConfig","updateCmpConfig","getCmpConfig","updateCmpConfig","getCmpConfig","updateCmpConfig"]}
@@ -43,6 +43,9 @@ function getCmpConfig(payload) {
43
43
  method: "GET",
44
44
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
45
45
  packageName: PACKAGE_NAME,
46
+ migrationOptions: {
47
+ optInTransformResponse: true
48
+ },
46
49
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
47
50
  protoPath: "/v2/cmp-configs",
48
51
  data: payload,
@@ -83,6 +86,9 @@ function updateCmpConfig(payload) {
83
86
  method: "PATCH",
84
87
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
85
88
  packageName: PACKAGE_NAME,
89
+ migrationOptions: {
90
+ optInTransformResponse: true
91
+ },
86
92
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
87
93
  protoPath: "/v2/cmp-configs",
88
94
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../src/bu-legal-v2-cmp-config-cmp.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;AACrC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,QAAQ,kBAA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eAAsBC,gBAAmC;AAEvD,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC,CAAC,CAAC;AAExD,QAAM,UAA0C,aAAa,OAAO;AAEpE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAcA,eAAsBC,iBACpB,WAKA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAA0C,gBAAgB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","WebhookIdentityType","getCmpConfig","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../src/bu-legal-v2-cmp-config-cmp.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;AACrC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AA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AC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","WebhookIdentityType","getCmpConfig","updateCmpConfig"]}
package/build/es/meta.mjs CHANGED
@@ -36,6 +36,9 @@ function getCmpConfig(payload) {
36
36
  method: "GET",
37
37
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
38
38
  packageName: PACKAGE_NAME,
39
+ migrationOptions: {
40
+ optInTransformResponse: true
41
+ },
39
42
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
40
43
  protoPath: "/v2/cmp-configs",
41
44
  data: payload,
@@ -76,6 +79,9 @@ function updateCmpConfig(payload) {
76
79
  method: "PATCH",
77
80
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
78
81
  packageName: PACKAGE_NAME,
82
+ migrationOptions: {
83
+ optInTransformResponse: true
84
+ },
79
85
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
80
86
  protoPath: "/v2/cmp-configs",
81
87
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../src/bu-legal-v2-cmp-config-cmp.meta.ts"],"sourcesContent":["import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\nimport * as ambassadorWixBuLegalV2CmpConfigTypes from './bu-legal-v2-cmp-config-cmp.types.js';\nimport * as ambassadorWixBuLegalV2CmpConfigUniversalTypes from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getCmpConfig(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateCmpConfig(): __PublicMethodMetaInfo<\n 'PATCH',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'PATCH',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;AACrC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,QAAQ,kBAAkB,OAAO;AAAA,MACjC,mBAAmB,CAACA,aAClB,eAAeA,UAAS;AAAA,QACtB;AAAA,UACE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AAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,mBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC4B,gBAAgB,OAAO;AAEzD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","getCmpConfig","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../src/bu-legal-v2-cmp-config-cmp.meta.ts"],"sourcesContent":["import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\nimport * as ambassadorWixBuLegalV2CmpConfigTypes from './bu-legal-v2-cmp-config-cmp.types.js';\nimport * as ambassadorWixBuLegalV2CmpConfigUniversalTypes from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getCmpConfig(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateCmpConfig(): __PublicMethodMetaInfo<\n 'PATCH',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'PATCH',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;AACrC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,QAAQ,kBAAkB,OAAO;AAAA,MACjC,mBAAmB,CAACA,aAClB,eAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO;AAAA,YACL,EAAE,MAAM,wBAAwB;AAAA,YAChC,EAAE,MAAM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ACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,mBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC4B,gBAAgB,OAAO;AAEzD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","getCmpConfig","updateCmpConfig"]}
@@ -68,6 +68,9 @@ function getCmpConfig(payload) {
68
68
  method: "GET",
69
69
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
70
70
  packageName: PACKAGE_NAME,
71
+ migrationOptions: {
72
+ optInTransformResponse: true
73
+ },
71
74
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
72
75
  protoPath: "/v2/cmp-configs",
73
76
  data: payload,
@@ -108,6 +111,9 @@ function updateCmpConfig(payload) {
108
111
  method: "PATCH",
109
112
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
110
113
  packageName: PACKAGE_NAME,
114
+ migrationOptions: {
115
+ optInTransformResponse: true
116
+ },
111
117
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
112
118
  protoPath: "/v2/cmp-configs",
113
119
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../index.ts","../../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../../src/bu-legal-v2-cmp-config-cmp.public.ts","../../../src/bu-legal-v2-cmp-config-cmp.context.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CmpConfig,\n UpdateCmpConfigApplicationErrors,\n getCmpConfig as universalGetCmpConfig,\n updateCmpConfig as universalUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/consent-policy' };\n\nexport function getCmpConfig(httpClient: HttpClient): GetCmpConfigSignature {\n return () =>\n universalGetCmpConfig(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCmpConfigSignature {\n /**\n * Retrieves a CMP config.\n * @returns Requested CMP config.\n */\n (): Promise<CmpConfig>;\n}\n\nexport function updateCmpConfig(\n httpClient: HttpClient\n): UpdateCmpConfigSignature {\n return (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>) =>\n universalUpdateCmpConfig(\n cmpConfig,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCmpConfigSignature {\n /**\n * Updates a CMP config.\n * @param - CMP config to be updated.\n * @returns Updated CMP config.\n */\n (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n >;\n}\n\nexport {\n ActionEvent,\n CmpConfig,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n WebhookIdentityType,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n","import {\n getCmpConfig as publicGetCmpConfig,\n updateCmpConfig as publicUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicGetCmpConfig> & typeof publicGetCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicGetCmpConfig);\nexport const updateCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCmpConfig> & typeof publicUpdateCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicUpdateCmpConfig);\n\nexport { WebhookIdentityType } from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n CmpConfig,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n WebhookIdentityTypeWithLiterals,\n UpdateCmpConfigApplicationErrors,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3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,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAA0C,gBAAgB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AErSO,SAASE,cAAa,YAA+C;AAC1E,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,cACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC/BA,IAAAC,uBAAiC;AAG1B,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","WebhookIdentityType","getCmpConfig","sdkTransformError","updateCmpConfig","getCmpConfig","updateCmpConfig","import_rest_modules","getCmpConfig","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../../index.ts","../../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../../src/bu-legal-v2-cmp-config-cmp.public.ts","../../../src/bu-legal-v2-cmp-config-cmp.context.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CmpConfig,\n UpdateCmpConfigApplicationErrors,\n getCmpConfig as universalGetCmpConfig,\n updateCmpConfig as universalUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/consent-policy' };\n\nexport function getCmpConfig(httpClient: HttpClient): GetCmpConfigSignature {\n return () =>\n universalGetCmpConfig(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCmpConfigSignature {\n /**\n * Retrieves a CMP config.\n * @returns Requested CMP config.\n */\n (): Promise<CmpConfig>;\n}\n\nexport function updateCmpConfig(\n httpClient: HttpClient\n): UpdateCmpConfigSignature {\n return (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>) =>\n universalUpdateCmpConfig(\n cmpConfig,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCmpConfigSignature {\n /**\n * Updates a CMP config.\n * @param - CMP config to be updated.\n * @returns Updated CMP config.\n */\n (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n >;\n}\n\nexport {\n ActionEvent,\n CmpConfig,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n WebhookIdentityType,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n","import {\n getCmpConfig as publicGetCmpConfig,\n updateCmpConfig as publicUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicGetCmpConfig> & typeof publicGetCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicGetCmpConfig);\nexport const updateCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCmpConfig> & typeof publicUpdateCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicUpdateCmpConfig);\n\nexport { WebhookIdentityType } from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n CmpConfig,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n WebhookIdentityTypeWithLiterals,\n UpdateCmpConfigApplicationErrors,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,u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AwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAcA,eAAsBC,iBACpB,WAKA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAA0C,gBAAgB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AErSO,SAASE,cAAa,YAA+C;AAC1E,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,cACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC/BA,IAAAC,uBAAiC;AAG1B,IAAMC,gBAEK,2DAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,2DAAiBA,gBAAqB;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","WebhookIdentityType","getCmpConfig","sdkTransformError","updateCmpConfig","getCmpConfig","updateCmpConfig","import_rest_modules","getCmpConfig","updateCmpConfig"]}
@@ -68,6 +68,9 @@ function getCmpConfig(payload) {
68
68
  method: "GET",
69
69
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
70
70
  packageName: PACKAGE_NAME,
71
+ migrationOptions: {
72
+ optInTransformResponse: true
73
+ },
71
74
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
72
75
  protoPath: "/v2/cmp-configs",
73
76
  data: payload,
@@ -108,6 +111,9 @@ function updateCmpConfig(payload) {
108
111
  method: "PATCH",
109
112
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
110
113
  packageName: PACKAGE_NAME,
114
+ migrationOptions: {
115
+ optInTransformResponse: true
116
+ },
111
117
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
112
118
  protoPath: "/v2/cmp-configs",
113
119
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../index.typings.ts","../../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../../src/bu-legal-v2-cmp-config-cmp.http.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACr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AAA,EACR;AACF;AAcA,eAAsBC,iBACpB,WAKA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAA0C,gBAAgB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","WebhookIdentityType","getCmpConfig","sdkTransformError","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../../index.typings.ts","../../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../../src/bu-legal-v2-cmp-config-cmp.http.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;AACrC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,YAAQ,uCAAkB,OAAO;AAAA,MACjC,mBAAmB,CAACC,iBAClB,uCAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO;AAAA,YACL,EAAE,MAAM,wBAAwB;AAAA,YAChC,EAAE,MAAM,wBAAwB;AAAA,UAClC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AA0C,aAAa,OAAO;AAEpE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAC;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAcA,eAAsBC,iBACpB,WAKA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAA0C,gBAAgB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","WebhookIdentityType","getCmpConfig","sdkTransformError","updateCmpConfig"]}
@@ -63,6 +63,9 @@ function getCmpConfig(payload) {
63
63
  method: "GET",
64
64
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
65
65
  packageName: PACKAGE_NAME,
66
+ migrationOptions: {
67
+ optInTransformResponse: true
68
+ },
66
69
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
67
70
  protoPath: "/v2/cmp-configs",
68
71
  data: payload,
@@ -103,6 +106,9 @@ function updateCmpConfig(payload) {
103
106
  method: "PATCH",
104
107
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
105
108
  packageName: PACKAGE_NAME,
109
+ migrationOptions: {
110
+ optInTransformResponse: true
111
+ },
106
112
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
107
113
  protoPath: "/v2/cmp-configs",
108
114
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../meta.ts","../../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../../src/bu-legal-v2-cmp-config-cmp.meta.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.meta.js';\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\nimport * as ambassadorWixBuLegalV2CmpConfigTypes from './bu-legal-v2-cmp-config-cmp.types.js';\nimport * as ambassadorWixBuLegalV2CmpConfigUniversalTypes from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getCmpConfig(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateCmpConfig(): __PublicMethodMetaInfo<\n 'PATCH',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'PATCH',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;AACrC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,YAAQ,uCAAkB,OAAO;AAAA,MACjC,mBAAmB,CAACC,iBAClB,uCAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO;AAAA,YACL,EAAE,MAAM,wBAAwB;AAAA,YAChC,EAAE,MAAM,wBAAwB;AAAA,UAClC;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACL;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;AAGO,SAAS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B;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","getCmpConfig","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../../meta.ts","../../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../../src/bu-legal-v2-cmp-config-cmp.meta.ts"],"sourcesContent":["export * from './src/bu-legal-v2-cmp-config-cmp.meta.js';\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\nimport * as ambassadorWixBuLegalV2CmpConfigTypes from './bu-legal-v2-cmp-config-cmp.types.js';\nimport * as ambassadorWixBuLegalV2CmpConfigUniversalTypes from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getCmpConfig(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateCmpConfig(): __PublicMethodMetaInfo<\n 'PATCH',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'PATCH',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,sBAAAA;AAAA,EAAA,uBAAAC;AAAA;AAAA;;;ACAA,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,wBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;AACrC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA,MACb,kBAAkB;AAAA,QAChB,wBAAwB;AAAA,MAC1B;AAAA,MACA,KAAK,uCAAuC;AAAA,QAC1C,WAAW;AAAA,QACX,MAAM;AAAA,QACN;AAAA,MACF,CAAC;AAAA,MACD,YAAQ,uCAAkB,OAAO;AAAA,MACjC,mBAAmB,CAACC,iBAClB,uCAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO;AAAA,YACL,EAAE,MAAM,wBAAwB;AAAA,YAChC,EAAE,MAAM,wBAAwB;AAAA,UAClC;AAAA,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,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,mBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC4B,gBAAgB,OAAO;AAEzD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["getCmpConfig","updateCmpConfig","import_timestamp","import_rest_modules","payload","getCmpConfig","updateCmpConfig"]}
@@ -43,6 +43,9 @@ function getCmpConfig(payload) {
43
43
  method: "GET",
44
44
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
45
45
  packageName: PACKAGE_NAME,
46
+ migrationOptions: {
47
+ optInTransformResponse: true
48
+ },
46
49
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
47
50
  protoPath: "/v2/cmp-configs",
48
51
  data: payload,
@@ -83,6 +86,9 @@ function updateCmpConfig(payload) {
83
86
  method: "PATCH",
84
87
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
85
88
  packageName: PACKAGE_NAME,
89
+ migrationOptions: {
90
+ optInTransformResponse: true
91
+ },
86
92
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
87
93
  protoPath: "/v2/cmp-configs",
88
94
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../../src/bu-legal-v2-cmp-config-cmp.public.ts","../../../src/bu-legal-v2-cmp-config-cmp.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CmpConfig,\n UpdateCmpConfigApplicationErrors,\n getCmpConfig as universalGetCmpConfig,\n updateCmpConfig as universalUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/consent-policy' };\n\nexport function getCmpConfig(httpClient: HttpClient): GetCmpConfigSignature {\n return () =>\n universalGetCmpConfig(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCmpConfigSignature {\n /**\n * Retrieves a CMP config.\n * @returns Requested CMP config.\n */\n (): Promise<CmpConfig>;\n}\n\nexport function updateCmpConfig(\n httpClient: HttpClient\n): UpdateCmpConfigSignature {\n return (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>) =>\n universalUpdateCmpConfig(\n cmpConfig,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCmpConfigSignature {\n /**\n * Updates a CMP config.\n * @param - CMP config to be updated.\n * @returns Updated CMP config.\n */\n (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n >;\n}\n\nexport {\n ActionEvent,\n CmpConfig,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n WebhookIdentityType,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n","import {\n getCmpConfig as publicGetCmpConfig,\n updateCmpConfig as publicUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicGetCmpConfig> & typeof publicGetCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicGetCmpConfig);\nexport const updateCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCmpConfig> & typeof publicUpdateCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicUpdateCmpConfig);\n\nexport { WebhookIdentityType } from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n CmpConfig,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n WebhookIdentityTypeWithLiterals,\n UpdateCmpConfigApplicationErrors,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAA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AAA,EACF,CAAC;AAED,QAAM,UAA0C,gBAAgB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AErSO,SAASC,cAAa,YAA+C;AAC1E,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,cACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC/BA,SAAS,wBAAwB;AAG1B,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,iCAAiBA,gBAAqB;","names":["payload","WebhookIdentityType","getCmpConfig","updateCmpConfig","getCmpConfig","updateCmpConfig","getCmpConfig","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../../src/bu-legal-v2-cmp-config-cmp.public.ts","../../../src/bu-legal-v2-cmp-config-cmp.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n CmpConfig,\n UpdateCmpConfigApplicationErrors,\n getCmpConfig as universalGetCmpConfig,\n updateCmpConfig as universalUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/consent-policy' };\n\nexport function getCmpConfig(httpClient: HttpClient): GetCmpConfigSignature {\n return () =>\n universalGetCmpConfig(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetCmpConfigSignature {\n /**\n * Retrieves a CMP config.\n * @returns Requested CMP config.\n */\n (): Promise<CmpConfig>;\n}\n\nexport function updateCmpConfig(\n httpClient: HttpClient\n): UpdateCmpConfigSignature {\n return (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>) =>\n universalUpdateCmpConfig(\n cmpConfig,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateCmpConfigSignature {\n /**\n * Updates a CMP config.\n * @param - CMP config to be updated.\n * @returns Updated CMP config.\n */\n (cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n >;\n}\n\nexport {\n ActionEvent,\n CmpConfig,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n MessageEnvelope,\n RestoreInfo,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n WebhookIdentityType,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n","import {\n getCmpConfig as publicGetCmpConfig,\n updateCmpConfig as publicUpdateCmpConfig,\n} from './bu-legal-v2-cmp-config-cmp.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicGetCmpConfig> & typeof publicGetCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicGetCmpConfig);\nexport const updateCmpConfig: MaybeContext<\n BuildRESTFunction<typeof publicUpdateCmpConfig> & typeof publicUpdateCmpConfig\n> = /*#__PURE__*/ createRESTModule(publicUpdateCmpConfig);\n\nexport { WebhookIdentityType } from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n CmpConfig,\n GetCmpConfigRequest,\n GetCmpConfigResponse,\n UpdateCmpConfigRequest,\n UpdateCmpConfigResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\nexport {\n WebhookIdentityTypeWithLiterals,\n UpdateCmpConfigApplicationErrors,\n} from './bu-legal-v2-cmp-config-cmp.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA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AM,UAAU,sCAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAA0C,gBAAgB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AErSO,SAASC,cAAa,YAA+C;AAC1E,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAUO,SAASC,iBACd,YAC0B;AAC1B,SAAO,CAAC,cACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;AC/BA,SAAS,wBAAwB;AAG1B,IAAMC,gBAEK,iCAAiBA,aAAkB;AAC9C,IAAMC,mBAEK,iCAAiBA,gBAAqB;","names":["payload","WebhookIdentityType","getCmpConfig","updateCmpConfig","getCmpConfig","updateCmpConfig","getCmpConfig","updateCmpConfig"]}
@@ -43,6 +43,9 @@ function getCmpConfig(payload) {
43
43
  method: "GET",
44
44
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
45
45
  packageName: PACKAGE_NAME,
46
+ migrationOptions: {
47
+ optInTransformResponse: true
48
+ },
46
49
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
47
50
  protoPath: "/v2/cmp-configs",
48
51
  data: payload,
@@ -83,6 +86,9 @@ function updateCmpConfig(payload) {
83
86
  method: "PATCH",
84
87
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
85
88
  packageName: PACKAGE_NAME,
89
+ migrationOptions: {
90
+ optInTransformResponse: true
91
+ },
86
92
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
87
93
  protoPath: "/v2/cmp-configs",
88
94
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../../src/bu-legal-v2-cmp-config-cmp.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OA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AwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","WebhookIdentityType","getCmpConfig","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../../src/bu-legal-v2-cmp-config-cmp.universal.ts","../../../src/bu-legal-v2-cmp-config-cmp.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\n\n/**\n * A CMP Config is a collection of settings and parameters defined within a consent management platform.\n *\n * Currently only contains a toggle to manage the visibility of social components until site visitors provide their consent.\n */\nexport interface CmpConfig {\n /**\n * Revision number, which increments by 1 each time the CMP config is updated.\n * To prevent conflicting changes,\n * the current revision must be passed when updating the CMP config.\n * @readonly\n */\n revision?: string | null;\n /**\n * Date and time the CMP config was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the CMP config was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Whether elements are blocked until consent is given. */\n socialElementsBlocked?: boolean | null;\n}\n\nexport interface GetCmpConfigRequest {}\n\nexport interface GetCmpConfigResponse {\n /** Requested CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface UpdateCmpConfigRequest {\n /** CMP config to be updated. */\n cmpConfig: CmpConfig;\n}\n\nexport interface UpdateCmpConfigResponse {\n /** Updated CMP config. */\n cmpConfig?: CmpConfig;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n/** @docsIgnore */\nexport type UpdateCmpConfigApplicationErrors = {\n code?: 'NO_HTML_WEB_APPLICATION_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\n\n/**\n * Retrieves a CMP config.\n * @public\n * @documentationMaturity preview\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_READ\n * @applicableIdentity APP\n * @returns Requested CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.GetCmpConfig\n */\nexport async function getCmpConfig(): Promise<CmpConfig> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates a CMP config.\n * @param cmpConfig - CMP config to be updated.\n * @public\n * @documentationMaturity preview\n * @requiredField cmpConfig\n * @requiredField cmpConfig.revision\n * @permissionId COOKIE_CONSENT.CMP_CONFIG_UPDATE\n * @applicableIdentity APP\n * @returns Updated CMP config.\n * @fqn wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig\n */\nexport async function updateCmpConfig(\n cmpConfig: NonNullablePaths<CmpConfig, `revision`, 2>\n): Promise<\n CmpConfig & {\n __applicationErrorsType?: UpdateCmpConfigApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n cmpConfig: cmpConfig,\n });\n\n const reqOpts = ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.cmpConfig!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { cmpConfig: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['cmpConfig']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;A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AgB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI,GAAG;AAAA,EAC/D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,WAAW,OAAO;AAAA,QAC9C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,WAAW;AAAA,IACd;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","WebhookIdentityType","getCmpConfig","updateCmpConfig"]}
@@ -36,6 +36,9 @@ function getCmpConfig(payload) {
36
36
  method: "GET",
37
37
  methodFqn: "wix.bu.legal.v2.CmpConfigService.GetCmpConfig",
38
38
  packageName: PACKAGE_NAME,
39
+ migrationOptions: {
40
+ optInTransformResponse: true
41
+ },
39
42
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
40
43
  protoPath: "/v2/cmp-configs",
41
44
  data: payload,
@@ -76,6 +79,9 @@ function updateCmpConfig(payload) {
76
79
  method: "PATCH",
77
80
  methodFqn: "wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig",
78
81
  packageName: PACKAGE_NAME,
82
+ migrationOptions: {
83
+ optInTransformResponse: true
84
+ },
79
85
  url: resolveWixBuLegalV2CmpConfigServiceUrl({
80
86
  protoPath: "/v2/cmp-configs",
81
87
  data: serializedData,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../../src/bu-legal-v2-cmp-config-cmp.meta.ts"],"sourcesContent":["import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\nimport * as ambassadorWixBuLegalV2CmpConfigTypes from './bu-legal-v2-cmp-config-cmp.types.js';\nimport * as ambassadorWixBuLegalV2CmpConfigUniversalTypes from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getCmpConfig(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateCmpConfig(): __PublicMethodMetaInfo<\n 'PATCH',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'PATCH',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,aAAa,SAA6C;A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,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;AC3FO,SAASC,gBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC4B,aAAa,OAAO;AAEtD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,mBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC4B,gBAAgB,OAAO;AAEzD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","getCmpConfig","updateCmpConfig"]}
1
+ {"version":3,"sources":["../../../src/bu-legal-v2-cmp-config-cmp.http.ts","../../../src/bu-legal-v2-cmp-config-cmp.meta.ts"],"sourcesContent":["import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformSDKFieldMaskToRESTFieldMask } from '@wix/sdk-runtime/transformations/field-mask';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixBuLegalV2CmpConfigServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/cmp-config-v2',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cmp-config-v2',\n destPath: '/api',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/consent/cmp',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_consent-policy_cmp';\n\n/** Retrieves a CMP config. */\nexport function getCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __getCmpConfig({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'GET' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.GetCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __getCmpConfig;\n}\n\n/** Updates a CMP config. */\nexport function updateCmpConfig(payload: object): RequestOptionsFactory<any> {\n function __updateCmpConfig({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFieldMaskToRESTFieldMask,\n paths: [{ path: 'fieldMask' }],\n },\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.bu.legal.v2.cmp_config',\n method: 'PATCH' as any,\n methodFqn: 'wix.bu.legal.v2.CmpConfigService.UpdateCmpConfig',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixBuLegalV2CmpConfigServiceUrl({\n protoPath: '/v2/cmp-configs',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'cmpConfig.createdDate' },\n { path: 'cmpConfig.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __updateCmpConfig;\n}\n","import * as ambassadorWixBuLegalV2CmpConfig from './bu-legal-v2-cmp-config-cmp.http.js';\nimport * as ambassadorWixBuLegalV2CmpConfigTypes from './bu-legal-v2-cmp-config-cmp.types.js';\nimport * as ambassadorWixBuLegalV2CmpConfigUniversalTypes from './bu-legal-v2-cmp-config-cmp.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getCmpConfig(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.GetCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.GetCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.getCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateCmpConfig(): __PublicMethodMetaInfo<\n 'PATCH',\n {},\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigRequest,\n ambassadorWixBuLegalV2CmpConfigUniversalTypes.UpdateCmpConfigResponse,\n ambassadorWixBuLegalV2CmpConfigTypes.UpdateCmpConfigResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixBuLegalV2CmpConfig.updateCmpConfig(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'PATCH',\n path: '/v2/cmp-configs',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,uCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAGd,SAAS,aAAa,SAA6C;AACxE,WAAS,eAAe,EAAE,KAAK,GAAQ;AACrC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,aAAa;AAAA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,SAAO;AACT;;;ACjGO,SAASC,gBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC4B,aAAa,OAAO;AAEtD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,mBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC4B,gBAAgB,OAAO;AAEzD,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","getCmpConfig","updateCmpConfig"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_consent-policy_cmp",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -50,5 +50,5 @@
50
50
  "fqdn": "wix.bu.legal.v2.cmp_config"
51
51
  }
52
52
  },
53
- "falconPackageHash": "7e536764220bd2519c63da0de7da07003f5ba3fec1e0793164478c25"
53
+ "falconPackageHash": "8032f34429964e3d171451c97a77cb83bb9d00b640b222d8e76958b1"
54
54
  }