@osano/osano-cmp-react-native 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.dev.md +216 -1
- package/README.md +2 -267
- package/android/src/main/java/com/OsanoCMPSDK/OsanoCMPSDKModule.kt +41 -0
- package/ios/OsanoCmpSDK.mm +42 -0
- package/lib/commonjs/ConsentManager.js +82 -11
- package/lib/commonjs/ConsentManager.js.map +1 -1
- package/lib/commonjs/ConsentUiBuilder.js +10 -7
- package/lib/commonjs/ConsentUiBuilder.js.map +1 -1
- package/lib/commonjs/commands.js +10 -5
- package/lib/commonjs/commands.js.map +1 -1
- package/lib/commonjs/components/Button.js +6 -7
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/Checkbox.js +1 -2
- package/lib/commonjs/components/Checkbox.js.map +1 -1
- package/lib/commonjs/components/ExpansionPanel.js +1 -2
- package/lib/commonjs/components/ExpansionPanel.js.map +1 -1
- package/lib/commonjs/components/Link.js +1 -2
- package/lib/commonjs/components/Link.js.map +1 -1
- package/lib/commonjs/components/StoragePolicyLink.js +1 -2
- package/lib/commonjs/components/StoragePolicyLink.js.map +1 -1
- package/lib/commonjs/components/Toggle.js +1 -2
- package/lib/commonjs/components/Toggle.js.map +1 -1
- package/lib/commonjs/context.js +7 -5
- package/lib/commonjs/context.js.map +1 -1
- package/lib/commonjs/iab/tcf/consent.js +0 -5
- package/lib/commonjs/iab/tcf/consent.js.map +1 -1
- package/lib/commonjs/iab/tcf/constants.js +34 -1
- package/lib/commonjs/iab/tcf/constants.js.map +1 -1
- package/lib/commonjs/iab/tcf/iab-storage-utils.js +102 -0
- package/lib/commonjs/iab/tcf/iab-storage-utils.js.map +1 -0
- package/lib/commonjs/iab/tcf/index.js +1 -2
- package/lib/commonjs/iab/tcf/index.js.map +1 -1
- package/lib/commonjs/iab/tcf/middleware.js +33 -35
- package/lib/commonjs/iab/tcf/middleware.js.map +1 -1
- package/lib/commonjs/iab/tcf/selectors.js +1 -1
- package/lib/commonjs/iab/tcf/selectors.js.map +1 -1
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js +1 -2
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js.map +1 -1
- package/lib/commonjs/index.js +54 -15
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/locale/af.json +342 -323
- package/lib/commonjs/locale/ar.json +342 -323
- package/lib/commonjs/locale/bg.json +342 -323
- package/lib/commonjs/locale/ca.json +342 -323
- package/lib/commonjs/locale/cs.json +342 -323
- package/lib/commonjs/locale/da.json +342 -323
- package/lib/commonjs/locale/de-at.json +342 -323
- package/lib/commonjs/locale/de.json +342 -323
- package/lib/commonjs/locale/el.json +342 -323
- package/lib/commonjs/locale/en-au.json +342 -323
- package/lib/commonjs/locale/en-ca.json +342 -323
- package/lib/commonjs/locale/en-gb.json +342 -323
- package/lib/commonjs/locale/en.json +342 -323
- package/lib/commonjs/locale/es-mx.json +342 -323
- package/lib/commonjs/locale/es.json +342 -323
- package/lib/commonjs/locale/et.json +342 -323
- package/lib/commonjs/locale/fa.json +342 -323
- package/lib/commonjs/locale/fi.json +342 -323
- package/lib/commonjs/locale/fr-ca.json +342 -323
- package/lib/commonjs/locale/fr.json +342 -323
- package/lib/commonjs/locale/gd.json +342 -323
- package/lib/commonjs/locale/he.json +342 -323
- package/lib/commonjs/locale/hi.json +342 -323
- package/lib/commonjs/locale/hr.json +342 -323
- package/lib/commonjs/locale/hu.json +342 -323
- package/lib/commonjs/locale/hy.json +342 -323
- package/lib/commonjs/locale/id.json +342 -323
- package/lib/commonjs/locale/is.json +342 -323
- package/lib/commonjs/locale/it.json +342 -323
- package/lib/commonjs/locale/ja.json +342 -323
- package/lib/commonjs/locale/kk.json +342 -323
- package/lib/commonjs/locale/ko.json +342 -323
- package/lib/commonjs/locale/lt.json +342 -323
- package/lib/commonjs/locale/lv.json +342 -323
- package/lib/commonjs/locale/mi.json +342 -323
- package/lib/commonjs/locale/ms.json +342 -323
- package/lib/commonjs/locale/nb.json +342 -323
- package/lib/commonjs/locale/nl-be.json +342 -323
- package/lib/commonjs/locale/nl.json +342 -323
- package/lib/commonjs/locale/nn.json +342 -323
- package/lib/commonjs/locale/no.json +342 -323
- package/lib/commonjs/locale/pl.json +342 -323
- package/lib/commonjs/locale/pt-br.json +342 -323
- package/lib/commonjs/locale/pt.json +342 -323
- package/lib/commonjs/locale/ro.json +342 -323
- package/lib/commonjs/locale/ru.json +342 -323
- package/lib/commonjs/locale/sk.json +342 -323
- package/lib/commonjs/locale/sl.json +342 -323
- package/lib/commonjs/locale/sq.json +342 -323
- package/lib/commonjs/locale/sr.json +342 -323
- package/lib/commonjs/locale/sv.json +342 -323
- package/lib/commonjs/locale/th.json +342 -323
- package/lib/commonjs/locale/tl.json +342 -323
- package/lib/commonjs/locale/tr.json +342 -323
- package/lib/commonjs/locale/uk.json +342 -323
- package/lib/commonjs/locale/vi.json +342 -323
- package/lib/commonjs/locale/zh-hk.json +342 -323
- package/lib/commonjs/locale/zh-tw.json +342 -323
- package/lib/commonjs/locale/zh.json +342 -323
- package/lib/commonjs/locale/zu.json +342 -323
- package/lib/commonjs/native/OsanoCmp.js +16 -0
- package/lib/commonjs/native/OsanoCmp.js.map +1 -1
- package/lib/commonjs/selectors.js +1 -1
- package/lib/commonjs/selectors.js.map +1 -1
- package/lib/commonjs/services/consent.js +60 -8
- package/lib/commonjs/services/consent.js.map +1 -1
- package/lib/commonjs/services/google-consent-mode-mapper.js +109 -0
- package/lib/commonjs/services/google-consent-mode-mapper.js.map +1 -0
- package/lib/commonjs/types/google-consent-mode.js +73 -0
- package/lib/commonjs/types/google-consent-mode.js.map +1 -0
- package/lib/commonjs/utils/EventEmitter.js +0 -2
- package/lib/commonjs/utils/EventEmitter.js.map +1 -1
- package/lib/commonjs/utils/OsanoLogger.js +51 -0
- package/lib/commonjs/utils/OsanoLogger.js.map +1 -0
- package/lib/commonjs/utils/Translator.js +2 -2
- package/lib/commonjs/utils/Translator.js.map +1 -1
- package/lib/commonjs/utils/index.js +7 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/views/Dialog/Buttons.js +1 -2
- package/lib/commonjs/views/Dialog/Buttons.js.map +1 -1
- package/lib/commonjs/views/Dialog/FirstLayerUsage.js +1 -2
- package/lib/commonjs/views/Dialog/FirstLayerUsage.js.map +1 -1
- package/lib/commonjs/views/Dialog/Message.js +1 -2
- package/lib/commonjs/views/Dialog/Message.js.map +1 -1
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js +1 -2
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js.map +1 -1
- package/lib/commonjs/views/Dialog/index.js +1 -2
- package/lib/commonjs/views/Dialog/index.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Header.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.Header.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js.map +1 -1
- package/lib/commonjs/views/Drawer/index.js +1 -2
- package/lib/commonjs/views/Drawer/index.js.map +1 -1
- package/lib/module/ConsentManager.js +81 -9
- package/lib/module/ConsentManager.js.map +1 -1
- package/lib/module/ConsentUiBuilder.js +9 -5
- package/lib/module/ConsentUiBuilder.js.map +1 -1
- package/lib/module/commands.js +10 -5
- package/lib/module/commands.js.map +1 -1
- package/lib/module/components/Button.js +5 -5
- package/lib/module/components/Button.js.map +1 -1
- package/lib/module/context.js +7 -5
- package/lib/module/context.js.map +1 -1
- package/lib/module/iab/tcf/consent.js +0 -5
- package/lib/module/iab/tcf/consent.js.map +1 -1
- package/lib/module/iab/tcf/constants.js +32 -0
- package/lib/module/iab/tcf/constants.js.map +1 -1
- package/lib/module/iab/tcf/iab-storage-utils.js +89 -0
- package/lib/module/iab/tcf/iab-storage-utils.js.map +1 -0
- package/lib/module/iab/tcf/middleware.js +25 -27
- package/lib/module/iab/tcf/middleware.js.map +1 -1
- package/lib/module/iab/tcf/selectors.js +1 -1
- package/lib/module/iab/tcf/selectors.js.map +1 -1
- package/lib/module/index.js +47 -13
- package/lib/module/index.js.map +1 -1
- package/lib/module/locale/af.json +342 -323
- package/lib/module/locale/ar.json +342 -323
- package/lib/module/locale/bg.json +342 -323
- package/lib/module/locale/ca.json +342 -323
- package/lib/module/locale/cs.json +342 -323
- package/lib/module/locale/da.json +342 -323
- package/lib/module/locale/de-at.json +342 -323
- package/lib/module/locale/de.json +342 -323
- package/lib/module/locale/el.json +342 -323
- package/lib/module/locale/en-au.json +342 -323
- package/lib/module/locale/en-ca.json +342 -323
- package/lib/module/locale/en-gb.json +342 -323
- package/lib/module/locale/en.json +342 -323
- package/lib/module/locale/es-mx.json +342 -323
- package/lib/module/locale/es.json +342 -323
- package/lib/module/locale/et.json +342 -323
- package/lib/module/locale/fa.json +342 -323
- package/lib/module/locale/fi.json +342 -323
- package/lib/module/locale/fr-ca.json +342 -323
- package/lib/module/locale/fr.json +342 -323
- package/lib/module/locale/gd.json +342 -323
- package/lib/module/locale/he.json +342 -323
- package/lib/module/locale/hi.json +342 -323
- package/lib/module/locale/hr.json +342 -323
- package/lib/module/locale/hu.json +342 -323
- package/lib/module/locale/hy.json +342 -323
- package/lib/module/locale/id.json +342 -323
- package/lib/module/locale/is.json +342 -323
- package/lib/module/locale/it.json +342 -323
- package/lib/module/locale/ja.json +342 -323
- package/lib/module/locale/kk.json +342 -323
- package/lib/module/locale/ko.json +342 -323
- package/lib/module/locale/lt.json +342 -323
- package/lib/module/locale/lv.json +342 -323
- package/lib/module/locale/mi.json +342 -323
- package/lib/module/locale/ms.json +342 -323
- package/lib/module/locale/nb.json +342 -323
- package/lib/module/locale/nl-be.json +342 -323
- package/lib/module/locale/nl.json +342 -323
- package/lib/module/locale/nn.json +342 -323
- package/lib/module/locale/no.json +342 -323
- package/lib/module/locale/pl.json +342 -323
- package/lib/module/locale/pt-br.json +342 -323
- package/lib/module/locale/pt.json +342 -323
- package/lib/module/locale/ro.json +342 -323
- package/lib/module/locale/ru.json +342 -323
- package/lib/module/locale/sk.json +342 -323
- package/lib/module/locale/sl.json +342 -323
- package/lib/module/locale/sq.json +342 -323
- package/lib/module/locale/sr.json +342 -323
- package/lib/module/locale/sv.json +342 -323
- package/lib/module/locale/th.json +342 -323
- package/lib/module/locale/tl.json +342 -323
- package/lib/module/locale/tr.json +342 -323
- package/lib/module/locale/uk.json +342 -323
- package/lib/module/locale/vi.json +342 -323
- package/lib/module/locale/zh-hk.json +342 -323
- package/lib/module/locale/zh-tw.json +342 -323
- package/lib/module/locale/zh.json +342 -323
- package/lib/module/locale/zu.json +342 -323
- package/lib/module/native/OsanoCmp.js +12 -0
- package/lib/module/native/OsanoCmp.js.map +1 -1
- package/lib/module/selectors.js +1 -1
- package/lib/module/selectors.js.map +1 -1
- package/lib/module/services/consent.js +54 -7
- package/lib/module/services/consent.js.map +1 -1
- package/lib/module/services/google-consent-mode-mapper.js +103 -0
- package/lib/module/services/google-consent-mode-mapper.js.map +1 -0
- package/lib/module/types/google-consent-mode.js +70 -0
- package/lib/module/types/google-consent-mode.js.map +1 -0
- package/lib/module/utils/EventEmitter.js +0 -2
- package/lib/module/utils/EventEmitter.js.map +1 -1
- package/lib/module/utils/OsanoLogger.js +44 -0
- package/lib/module/utils/OsanoLogger.js.map +1 -0
- package/lib/module/utils/Translator.js +2 -2
- package/lib/module/utils/Translator.js.map +1 -1
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/ConsentManager.d.ts +17 -1
- package/lib/typescript/lib/commonjs/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ConsentUiBuilder.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/commands.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Button.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Checkbox.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/ExpansionPanel.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Link.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/StoragePolicyLink.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Toggle.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/constants.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/api.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/v1/index.d.ts +1 -3
- package/lib/typescript/lib/commonjs/iab/gpp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/constants.d.ts +41 -1
- package/lib/typescript/lib/commonjs/iab/tcf/constants.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/iab-storage-utils.d.ts +9 -0
- package/lib/typescript/lib/commonjs/iab/tcf/iab-storage-utils.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/middleware.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts +0 -1
- package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/shared-constants.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/api.d.ts +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/api.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/selectors.d.ts +1 -4
- package/lib/typescript/lib/commonjs/iab/usp/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts +4 -0
- package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/reducer.d.ts +7 -1
- package/lib/typescript/lib/commonjs/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/services/consent.d.ts +4 -0
- package/lib/typescript/lib/commonjs/services/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/services/google-consent-mode-mapper.d.ts +72 -0
- package/lib/typescript/lib/commonjs/services/google-consent-mode-mapper.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/types/google-consent-mode.d.ts +32 -0
- package/lib/typescript/lib/commonjs/types/google-consent-mode.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/utils/OsanoLogger.d.ts +16 -0
- package/lib/typescript/lib/commonjs/utils/OsanoLogger.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/Translator.d.ts +1 -1
- package/lib/typescript/lib/commonjs/utils/Translator.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/utils/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/utils/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/Buttons.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/FirstLayerUsage.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/Message.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Header.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/ConsentManager.d.ts +18 -2
- package/lib/typescript/lib/module/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ConsentUiBuilder.d.ts +1 -0
- package/lib/typescript/lib/module/ConsentUiBuilder.d.ts.map +1 -1
- package/lib/typescript/lib/module/actions.d.ts.map +1 -1
- package/lib/typescript/lib/module/commands.d.ts +1 -1
- package/lib/typescript/lib/module/commands.d.ts.map +1 -1
- package/lib/typescript/lib/module/components/Button.d.ts.map +1 -1
- package/lib/typescript/lib/module/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/context.d.ts +10 -1
- package/lib/typescript/lib/module/context.d.ts.map +1 -1
- package/lib/typescript/lib/module/flavors/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/api.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/v1/index.d.ts +1 -3
- package/lib/typescript/lib/module/iab/gpp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/constants.d.ts +41 -1
- package/lib/typescript/lib/module/iab/tcf/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/iab-storage-utils.d.ts +8 -0
- package/lib/typescript/lib/module/iab/tcf/iab-storage-utils.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/index.d.ts +0 -2
- package/lib/typescript/lib/module/iab/tcf/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/middleware.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/selectors.d.ts +0 -1
- package/lib/typescript/lib/module/iab/tcf/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts +0 -2
- package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts +0 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts +5 -2
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts +0 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/api.d.ts +1 -1
- package/lib/typescript/lib/module/iab/usp/api.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/selectors.d.ts +1 -4
- package/lib/typescript/lib/module/iab/usp/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/v1/index.d.ts +1 -1
- package/lib/typescript/lib/module/iab/usp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/index.d.ts +1 -0
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/native/OsanoCmp.d.ts +4 -0
- package/lib/typescript/lib/module/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/lib/module/reducer.d.ts +7 -1
- package/lib/typescript/lib/module/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/module/services/consent.d.ts +4 -0
- package/lib/typescript/lib/module/services/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/services/google-consent-mode-mapper.d.ts +71 -0
- package/lib/typescript/lib/module/services/google-consent-mode-mapper.d.ts.map +1 -0
- package/lib/typescript/lib/module/types/google-consent-mode.d.ts +38 -0
- package/lib/typescript/lib/module/types/google-consent-mode.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/lib/module/utils/OsanoLogger.d.ts +15 -0
- package/lib/typescript/lib/module/utils/OsanoLogger.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/Translator.d.ts +1 -1
- package/lib/typescript/lib/module/utils/Translator.d.ts.map +1 -1
- package/lib/typescript/lib/module/utils/index.d.ts +1 -0
- package/lib/typescript/src/ConsentManager.d.ts +24 -7
- package/lib/typescript/src/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/src/ConsentUiBuilder.d.ts +1 -1
- package/lib/typescript/src/ConsentUiBuilder.d.ts.map +1 -1
- package/lib/typescript/src/commands.d.ts.map +1 -1
- package/lib/typescript/src/components/Button.d.ts +1 -1
- package/lib/typescript/src/components/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/Divider.d.ts.map +1 -1
- package/lib/typescript/src/components/ExpansionPanel.d.ts.map +1 -1
- package/lib/typescript/src/components/Link.d.ts.map +1 -1
- package/lib/typescript/src/components/Locale.d.ts.map +1 -1
- package/lib/typescript/src/components/StoragePolicyLink.d.ts.map +1 -1
- package/lib/typescript/src/components/Toggle.d.ts.map +1 -1
- package/lib/typescript/src/context.d.ts +5 -2
- package/lib/typescript/src/context.d.ts.map +1 -1
- package/lib/typescript/src/iab/actions.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/api.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/consent.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/BooleanEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/DatetimeEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedBitfieldEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerListEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedStringEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/v1/index.d.ts +1 -3
- package/lib/typescript/src/iab/gpp/v1/index.d.ts.map +1 -1
- package/lib/typescript/src/iab/index.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/actions.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/consent.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/constants.d.ts +32 -0
- package/lib/typescript/src/iab/tcf/constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/helpers.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/iab-storage-utils.d.ts +24 -0
- package/lib/typescript/src/iab/tcf/iab-storage-utils.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/middleware.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/reducer.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/selectors.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/formatters.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/shared-constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/api.d.ts +1 -1
- package/lib/typescript/src/iab/usp/api.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/consent.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/selectors.d.ts +1 -4
- package/lib/typescript/src/iab/usp/selectors.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/v1/index.d.ts +1 -1
- package/lib/typescript/src/iab/usp/v1/index.d.ts.map +1 -1
- package/lib/typescript/src/iab/utilities.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/OsanoCmp.d.ts +4 -0
- package/lib/typescript/src/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/src/reducer.d.ts.map +1 -1
- package/lib/typescript/src/selectors.d.ts.map +1 -1
- package/lib/typescript/src/services/consent.d.ts +13 -2
- package/lib/typescript/src/services/consent.d.ts.map +1 -1
- package/lib/typescript/src/services/google-consent-mode-mapper.d.ts +66 -0
- package/lib/typescript/src/services/google-consent-mode-mapper.d.ts.map +1 -0
- package/lib/typescript/src/styles.d.ts.map +1 -1
- package/lib/typescript/src/types/google-consent-mode.d.ts +77 -0
- package/lib/typescript/src/types/google-consent-mode.d.ts.map +1 -0
- package/lib/typescript/src/utils/Color.d.ts.map +1 -1
- package/lib/typescript/src/utils/EventEmitter.d.ts.map +1 -1
- package/lib/typescript/src/utils/OsanoLogger.d.ts +15 -0
- package/lib/typescript/src/utils/OsanoLogger.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +1 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/ConsentManager.ts +131 -22
- package/src/ConsentUiBuilder.tsx +23 -13
- package/src/commands.ts +11 -8
- package/src/components/Button.tsx +17 -17
- package/src/context.ts +14 -9
- package/src/iab/tcf/consent.ts +11 -16
- package/src/iab/tcf/constants.ts +46 -0
- package/src/iab/tcf/iab-storage-utils.ts +166 -0
- package/src/iab/tcf/middleware.ts +43 -51
- package/src/index.tsx +77 -22
- package/src/locale/af.json +342 -323
- package/src/locale/ar.json +342 -323
- package/src/locale/bg.json +342 -323
- package/src/locale/ca.json +342 -323
- package/src/locale/cs.json +342 -323
- package/src/locale/da.json +342 -323
- package/src/locale/de-at.json +342 -323
- package/src/locale/de.json +342 -323
- package/src/locale/el.json +342 -323
- package/src/locale/en-au.json +342 -323
- package/src/locale/en-ca.json +342 -323
- package/src/locale/en-gb.json +342 -323
- package/src/locale/en.json +342 -323
- package/src/locale/es-mx.json +342 -323
- package/src/locale/es.json +342 -323
- package/src/locale/et.json +342 -323
- package/src/locale/fa.json +342 -323
- package/src/locale/fi.json +342 -323
- package/src/locale/fr-ca.json +342 -323
- package/src/locale/fr.json +342 -323
- package/src/locale/gd.json +342 -323
- package/src/locale/he.json +342 -323
- package/src/locale/hi.json +342 -323
- package/src/locale/hr.json +342 -323
- package/src/locale/hu.json +342 -323
- package/src/locale/hy.json +342 -323
- package/src/locale/id.json +342 -323
- package/src/locale/is.json +342 -323
- package/src/locale/it.json +342 -323
- package/src/locale/ja.json +342 -323
- package/src/locale/kk.json +342 -323
- package/src/locale/ko.json +342 -323
- package/src/locale/lt.json +342 -323
- package/src/locale/lv.json +342 -323
- package/src/locale/mi.json +342 -323
- package/src/locale/ms.json +342 -323
- package/src/locale/nb.json +342 -323
- package/src/locale/nl-be.json +342 -323
- package/src/locale/nl.json +342 -323
- package/src/locale/nn.json +342 -323
- package/src/locale/no.json +342 -323
- package/src/locale/pl.json +342 -323
- package/src/locale/pt-br.json +342 -323
- package/src/locale/pt.json +342 -323
- package/src/locale/ro.json +342 -323
- package/src/locale/ru.json +342 -323
- package/src/locale/sk.json +342 -323
- package/src/locale/sl.json +342 -323
- package/src/locale/sq.json +342 -323
- package/src/locale/sr.json +342 -323
- package/src/locale/sv.json +342 -323
- package/src/locale/th.json +342 -323
- package/src/locale/tl.json +342 -323
- package/src/locale/tr.json +342 -323
- package/src/locale/uk.json +342 -323
- package/src/locale/vi.json +342 -323
- package/src/locale/zh-hk.json +342 -323
- package/src/locale/zh-tw.json +342 -323
- package/src/locale/zh.json +342 -323
- package/src/locale/zu.json +342 -323
- package/src/native/OsanoCmp.ts +29 -0
- package/src/selectors.ts +1 -0
- package/src/services/consent.ts +75 -9
- package/src/services/google-consent-mode-mapper.ts +122 -0
- package/src/types/consent-config.d.ts +0 -3
- package/src/types/google-consent-mode.ts +122 -0
- package/src/types/index.d.ts +4 -2
- package/src/utils/EventEmitter.ts +1 -3
- package/src/utils/OsanoLogger.ts +53 -0
- package/src/utils/Translator.ts +15 -15
- package/src/utils/index.ts +2 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OsanoCmp.d.ts","sourceRoot":"","sources":["../../../../src/native/OsanoCmp.ts"],"names":[],"mappings":"AAoBA,wBAAgB,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAEhE;AACD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtE;AACD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAE1E;AACD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvD"}
|
|
1
|
+
{"version":3,"file":"OsanoCmp.d.ts","sourceRoot":"","sources":["../../../../src/native/OsanoCmp.ts"],"names":[],"mappings":"AAoBA,wBAAgB,WAAW,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAEhE;AACD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtE;AACD,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAE1E;AACD,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEvD;AACD,wBAAgB,mBAAmB,CAClC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAIjB;AACD,wBAAgB,sBAAsB,CACrC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,MAAM,CAAC,CAIjB;AACD,wBAAgB,uBAAuB,CACtC,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,OAAO,GACZ,OAAO,CAAC,OAAO,CAAC,CAIlB;AACD,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../src/reducer.ts"],"names":[],"mappings":"AAmBA,OAAO,EACN,eAAe,EAEf,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAc,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIzE,eAAO,MAAM,eAAe,mBAAiC,CAAC;AAE9D,eAAO,MAAM,YAAY,EAAE,UA2B1B,CAAC;AAEF,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../src/reducer.ts"],"names":[],"mappings":"AAmBA,OAAO,EACN,eAAe,EAEf,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAc,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAIzE,eAAO,MAAM,eAAe,mBAAiC,CAAC;AAE9D,eAAO,MAAM,YAAY,EAAE,UA2B1B,CAAC;AAEF,eAAO,MAAM,IAAI,GAAI,aAAa,UAAU,GAAG,GAAG,KAAG,UAiBpD,CAAC;AAkCF,wBAAgB,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,GAAG,UAAU,CA+S1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/selectors.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,eAAe,IAAI,mBAAmB,EACtC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI5D,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../../src/selectors.ts"],"names":[],"mappings":"AACA,OAAO,EAEN,eAAe,IAAI,mBAAmB,EACtC,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAI5D,eAAO,MAAM,kBAAkB,GAC9B,OAAO,UAAU,EACjB,UAAU,mBAAmB,YACW,CAAC;AAE1C,eAAO,MAAM,wBAAwB,GAAI,OAAO,UAAU,YACrB,CAAC;AACtC,eAAO,MAAM,kBAAkB,GAC9B,OAAO,UAAU,EACjB,UAAU,mBAAmB,YAMuB,CAAC;AAEtD,eAAO,MAAM,YAAY,GAAI,OAAO,UAAU,YAA2B,CAAC;AAC1E,eAAO,MAAM,YAAY,GAAI,OAAO,UAAU,YACL,CAAC;AAE1C,eAAO,MAAM,mBAAmB,GAAI,OAAO,UAAU,YAMmB,CAAC;AACzE,eAAO,MAAM,kBAAkB,GAAI,OAAO,UAAU,EAAE,cAAc,OAAO,YAK3D,CAAC;AAEjB,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,EAAE,CAAC;AACrE,wBAAgB,UAAU,CACzB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,mBAAmB,GAC3B,OAAO,CAAC;AASX,eAAO,MAAM,mBAAmB,GAAI,OAAO,UAAU,KAAG,MACpB,CAAC;AAQrC,eAAO,MAAM,cAAc,GAAI,OAAO,UAAU,YACpB,CAAC;AAC7B,eAAO,MAAM,oBAAoB,GAAI,OAAO,UAAU,YAErD,CAAC;AACF,eAAO,MAAM,gCAAgC,GAC5C,OAAO,UAAU,EACjB,UAAU,mBAAmB,YAO7B,CAAC;AACF,eAAO,MAAM,sBAAsB,GAClC,OAAO,UAAU,EACjB,UAAU,mBAAmB,KAC3B,UAAU,EAUZ,CAAC;AAEF,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE,CAAC;AACtD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { ConsentManager } from '../ConsentManager';
|
|
1
2
|
import { ConsentCategory, ConsentCategory as ConsentCategoryType } from '../constants';
|
|
2
3
|
import type { Config } from '../types/consent-config';
|
|
3
|
-
import type { ConsentManager } from '../ConsentManager';
|
|
4
4
|
export type ConsentPayload = {
|
|
5
5
|
customerId: string;
|
|
6
6
|
configId: string;
|
|
@@ -28,5 +28,16 @@ export declare const clearConsent: (cmp: ConsentManager) => Promise<ConsentCateg
|
|
|
28
28
|
export declare const recordConsent: (cmp: ConsentManager, consent?: ConsentCategoryType[]) => Promise<ConsentCategory[]>;
|
|
29
29
|
export declare function hashExtUsrData(customerId: string, configId: string, extUsrData: string): string;
|
|
30
30
|
export declare const fetchConsent: (cmp: ConsentManager) => Promise<ConsentCategory[]>;
|
|
31
|
-
export declare const fetchConfig: (customerId: string, configId: string) => Promise<Config
|
|
31
|
+
export declare const fetchConfig: (customerId: string, configId: string) => Promise<Config>;
|
|
32
|
+
export declare const getStoredConfig: (configId: string) => Promise<Config | null>;
|
|
33
|
+
export declare const storeConfig: (configId: string, config: Config) => Promise<void>;
|
|
34
|
+
export declare const getConfigLastStoredAt: (configId: string) => Promise<Date | null>;
|
|
35
|
+
/**
|
|
36
|
+
* Determine if a cached config is stale
|
|
37
|
+
*
|
|
38
|
+
* @async
|
|
39
|
+
* @param {string} configId
|
|
40
|
+
* @returns {Promise<boolean>}
|
|
41
|
+
*/
|
|
42
|
+
export declare const hasStaleConfig: (configId: string) => Promise<boolean>;
|
|
32
43
|
//# sourceMappingURL=consent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"consent.d.ts","sourceRoot":"","sources":["../../../../src/services/consent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"consent.d.ts","sourceRoot":"","sources":["../../../../src/services/consent.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EACN,eAAe,EACf,eAAe,IAAI,mBAAmB,EAEtC,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AActD,MAAM,MAAM,cAAc,GAAG;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAClC,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACvC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;CACtB,CAAC;AA2EF,eAAO,MAAM,YAAY,GAAU,KAAK,cAAc,+BAgBrD,CAAC;AAyDF,eAAO,MAAM,aAAa,GACzB,KAAK,cAAc,EACnB,UAAU,mBAAmB,EAAE,+BAY/B,CAAC;AAEF,wBAAgB,cAAc,CAC7B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GAChB,MAAM,CAgBR;AAED,eAAO,MAAM,YAAY,GAAU,KAAK,cAAc,+BAoDrD,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,YAAY,MAAM,EAAE,UAAU,MAAM,oBAsB/D,CAAC;AAEF,eAAO,MAAM,eAAe,GAC3B,UAAU,MAAM,KACd,OAAO,CAAC,MAAM,GAAG,IAAI,CAUvB,CAAC;AAEF,eAAO,MAAM,WAAW,GACvB,UAAU,MAAM,EAChB,QAAQ,MAAM,KACZ,OAAO,CAAC,IAAI,CAYd,CAAC;AAEF,eAAO,MAAM,qBAAqB,GACjC,UAAU,MAAM,KACd,OAAO,CAAC,IAAI,GAAG,IAAI,CAYrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,GAAU,UAAU,MAAM,KAAG,OAAO,CAAC,OAAO,CAStE,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ConsentCategory } from '../constants';
|
|
2
|
+
import type { GoogleConsentMap } from '../types/google-consent-mode';
|
|
3
|
+
import { GoogleConsentParameter, GoogleConsentStatus } from '../types/google-consent-mode';
|
|
4
|
+
/**
|
|
5
|
+
* Google Consent Mode Category Mapper
|
|
6
|
+
*
|
|
7
|
+
* Converts Osano consent categories to Google Consent Mode v2 parameters.
|
|
8
|
+
*
|
|
9
|
+
* **Mapping Logic (matching iOS/Android SDKs):**
|
|
10
|
+
* - ANALYTICS category → analytics_storage parameter
|
|
11
|
+
* - MARKETING category → ad_storage, ad_user_data, ad_personalization parameters
|
|
12
|
+
*
|
|
13
|
+
* All Google Consent Mode parameters default to "denied" until explicitly granted through category mapping.
|
|
14
|
+
*/
|
|
15
|
+
export declare class GoogleConsentModeMapper {
|
|
16
|
+
private static readonly GOOGLE_CATEGORIES_MAP;
|
|
17
|
+
/**
|
|
18
|
+
* Build a Google Consent Map from a set of Osano consent categories
|
|
19
|
+
*
|
|
20
|
+
* @param categories - Set of Osano consent categories that the user has granted
|
|
21
|
+
* @returns GoogleConsentMap with appropriate Google Consent Mode v2 parameters
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const categories = new Set([ConsentCategory.ANALYTICS, ConsentCategory.MARKETING]);
|
|
26
|
+
* const consentMap = GoogleConsentModeMapper.buildGoogleConsentMap(categories);
|
|
27
|
+
*
|
|
28
|
+
* // Results in:
|
|
29
|
+
* // {
|
|
30
|
+
* // analytics_storage: 'granted',
|
|
31
|
+
* // ad_storage: 'granted',
|
|
32
|
+
* // ad_user_data: 'granted',
|
|
33
|
+
* // ad_personalization: 'granted'
|
|
34
|
+
* // }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
static buildGoogleConsentMap(categories: Set<ConsentCategory>): GoogleConsentMap;
|
|
38
|
+
/**
|
|
39
|
+
* Create a GoogleConsentMap from a raw consent map
|
|
40
|
+
*
|
|
41
|
+
* @param consentMap - Raw mapping of Google Consent Mode parameters to status
|
|
42
|
+
* @returns GoogleConsentMap implementation with helper methods
|
|
43
|
+
*/
|
|
44
|
+
static createGoogleConsentMap(consentMap: Record<GoogleConsentParameter, GoogleConsentStatus>): GoogleConsentMap;
|
|
45
|
+
/**
|
|
46
|
+
* Check if a consent category is mapped to Google Consent Mode parameters
|
|
47
|
+
*
|
|
48
|
+
* @param category - Osano consent category to check
|
|
49
|
+
* @returns true if the category is mapped to Google Consent Mode parameters
|
|
50
|
+
*/
|
|
51
|
+
static isGoogleConsentCategory(category: ConsentCategory): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Get Google Consent Mode parameters for a specific consent category
|
|
54
|
+
*
|
|
55
|
+
* @param category - Osano consent category
|
|
56
|
+
* @returns Array of Google Consent Mode parameters mapped to this category
|
|
57
|
+
*/
|
|
58
|
+
static getGoogleParametersForCategory(category: ConsentCategory): GoogleConsentParameter[];
|
|
59
|
+
/**
|
|
60
|
+
* Get readonly copy of the categories mapping
|
|
61
|
+
*
|
|
62
|
+
* @returns Readonly mapping of Osano categories to Google Consent Mode parameters
|
|
63
|
+
*/
|
|
64
|
+
static getCategoriesMapping(): Readonly<Record<string, GoogleConsentParameter[]>>;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=google-consent-mode-mapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-consent-mode-mapper.d.ts","sourceRoot":"","sources":["../../../../src/services/google-consent-mode-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAEN,sBAAsB,EACtB,mBAAmB,EACnB,MAAM,8BAA8B,CAAC;AAEtC;;;;;;;;;;GAUG;AACH,qBAAa,uBAAuB;IACnC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAU3C;IAEF;;;;;;;;;;;;;;;;;;;OAmBG;IACH,MAAM,CAAC,qBAAqB,CAC3B,UAAU,EAAE,GAAG,CAAC,eAAe,CAAC,GAC9B,gBAAgB;IAuBnB;;;;;OAKG;IACH,MAAM,CAAC,sBAAsB,CAC5B,UAAU,EAAE,MAAM,CAAC,sBAAsB,EAAE,mBAAmB,CAAC,GAC7D,gBAAgB;IAInB;;;;;OAKG;IACH,MAAM,CAAC,uBAAuB,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO;IAIlE;;;;;OAKG;IACH,MAAM,CAAC,8BAA8B,CACpC,QAAQ,EAAE,eAAe,GACvB,sBAAsB,EAAE;IAI3B;;;;OAIG;IACH,MAAM,CAAC,oBAAoB,IAAI,QAAQ,CACtC,MAAM,CAAC,MAAM,EAAE,sBAAsB,EAAE,CAAC,CACxC;CAGD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AA8BjE,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/styles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAkB,MAAM,kBAAkB,CAAC;AA8BjE,eAAO,MAAM,mBAAmB,GAC/B,OAAO,MAAM,EACb,eAA6B,WAM7B,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,SAAS,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgKxD,CAAC"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Google Consent Mode v2 parameters as defined by Google
|
|
3
|
+
* @see https://developers.google.com/tag-platform/security/guides/consent?consentmode=advanced
|
|
4
|
+
*/
|
|
5
|
+
export declare enum GoogleConsentParameter {
|
|
6
|
+
ANALYTICS_STORAGE = "analytics_storage",
|
|
7
|
+
AD_STORAGE = "ad_storage",
|
|
8
|
+
AD_USER_DATA = "ad_user_data",
|
|
9
|
+
AD_PERSONALIZATION = "ad_personalization"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Google Consent Mode v2 status values
|
|
13
|
+
*/
|
|
14
|
+
export declare enum GoogleConsentStatus {
|
|
15
|
+
GRANTED = "granted",
|
|
16
|
+
DENIED = "denied"
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Immutable consent map that provides Google Consent Mode v2 parameters
|
|
20
|
+
* with their corresponding status values and helper methods.
|
|
21
|
+
*/
|
|
22
|
+
export interface GoogleConsentMap {
|
|
23
|
+
readonly consentMap: Record<GoogleConsentParameter, GoogleConsentStatus>;
|
|
24
|
+
/**
|
|
25
|
+
* Convert the consent map to a string-based record for easier Firebase integration
|
|
26
|
+
* @returns Object with string keys and string values
|
|
27
|
+
*/
|
|
28
|
+
toStringMap(): Record<string, string>;
|
|
29
|
+
/**
|
|
30
|
+
* Check if analytics storage consent is granted
|
|
31
|
+
* @returns true if analytics_storage is granted
|
|
32
|
+
*/
|
|
33
|
+
isAnalyticsStorageGranted(): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Check if ad storage consent is granted
|
|
36
|
+
* @returns true if ad_storage is granted
|
|
37
|
+
*/
|
|
38
|
+
isAdStorageGranted(): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Check if ad user data consent is granted
|
|
41
|
+
* @returns true if ad_user_data is granted
|
|
42
|
+
*/
|
|
43
|
+
isAdUserDataGranted(): boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Check if ad personalization consent is granted
|
|
46
|
+
* @returns true if ad_personalization is granted
|
|
47
|
+
*/
|
|
48
|
+
isAdPersonalizationGranted(): boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Callback function type for Google Consent Mode updates
|
|
52
|
+
*
|
|
53
|
+
* This callback is triggered whenever consent status changes and provides
|
|
54
|
+
* the Google Consent Mode v2 parameters in a format ready for Firebase integration.
|
|
55
|
+
*
|
|
56
|
+
* @param consentMap - Object containing the four Google Consent Mode v2 parameters:
|
|
57
|
+
* - "analytics_storage": "granted" or "denied"
|
|
58
|
+
* - "ad_storage": "granted" or "denied"
|
|
59
|
+
* - "ad_user_data": "granted" or "denied"
|
|
60
|
+
* - "ad_personalization": "granted" or "denied"
|
|
61
|
+
*/
|
|
62
|
+
export interface GoogleConsentModeCallback {
|
|
63
|
+
(consentMap: Record<string, string>): void;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Concrete implementation of GoogleConsentMap interface
|
|
67
|
+
*/
|
|
68
|
+
export declare class GoogleConsentMapImpl implements GoogleConsentMap {
|
|
69
|
+
readonly consentMap: Record<GoogleConsentParameter, GoogleConsentStatus>;
|
|
70
|
+
constructor(consentMap: Record<GoogleConsentParameter, GoogleConsentStatus>);
|
|
71
|
+
toStringMap(): Record<string, string>;
|
|
72
|
+
isAnalyticsStorageGranted(): boolean;
|
|
73
|
+
isAdStorageGranted(): boolean;
|
|
74
|
+
isAdUserDataGranted(): boolean;
|
|
75
|
+
isAdPersonalizationGranted(): boolean;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=google-consent-mode.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-consent-mode.d.ts","sourceRoot":"","sources":["../../../../src/types/google-consent-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,oBAAY,sBAAsB;IACjC,iBAAiB,sBAAsB;IACvC,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,kBAAkB,uBAAuB;CACzC;AAED;;GAEG;AACH,oBAAY,mBAAmB;IAC9B,OAAO,YAAY;IACnB,MAAM,WAAW;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,sBAAsB,EAAE,mBAAmB,CAAC,CAAC;IAEzE;;;OAGG;IACH,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEtC;;;OAGG;IACH,yBAAyB,IAAI,OAAO,CAAC;IAErC;;;OAGG;IACH,kBAAkB,IAAI,OAAO,CAAC;IAE9B;;;OAGG;IACH,mBAAmB,IAAI,OAAO,CAAC;IAE/B;;;OAGG;IACH,0BAA0B,IAAI,OAAO,CAAC;CACtC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,yBAAyB;IACzC,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC3C;AAED;;GAEG;AACH,qBAAa,oBAAqB,YAAW,gBAAgB;IAC5D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,sBAAsB,EAAE,mBAAmB,CAAC,CAAC;gBAE7D,UAAU,EAAE,MAAM,CAAC,sBAAsB,EAAE,mBAAmB,CAAC;IAK3E,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAUrC,yBAAyB,IAAI,OAAO;IAOpC,kBAAkB,IAAI,OAAO;IAO7B,mBAAmB,IAAI,OAAO;IAO9B,0BAA0B,IAAI,OAAO;CAMrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/utils/Color.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"Color.d.ts","sourceRoot":"","sources":["../../../../src/utils/Color.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GACtB,cAAU,EACV,eAAe,MAAM,KACnB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,CA6C9C,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM,MAAM,EAAE,aACN,CAAC;AACxC,eAAO,MAAM,cAAc,GAAI,GAAG,MAAM,MAAM,EAAE,WAIqB,CAAC;AAEtE,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,WAA4B,CAAC;AAG/D,eAAO,MAAM,aAAa,GAAI,GAAG,MAAM,WAAsC,CAAC;AAC9E,eAAO,MAAM,gBAAgB,GAAI,GAAG,MAAM,MAAM,EAAE,WAIhD,CAAC;AAEH,eAAO,MAAM,WAAW,GAAI,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,KAAK,MAAM,UAKvE,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC/B,GAAG,MAAM,EACT,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,WACsC,CAAC;AACnD,eAAO,MAAM,kBAAkB,GAC9B,KAAK,MAAM,GAAG,MAAM,EAAE,EACtB,YAAY,MAAM,WAsClB,CAAC;AAEF,eAAO,MAAM,MAAM,GAAI,KAAK,MAAM,GAAG,MAAM,EAAE,EAAE,KAAK,MAAM,WAC5B,CAAC;AAC/B,eAAO,MAAM,OAAO,GAAI,KAAK,MAAM,GAAG,MAAM,EAAE,EAAE,KAAK,MAAM,WAC9B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../../../src/utils/EventEmitter.ts"],"names":[],"mappings":"AACA,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,QAAQ,CAAe;IAC/B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAW;gBAEhB,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IAMpE,MAAM;CAGN;AAED,qBAAa,YAAY;IACxB,OAAO,CAAC,OAAO,CAAkC;IAEjD,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../../../src/utils/EventEmitter.ts"],"names":[],"mappings":"AACA,qBAAa,iBAAiB;IAC7B,OAAO,CAAC,QAAQ,CAAe;IAC/B,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAW;gBAEhB,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IAMpE,MAAM;CAGN;AAED,qBAAa,YAAY;IACxB,OAAO,CAAC,OAAO,CAAkC;IAEjD,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IASpC,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;IASrC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE;IAMtC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ;CAOtC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class OsanoLogger {
|
|
2
|
+
private readonly TAG;
|
|
3
|
+
private isEnabled;
|
|
4
|
+
setEnabled(enabled: boolean): void;
|
|
5
|
+
getEnabled(): boolean;
|
|
6
|
+
error(message: string, error?: Error): void;
|
|
7
|
+
warn(message: string): void;
|
|
8
|
+
info(message: string): void;
|
|
9
|
+
debug(message: string): void;
|
|
10
|
+
verbose(message: string): void;
|
|
11
|
+
metric(name: string, durationMs: number): void;
|
|
12
|
+
log(message: string): void;
|
|
13
|
+
}
|
|
14
|
+
export declare const osanoLogger: OsanoLogger;
|
|
15
|
+
//# sourceMappingURL=OsanoLogger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OsanoLogger.d.ts","sourceRoot":"","sources":["../../../../src/utils/OsanoLogger.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IACvB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAc;IAClC,OAAO,CAAC,SAAS,CAAQ;IAEzB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;IAIlC,UAAU,IAAI,OAAO;IAIrB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI;IAS3C,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK3B,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK3B,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK5B,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAK9B,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAK9C,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;CAI1B;AAED,eAAO,MAAM,WAAW,aAAoB,CAAC"}
|
|
@@ -3,4 +3,5 @@ export declare function get<TData, TPath extends string | string[], TDefault = G
|
|
|
3
3
|
export declare function set(object: Record<string, any>, pathOrArray: string | string[], value: any): void;
|
|
4
4
|
export declare function merge(object: Record<string, any>, ...sources: Record<string, any>[]): Record<string, any>;
|
|
5
5
|
export declare function noop(): void;
|
|
6
|
+
export { osanoLogger as OsanoLogger } from './OsanoLogger';
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAW5C,wBAAgB,GAAG,CAClB,KAAK,EACL,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,EAC/B,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,EAErC,MAAM,EAAE,KAAK,EACb,WAAW,EAAE,KAAK,EAClB,YAAY,CAAC,EAAE,QAAQ,GACrB,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,QAAQ,CAOvC;AAED,wBAAgB,GAAG,CAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,EAC9B,KAAK,EAAE,GAAG,QAeV;AA2ED,wBAAgB,KAAK,CACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,GAAG,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,uBAGjC;AAED,wBAAgB,IAAI,SAAK"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAW5C,wBAAgB,GAAG,CAClB,KAAK,EACL,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,EAC/B,QAAQ,GAAG,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,EAErC,MAAM,EAAE,KAAK,EACb,WAAW,EAAE,KAAK,EAClB,YAAY,CAAC,EAAE,QAAQ,GACrB,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,QAAQ,CAOvC;AAED,wBAAgB,GAAG,CAClB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,EAC9B,KAAK,EAAE,GAAG,QAeV;AA2ED,wBAAgB,KAAK,CACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,GAAG,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,uBAGjC;AAED,wBAAgB,IAAI,SAAK;AAEzB,OAAO,EAAE,WAAW,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@osano/osano-cmp-react-native",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Package and example for the react-native Osano CMP SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
],
|
|
32
32
|
"scripts": {
|
|
33
33
|
"example": "yarn workspace osano-cmp-sdk-example",
|
|
34
|
-
"test": "jest src/services/__tests__/consent.test.ts src/__tests__/index.test.tsx",
|
|
34
|
+
"test": "jest src/services/__tests__/consent.test.ts src/__tests__/index.test.tsx src/services/__tests__/google-consent-mode.test.ts src/__tests__/OsanoLogger.test.ts",
|
|
35
|
+
"test:google-consent-mode": "jest src/services/__tests__/google-consent-mode.test.ts",
|
|
35
36
|
"typecheck": "tsc --noEmit",
|
|
36
37
|
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
37
38
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
@@ -64,6 +65,7 @@
|
|
|
64
65
|
"access": "public"
|
|
65
66
|
},
|
|
66
67
|
"devDependencies": {
|
|
68
|
+
"@biomejs/biome": "2.1.2",
|
|
67
69
|
"@commitlint/config-conventional": "^17.0.2",
|
|
68
70
|
"@docusaurus/core": "3.5.2",
|
|
69
71
|
"@docusaurus/module-type-aliases": "3.5.2",
|
package/src/ConsentManager.ts
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { NativeModules, Platform } from 'react-native';
|
|
2
|
+
import { CLEAR_CONSENT, SAVE_SUCCESS } from './actions';
|
|
3
|
+
import { ConsentCategory, mappedJurisdictions } from './constants';
|
|
4
|
+
import flavors, { defaultFlavor, type Flavor } from './flavors';
|
|
5
|
+
import type { Store } from './hooks/useThunkReducer';
|
|
6
|
+
import Tcf from './iab/tcf';
|
|
7
|
+
import type {
|
|
8
|
+
GppVersionType,
|
|
9
|
+
TcfController,
|
|
10
|
+
TcfVersionType,
|
|
11
|
+
Tcf_v2,
|
|
12
|
+
UspVersionType,
|
|
13
|
+
} from './iab/tcf/types';
|
|
3
14
|
import type {
|
|
4
15
|
GvlVendor_v2,
|
|
5
16
|
GvlVendor_v3,
|
|
@@ -7,30 +18,25 @@ import type {
|
|
|
7
18
|
IabFrameworkType,
|
|
8
19
|
IabState,
|
|
9
20
|
} from './iab/types';
|
|
10
|
-
import {
|
|
21
|
+
import { getDeviceId } from './native/OsanoCmp';
|
|
22
|
+
import { getConsent } from './selectors';
|
|
11
23
|
import {
|
|
12
24
|
clearConsent as clearStoredConsent,
|
|
13
25
|
fetchConfig,
|
|
14
26
|
fetchConsent,
|
|
27
|
+
getStoredConfig,
|
|
28
|
+
hasStaleConfig,
|
|
29
|
+
storeConfig,
|
|
15
30
|
} from './services/consent';
|
|
16
|
-
import
|
|
17
|
-
import { get, merge } from './utils';
|
|
31
|
+
import { GoogleConsentModeMapper } from './services/google-consent-mode-mapper';
|
|
18
32
|
import type { OsanoOverrides } from './types';
|
|
19
|
-
import type {
|
|
20
|
-
|
|
21
|
-
TcfController,
|
|
22
|
-
TcfVersionType,
|
|
23
|
-
Tcf_v2,
|
|
24
|
-
UspVersionType,
|
|
25
|
-
} from './iab/tcf/types';
|
|
26
|
-
import Tcf from './iab/tcf';
|
|
27
|
-
import Translator from './utils/Translator';
|
|
28
|
-
import { ConsentCategory, mappedJurisdictions } from './constants';
|
|
29
|
-
import { getDeviceId } from './native/OsanoCmp';
|
|
30
|
-
import type { Store } from './hooks/useThunkReducer';
|
|
33
|
+
import type { Config, Mode, Palette } from './types/consent-config';
|
|
34
|
+
import type { GoogleConsentModeCallback } from './types/google-consent-mode';
|
|
31
35
|
import type { OsanoAction, OsanoState } from './types/store';
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
36
|
+
import { get, merge } from './utils';
|
|
37
|
+
import { EventEmitter, type EventSubscription } from './utils/EventEmitter';
|
|
38
|
+
import { osanoLogger as OsanoLogger } from './utils/OsanoLogger';
|
|
39
|
+
import Translator from './utils/Translator';
|
|
34
40
|
|
|
35
41
|
const CONFIG_ID_ERROR = new Error('customerId and configId must be set');
|
|
36
42
|
const CONFIG_NOT_FOUND_ERROR = new Error('Config not found');
|
|
@@ -137,6 +143,43 @@ const migrateIabConfig = (
|
|
|
137
143
|
|
|
138
144
|
const emptyArray: never[] = [];
|
|
139
145
|
|
|
146
|
+
async function fetchConfigWithRetries(
|
|
147
|
+
customerId: string,
|
|
148
|
+
configId: string,
|
|
149
|
+
retries: number = 3,
|
|
150
|
+
delay: number = 500,
|
|
151
|
+
): Promise<Config | null> {
|
|
152
|
+
const isStale = await hasStaleConfig(configId);
|
|
153
|
+
|
|
154
|
+
if (!isStale) {
|
|
155
|
+
// If the config is not stale, we can return the cached config
|
|
156
|
+
const cachedConfig = await getStoredConfig(configId);
|
|
157
|
+
|
|
158
|
+
if (cachedConfig) {
|
|
159
|
+
return cachedConfig;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
for (let attempt = 1; attempt <= retries; attempt++) {
|
|
164
|
+
try {
|
|
165
|
+
const config = await fetchConfig(customerId, configId);
|
|
166
|
+
return config;
|
|
167
|
+
} catch (error) {
|
|
168
|
+
if (attempt < retries) {
|
|
169
|
+
OsanoLogger.warn(
|
|
170
|
+
`Attempt ${attempt} failed. Retrying in ${delay}ms...`,
|
|
171
|
+
);
|
|
172
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
173
|
+
delay *= 2; // Exponential backoff
|
|
174
|
+
} else {
|
|
175
|
+
throw error;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return null;
|
|
181
|
+
}
|
|
182
|
+
|
|
140
183
|
export class ConsentConfig extends EventEmitter {
|
|
141
184
|
private _config: Config;
|
|
142
185
|
private _customerId: string;
|
|
@@ -154,7 +197,7 @@ export class ConsentConfig extends EventEmitter {
|
|
|
154
197
|
this.emit('loadFailure', CONFIG_ID_ERROR);
|
|
155
198
|
return;
|
|
156
199
|
}
|
|
157
|
-
return
|
|
200
|
+
return fetchConfigWithRetries(this._customerId, this._configId)
|
|
158
201
|
.then((config: Config | null) => {
|
|
159
202
|
if (!config || Object.keys(config).length === 0) {
|
|
160
203
|
throw CONFIG_NOT_FOUND_ERROR;
|
|
@@ -175,12 +218,16 @@ export class ConsentConfig extends EventEmitter {
|
|
|
175
218
|
config.palette,
|
|
176
219
|
) as Palette;
|
|
177
220
|
this._config = merge(this._config, config) as Config;
|
|
221
|
+
storeConfig(this._configId, this._config);
|
|
178
222
|
this.emit('loadSuccess', this._config);
|
|
179
223
|
})
|
|
180
224
|
.catch((err) => {
|
|
181
225
|
this.emit('loadFailure', err);
|
|
182
226
|
});
|
|
183
227
|
}
|
|
228
|
+
get config(): Config {
|
|
229
|
+
return this._config;
|
|
230
|
+
}
|
|
184
231
|
set customerId(value: string) {
|
|
185
232
|
this._customerId = value || this._customerId;
|
|
186
233
|
}
|
|
@@ -575,6 +622,7 @@ export class ConsentManager {
|
|
|
575
622
|
private _consent?: ConsentCategory[];
|
|
576
623
|
private _translator: Translator = new Translator(this);
|
|
577
624
|
private _overridePalette?: Palette;
|
|
625
|
+
private _googleConsentModeCallback?: GoogleConsentModeCallback;
|
|
578
626
|
|
|
579
627
|
private _deviceId = '';
|
|
580
628
|
public get deviceId(): string {
|
|
@@ -629,7 +677,10 @@ export class ConsentManager {
|
|
|
629
677
|
try {
|
|
630
678
|
getDeviceId().then(setDeviceId);
|
|
631
679
|
} catch (err) {
|
|
632
|
-
|
|
680
|
+
OsanoLogger.error(
|
|
681
|
+
`Error getting device id: ${err}`,
|
|
682
|
+
err instanceof Error ? err : undefined,
|
|
683
|
+
);
|
|
633
684
|
}
|
|
634
685
|
this._locale = NativeModules.I18nManager.localeIdentifier;
|
|
635
686
|
break;
|
|
@@ -638,7 +689,10 @@ export class ConsentManager {
|
|
|
638
689
|
try {
|
|
639
690
|
getDeviceId().then(setDeviceId);
|
|
640
691
|
} catch (err) {
|
|
641
|
-
|
|
692
|
+
OsanoLogger.error(
|
|
693
|
+
`Error getting device id: ${err}`,
|
|
694
|
+
err instanceof Error ? err : undefined,
|
|
695
|
+
);
|
|
642
696
|
}
|
|
643
697
|
this._locale =
|
|
644
698
|
NativeModules.SettingsManager.settings.AppleLanguages[0] || //iOS 13
|
|
@@ -742,6 +796,7 @@ export class ConsentManager {
|
|
|
742
796
|
})
|
|
743
797
|
.then((consent) => {
|
|
744
798
|
this.consent = consent;
|
|
799
|
+
this.triggerGoogleConsentUpdate(consent);
|
|
745
800
|
return this._translator
|
|
746
801
|
.load(locale, onLangLoadSuccess, onLangLoadFailure)
|
|
747
802
|
.then((results) => {
|
|
@@ -806,6 +861,60 @@ export class ConsentManager {
|
|
|
806
861
|
return this._consent?.includes(category) ?? false;
|
|
807
862
|
}
|
|
808
863
|
|
|
864
|
+
/**
|
|
865
|
+
* Set the Google Consent Mode callback function
|
|
866
|
+
*
|
|
867
|
+
* @param callback - Function to call when consent updates occur
|
|
868
|
+
* @returns this ConsentManager instance for method chaining
|
|
869
|
+
*/
|
|
870
|
+
public setGoogleConsentModeCallback(
|
|
871
|
+
callback: GoogleConsentModeCallback,
|
|
872
|
+
): this {
|
|
873
|
+
this._googleConsentModeCallback = callback;
|
|
874
|
+
return this;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Trigger Google Consent Mode update with current consent categories
|
|
879
|
+
*
|
|
880
|
+
* @param categories - Array of consent categories that have been granted
|
|
881
|
+
* @public
|
|
882
|
+
*/
|
|
883
|
+
public triggerGoogleConsentUpdate(categories: ConsentCategory[]): void {
|
|
884
|
+
if (!this._config.googleConsent) {
|
|
885
|
+
OsanoLogger.debug('Google Consent Mode: disabled in configuration');
|
|
886
|
+
return;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
if (!this._googleConsentModeCallback) {
|
|
890
|
+
OsanoLogger.debug('Google Consent Mode: callback not set');
|
|
891
|
+
return;
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
try {
|
|
895
|
+
OsanoLogger.debug(
|
|
896
|
+
`Google Consent Mode: triggering callback with categories: ${JSON.stringify(categories)}`,
|
|
897
|
+
);
|
|
898
|
+
|
|
899
|
+
const categorySet = new Set(categories);
|
|
900
|
+
const googleConsentMap =
|
|
901
|
+
GoogleConsentModeMapper.buildGoogleConsentMap(categorySet);
|
|
902
|
+
|
|
903
|
+
const consentStringMap = googleConsentMap.toStringMap();
|
|
904
|
+
|
|
905
|
+
OsanoLogger.debug(
|
|
906
|
+
`Google Consent Mode: consent map: ${JSON.stringify(consentStringMap)}`,
|
|
907
|
+
);
|
|
908
|
+
this._googleConsentModeCallback(consentStringMap);
|
|
909
|
+
OsanoLogger.debug('Google Consent Mode: callback executed successfully');
|
|
910
|
+
} catch (error) {
|
|
911
|
+
OsanoLogger.warn(
|
|
912
|
+
`Google Consent Mode: Error triggering callback: ${error}`,
|
|
913
|
+
);
|
|
914
|
+
// Don't re-throw - callback errors shouldn't break consent flow
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
|
|
809
918
|
public get loaded(): boolean {
|
|
810
919
|
return this._loaded;
|
|
811
920
|
}
|
package/src/ConsentUiBuilder.tsx
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
2
|
+
import { StyleSheet, View } from 'react-native';
|
|
1
3
|
import {
|
|
2
4
|
type GetState,
|
|
3
5
|
type MiddlewareNext,
|
|
4
6
|
type Store,
|
|
5
7
|
type ThunkDispatch,
|
|
6
8
|
} from './hooks/useThunkReducer';
|
|
9
|
+
import type { GoogleConsentModeCallback } from './types/google-consent-mode';
|
|
7
10
|
import { type OsanoAction, type OsanoState } from './types/store';
|
|
8
|
-
import React, { useCallback, useEffect, useMemo } from 'react';
|
|
9
|
-
import { StyleSheet, View } from 'react-native';
|
|
10
11
|
|
|
12
|
+
import { setConfig } from './actions';
|
|
11
13
|
import { ConsentManager } from './ConsentManager';
|
|
12
|
-
import { Dialog } from './views/Dialog';
|
|
13
|
-
import { Drawer } from './views/Drawer';
|
|
14
14
|
import { OsanoPrivateContext } from './context';
|
|
15
15
|
import { createSharedStyles } from './styles';
|
|
16
|
-
import {
|
|
16
|
+
import { Dialog } from './views/Dialog';
|
|
17
|
+
import { Drawer } from './views/Drawer';
|
|
17
18
|
|
|
18
19
|
export const ConsentUiBuilder: React.FC<{
|
|
19
20
|
addMiddleware: (
|
|
20
21
|
m: (
|
|
21
|
-
store: Store<OsanoState, OsanoAction
|
|
22
|
-
) => (next: MiddlewareNext<OsanoAction>) => MiddlewareNext<OsanoAction
|
|
22
|
+
store: Store<OsanoState, OsanoAction>,
|
|
23
|
+
) => (next: MiddlewareNext<OsanoAction>) => MiddlewareNext<OsanoAction>,
|
|
23
24
|
) => void;
|
|
24
25
|
cmp: React.MutableRefObject<ConsentManager>;
|
|
25
26
|
dispatch: ThunkDispatch<OsanoState, OsanoAction, any>;
|
|
@@ -27,8 +28,8 @@ export const ConsentUiBuilder: React.FC<{
|
|
|
27
28
|
hideDisclosures: boolean;
|
|
28
29
|
removeMiddleware: (
|
|
29
30
|
m: (
|
|
30
|
-
store: Store<OsanoState, OsanoAction<any, any
|
|
31
|
-
) => (next: MiddlewareNext<OsanoAction>) => MiddlewareNext<OsanoAction
|
|
31
|
+
store: Store<OsanoState, OsanoAction<any, any>>,
|
|
32
|
+
) => (next: MiddlewareNext<OsanoAction>) => MiddlewareNext<OsanoAction>,
|
|
32
33
|
) => void;
|
|
33
34
|
}> = (props): React.ReactElement<View> => {
|
|
34
35
|
const {
|
|
@@ -45,16 +46,23 @@ export const ConsentUiBuilder: React.FC<{
|
|
|
45
46
|
(
|
|
46
47
|
path: string | string[],
|
|
47
48
|
translationProps = {},
|
|
48
|
-
defaultPhrase?: string
|
|
49
|
+
defaultPhrase?: string,
|
|
49
50
|
) => {
|
|
50
51
|
const translated = cmp.current.translator.translate(
|
|
51
52
|
path,
|
|
52
53
|
translationProps,
|
|
53
|
-
defaultPhrase
|
|
54
|
+
defaultPhrase,
|
|
54
55
|
);
|
|
55
56
|
return translated;
|
|
56
57
|
},
|
|
57
|
-
[cmp]
|
|
58
|
+
[cmp],
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const setGoogleConsentModeCallback = useCallback(
|
|
62
|
+
(callback: GoogleConsentModeCallback) => {
|
|
63
|
+
cmp.current.setGoogleConsentModeCallback(callback);
|
|
64
|
+
},
|
|
65
|
+
[cmp],
|
|
58
66
|
);
|
|
59
67
|
|
|
60
68
|
const privateContext = useMemo(() => {
|
|
@@ -71,6 +79,7 @@ export const ConsentUiBuilder: React.FC<{
|
|
|
71
79
|
locale: cmp.current.translator.locale,
|
|
72
80
|
sharedStyles: createSharedStyles(cmp.current.config || {}),
|
|
73
81
|
stack,
|
|
82
|
+
setGoogleConsentModeCallback,
|
|
74
83
|
};
|
|
75
84
|
}, [
|
|
76
85
|
addMiddleware,
|
|
@@ -82,6 +91,7 @@ export const ConsentUiBuilder: React.FC<{
|
|
|
82
91
|
handleTranslate,
|
|
83
92
|
getState,
|
|
84
93
|
stack,
|
|
94
|
+
setGoogleConsentModeCallback,
|
|
85
95
|
]);
|
|
86
96
|
|
|
87
97
|
// Update our store with the config when CMP loads or config changes
|
|
@@ -92,7 +102,7 @@ export const ConsentUiBuilder: React.FC<{
|
|
|
92
102
|
config: cmp.current.config,
|
|
93
103
|
customerId: cmp.current.customerId,
|
|
94
104
|
configId: cmp.current.configId,
|
|
95
|
-
})
|
|
105
|
+
}),
|
|
96
106
|
);
|
|
97
107
|
}
|
|
98
108
|
}, [cmp, dispatch, cmp.current.loaded, cmp.current.config]);
|