@osano/osano-cmp-react-native 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/lib/commonjs/iab/constants.js +1 -1
  2. package/lib/commonjs/iab/tcf/consent.js +17 -11
  3. package/lib/commonjs/iab/tcf/consent.js.map +1 -1
  4. package/lib/commonjs/iab/tcf/reducer.js +11 -8
  5. package/lib/commonjs/iab/tcf/reducer.js.map +1 -1
  6. package/lib/commonjs/iab/tcf/selectors.js +16 -1
  7. package/lib/commonjs/iab/tcf/selectors.js.map +1 -1
  8. package/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.js +15 -3
  9. package/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.js.map +1 -1
  10. package/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.js +11 -2
  11. package/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.js.map +1 -1
  12. package/lib/module/iab/constants.js +1 -1
  13. package/lib/module/iab/tcf/consent.js +18 -12
  14. package/lib/module/iab/tcf/consent.js.map +1 -1
  15. package/lib/module/iab/tcf/reducer.js +12 -9
  16. package/lib/module/iab/tcf/reducer.js.map +1 -1
  17. package/lib/module/iab/tcf/selectors.js +13 -0
  18. package/lib/module/iab/tcf/selectors.js.map +1 -1
  19. package/lib/module/iab/tcf/v2.0/tcfcav1-constants.js +15 -3
  20. package/lib/module/iab/tcf/v2.0/tcfcav1-constants.js.map +1 -1
  21. package/lib/module/iab/tcf/v2.0/tcfeuv2-constants.js +11 -2
  22. package/lib/module/iab/tcf/v2.0/tcfeuv2-constants.js.map +1 -1
  23. package/lib/typescript/lib/commonjs/iab/constants.d.ts +1 -1
  24. package/lib/typescript/lib/commonjs/iab/tcf/consent.d.ts +2 -1
  25. package/lib/typescript/lib/commonjs/iab/tcf/consent.d.ts.map +1 -1
  26. package/lib/typescript/lib/commonjs/iab/tcf/reducer.d.ts +1 -0
  27. package/lib/typescript/lib/commonjs/iab/tcf/reducer.d.ts.map +1 -1
  28. package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts +2 -0
  29. package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts.map +1 -1
  30. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/index.d.ts +15 -6
  31. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/index.d.ts.map +1 -1
  32. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/shared-constants.d.ts +1 -1
  33. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/tcfcav1-constants.d.ts +6 -2
  34. package/lib/typescript/lib/commonjs/iab/tcf/v2.0/tcfeuv2-constants.d.ts +5 -2
  35. package/lib/typescript/lib/module/ConsentManager.d.ts +179 -2
  36. package/lib/typescript/lib/module/ConsentManager.d.ts.map +1 -1
  37. package/lib/typescript/lib/module/iab/constants.d.ts +1 -1
  38. package/lib/typescript/lib/module/iab/tcf/consent.d.ts +2 -1
  39. package/lib/typescript/lib/module/iab/tcf/consent.d.ts.map +1 -1
  40. package/lib/typescript/lib/module/iab/tcf/index.d.ts +33 -2
  41. package/lib/typescript/lib/module/iab/tcf/index.d.ts.map +1 -1
  42. package/lib/typescript/lib/module/iab/tcf/reducer.d.ts +1 -0
  43. package/lib/typescript/lib/module/iab/tcf/reducer.d.ts.map +1 -1
  44. package/lib/typescript/lib/module/iab/tcf/selectors.d.ts +2 -0
  45. package/lib/typescript/lib/module/iab/tcf/selectors.d.ts.map +1 -1
  46. package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts +33 -2
  47. package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts.map +1 -1
  48. package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts +2 -0
  49. package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts.map +1 -1
  50. package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts +19 -5
  51. package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -1
  52. package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts +11 -0
  53. package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -1
  54. package/lib/typescript/src/iab/constants.d.ts +1 -1
  55. package/lib/typescript/src/iab/tcf/consent.d.ts.map +1 -1
  56. package/lib/typescript/src/iab/tcf/reducer.d.ts +1 -0
  57. package/lib/typescript/src/iab/tcf/reducer.d.ts.map +1 -1
  58. package/lib/typescript/src/iab/tcf/selectors.d.ts +2 -0
  59. package/lib/typescript/src/iab/tcf/selectors.d.ts.map +1 -1
  60. package/lib/typescript/src/iab/tcf/types.d.ts +2 -0
  61. package/lib/typescript/src/iab/tcf/types.d.ts.map +1 -1
  62. package/lib/typescript/src/iab/tcf/v2.0/shared-constants.d.ts +2 -0
  63. package/lib/typescript/src/iab/tcf/v2.0/shared-constants.d.ts.map +1 -1
  64. package/lib/typescript/src/iab/tcf/v2.0/tcfcav1-constants.d.ts +6 -0
  65. package/lib/typescript/src/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -1
  66. package/lib/typescript/src/iab/tcf/v2.0/tcfeuv2-constants.d.ts +5 -0
  67. package/lib/typescript/src/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -1
  68. package/package.json +3 -3
  69. package/src/iab/constants.ts +1 -1
  70. package/src/iab/tcf/consent.ts +41 -26
  71. package/src/iab/tcf/reducer.ts +14 -7
  72. package/src/iab/tcf/selectors.ts +16 -0
  73. package/src/iab/tcf/types.ts +2 -0
  74. package/src/iab/tcf/v2.0/tcfcav1-constants.ts +24 -3
  75. package/src/iab/tcf/v2.0/tcfeuv2-constants.ts +19 -1
