From 7c961d19cf9669c9c8f02ab2a5fedc9320cff325 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Grudzie=C5=84?= Date: Fri, 17 May 2024 12:38:48 +0200 Subject: [PATCH] name change --- modules/{pirIdSystem.js => ceeIdSystem.js} | 20 +++++++++---------- modules/{pirIdSystem.md => ceeIdSystem.md} | 8 ++++---- ...irIdSystem_spec.js => ceeIdSystem_spec.js} | 20 +++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) rename modules/{pirIdSystem.js => ceeIdSystem.js} (78%) rename modules/{pirIdSystem.md => ceeIdSystem.md} (77%) rename test/spec/modules/{pirIdSystem_spec.js => ceeIdSystem_spec.js} (74%) diff --git a/modules/pirIdSystem.js b/modules/ceeIdSystem.js similarity index 78% rename from modules/pirIdSystem.js rename to modules/ceeIdSystem.js index b891e1d362a..9c8f1409fd3 100644 --- a/modules/pirIdSystem.js +++ b/modules/ceeIdSystem.js @@ -1,7 +1,7 @@ /** - * This module adds pirId to the User ID module + * This module adds ceeId to the User ID module * The {@link module:modules/userId} module is required - * @module modules/pirId + * @module modules/ceeId * @requires module:modules/userId */ @@ -15,7 +15,7 @@ import {domainOverrideToRootDomain} from '../libraries/domainOverrideToRootDomai * @typedef {import('../modules/userId/index.js').IdResponse} IdResponse */ -const MODULE_NAME = 'pirId'; +const MODULE_NAME = 'ceeId'; const ID_TOKEN = 'WPxid'; export const storage = getStorageManager({ moduleName: MODULE_NAME, moduleType: MODULE_TYPE_UID }); @@ -26,7 +26,7 @@ export const storage = getStorageManager({ moduleName: MODULE_NAME, moduleType: export const readId = () => storage.getDataFromLocalStorage(ID_TOKEN) || storage.getCookie(ID_TOKEN); /** @type {Submodule} */ -export const pirIdSubmodule = { +export const ceeIdSubmodule = { name: MODULE_NAME, gvlid: 676, @@ -37,7 +37,7 @@ export const pirIdSubmodule = { * @returns {(Object|undefined)} */ decode(value) { - return typeof value === 'string' ? { 'pirId': value } : undefined; + return typeof value === 'string' ? { 'ceeId': value } : undefined; }, /** @@ -46,17 +46,17 @@ export const pirIdSubmodule = { * @returns {(IdResponse|undefined)} */ getId() { - const pirIdToken = readId(); + const ceeIdToken = readId(); - return pirIdToken ? { id: pirIdToken } : undefined; + return ceeIdToken ? { id: ceeIdToken } : undefined; }, domainOverride: domainOverrideToRootDomain(storage, MODULE_NAME), eids: { - 'pirId': { - source: 'pir.wp.pl', + 'ceeId': { + source: 'ceeid.eu', atype: 1 }, }, }; -submodule('userId', pirIdSubmodule); +submodule('userId', ceeIdSubmodule); diff --git a/modules/pirIdSystem.md b/modules/ceeIdSystem.md similarity index 77% rename from modules/pirIdSystem.md rename to modules/ceeIdSystem.md index 913804f85c4..811efe08069 100644 --- a/modules/pirIdSystem.md +++ b/modules/ceeIdSystem.md @@ -1,6 +1,6 @@ # Overview -Module Name: pirIDSystem +Module Name: ceeIdSystem Module Type: UserID Module Maintainer: pawel.grudzien@grupawp.pl @@ -14,13 +14,13 @@ User identification system for WPM pbjs.setConfig({ userSync: { userIds: [{ - name: 'pirID', + name: 'ceeId', storage: { type: 'cookie', - name: 'pirIdToken', + name: 'ceeIdToken', expires: 7, refreshInSeconds: 360 - }, + } }] } }); diff --git a/test/spec/modules/pirIdSystem_spec.js b/test/spec/modules/ceeIdSystem_spec.js similarity index 74% rename from test/spec/modules/pirIdSystem_spec.js rename to test/spec/modules/ceeIdSystem_spec.js index 5acc5a5eb9c..049e596ad15 100644 --- a/test/spec/modules/pirIdSystem_spec.js +++ b/test/spec/modules/ceeIdSystem_spec.js @@ -1,7 +1,7 @@ -import { pirIdSubmodule, storage, readId } from 'modules/pirIdSystem.js'; +import { ceeIdSubmodule, storage, readId } from 'modules/ceeIdSystem.js'; import sinon from 'sinon'; -describe('pirIdSystem', () => { +describe('ceeIdSystem', () => { let sandbox; let getCookieStub; let getDataFromLocalStorageStub; @@ -17,31 +17,31 @@ describe('pirIdSystem', () => { }); describe('getId', () => { - it('should return an object with id when pirIdToken is found', () => { + it('should return an object with id when ceeIdToken is found', () => { getDataFromLocalStorageStub.returns('testToken'); getCookieStub.returns('testToken'); - const result = pirIdSubmodule.getId(); + const result = ceeIdSubmodule.getId(); expect(result).to.deep.equal({ id: 'testToken' }); }); - it('should return undefined when pirIdToken is not found', () => { - const result = pirIdSubmodule.getId(); + it('should return undefined when ceeIdToken is not found', () => { + const result = ceeIdSubmodule.getId(); expect(result).to.be.undefined; }); }); describe('decode', () => { - it('should return an object with pirId when value is a string', () => { - const result = pirIdSubmodule.decode('testId'); + it('should return an object with ceeId when value is a string', () => { + const result = ceeIdSubmodule.decode('testId'); - expect(result).to.deep.equal({ pirId: 'testId' }); + expect(result).to.deep.equal({ ceeId: 'testId' }); }); it('should return undefined when value is not a string', () => { - const result = pirIdSubmodule.decode({}); + const result = ceeIdSubmodule.decode({}); expect(result).to.be.undefined; });