@@ -19,6 +19,7 @@ import { createUTCTimestampInDeciseconds } from '../helpers';
19
19
 
20
20
  // gppSection is the key in redux state that stores the consent string.
21
21
  const gppSection = 'tcfcav1';
22
+ const tcfPolicyVersion = 5;
22
23
  /**
23
24
  * This string is a stub with only the base values so that consent.js has a
24
25
  * string to start with. Its values are essentially blank and will be replaced
@@ -77,6 +78,22 @@ const coreFieldSequence: CoreField[] = [
77
78
  'vendor.legitimateInterests',
78
79
  idsOnlyArrayFormatter,
79
80
  ],
81
+ // This is not supported in TcfCA v1, HOWEVER, it's still listed and required in the spec doc, and should always be 0
82
+ ['PubRestrictions', 12, IntEncoder, 'numPubRestrictions'],
83
+ ];
84
+
85
+ /**
86
+ * The fields for the disclosed vendors segment of the TCString for TCF-Canada v1.
87
+ */
88
+ const disclosedVendorsFieldSequence: CoreField[] = [
89
+ ['DisclosedVendorsSegmentType', 3, IntEncoder],
90
+ [
91
+ 'DisclosedVendors',
92
+ Number.POSITIVE_INFINITY,
93
+ EncodableOptimizedFixedRange,
94
+ 'vendor.vendorsDisclosed',
95
+ idsOnlyArrayFormatter,
96
+ ],
80
97
  ];
81
98
 
82
99
  const version = Number.parseInt(baseInitOptions.version, 10);
@@ -84,8 +101,10 @@ const staticFields = {
84
101
  version,
85
102
  cmpId: baseInitOptions.cmpId,
86
103
  cmpVersion: baseInitOptions.cmpVersion,
87
- tcfPolicyVersion: version,
88
- useNonStandardStacks: true,
104
+ tcfPolicyVersion,
105
+ useNonStandardStacks: false,
106
+ DisclosedVendorsSegmentType: 1,
107
+ numPubRestrictions: 0,
89
108
  };
90
109
 
91
110
  const dynamicFields = {
@@ -95,7 +114,9 @@ const dynamicFields = {
95
114
 
96
115
  export const initOptions = {
97
116
  ...baseInitOptions,
98
- coreFieldSequence,
117
+ tcfPolicyVersion,
118
+ coreFieldSequence,
119
+ disclosedVendorsFieldSequence,
99
120
  gppSection,
100
121
  tcString: BOOTSTRAP_TCSTRING,
101
122
  staticFields,
@@ -17,6 +17,7 @@ export const iframeName = '__tcfapiLocator';
17
17
 
18
18
  // gppSection is the key in redux state that stores the consent string.
19
19
  const gppSection = 'tcfeuv2';
20
+ const tcfPolicyVersion = 5;
20
21
  /**
21
22
  * This string is a stub with only the base values so that consent.js has a
22
23
  * string to start with. It was generated with <https://iabtcf.com/>.
@@ -79,16 +80,31 @@ const coreFieldSequence: CoreField[] = [
79
80
  ['numPubRestrictions', 12, IntEncoder], // This is a meta field and shouldn't be exposed directly via an API
80
81
  ];
81
82
 
83
+ /**
84
+ * The fields for the disclosed vendors segment of the TCString in the order they appear in the TCString
85
+ */
86
+ const disclosedVendorsFieldSequence: CoreField[] = [
87
+ ['vendorsDisclosedSegmentType', 3, IntEncoder],
88
+ [
89
+ 'vendorsDisclosed',
90
+ Number.POSITIVE_INFINITY,
91
+ EncodableOptimizedFixedRange,
92
+ 'vendor.vendorsDisclosed',
93
+ ],
94
+ ];
95
+
96
+
82
97
  const version = Number.parseInt(baseInitOptions.version, 10);
83
98
  const staticFields = {
84
99
  version,
85
100
  cmpId: baseInitOptions.cmpId,
86
101
  cmpVersion: baseInitOptions.cmpVersion,
87
- tcfPolicyVersion: version,
102
+ tcfPolicyVersion,
88
103
  useNonStandardStacks: true,
89
104
  isServiceSpecific: true,
90
105
  purposeOneTreatment: false,
91
106
  numPubRestrictions: 0,
107
+ vendorsDisclosedSegmentType: 1,
92
108
  };
93
109
 
94
110
  const dynamicFields = {
@@ -98,7 +114,9 @@ const dynamicFields = {
98
114
 
99
115
  export const initOptions = {
100
116
  ...baseInitOptions,
117
+ tcfPolicyVersion,
101
118
  coreFieldSequence,
119
+ disclosedVendorsFieldSequence,
102
120
  gppSection,
103
121
  tcString: BOOTSTRAP_TCSTRING,
104
122
  staticFields,