@transcend-io/airgap.js-types 10.7.8 → 10.8.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 (60) hide show
  1. package/build/constants.d.ts +0 -3
  2. package/build/constants.d.ts.map +1 -1
  3. package/build/constants.js +7 -69
  4. package/build/constants.js.map +1 -1
  5. package/build/core.d.ts +1 -1
  6. package/build/core.d.ts.map +1 -1
  7. package/build/experience.d.ts +2 -0
  8. package/build/experience.d.ts.map +1 -1
  9. package/build/experience.js +72 -3
  10. package/build/experience.js.map +1 -1
  11. package/build/tsbuildinfo +1 -1
  12. package/build-esm/constants.d.ts +10 -0
  13. package/build-esm/constants.d.ts.map +1 -0
  14. package/build-esm/constants.js +35 -0
  15. package/build-esm/constants.js.map +1 -0
  16. package/build-esm/core.d.ts +688 -0
  17. package/build-esm/core.d.ts.map +1 -0
  18. package/build-esm/core.js +197 -0
  19. package/build-esm/core.js.map +1 -0
  20. package/build-esm/enums/browserLanguage.d.ts +248 -0
  21. package/build-esm/enums/browserLanguage.d.ts.map +1 -0
  22. package/build-esm/enums/browserLanguage.js +248 -0
  23. package/build-esm/enums/browserLanguage.js.map +1 -0
  24. package/build-esm/enums/experience.d.ts +12 -0
  25. package/build-esm/enums/experience.d.ts.map +1 -0
  26. package/build-esm/enums/experience.js +12 -0
  27. package/build-esm/enums/experience.js.map +1 -0
  28. package/build-esm/enums/index.d.ts +6 -0
  29. package/build-esm/enums/index.d.ts.map +1 -0
  30. package/build-esm/enums/index.js +6 -0
  31. package/build-esm/enums/index.js.map +1 -0
  32. package/build-esm/enums/privacyRegime.d.ts +23 -0
  33. package/build-esm/enums/privacyRegime.d.ts.map +1 -0
  34. package/build-esm/enums/privacyRegime.js +24 -0
  35. package/build-esm/enums/privacyRegime.js.map +1 -0
  36. package/build-esm/enums/purpose.d.ts +60 -0
  37. package/build-esm/enums/purpose.d.ts.map +1 -0
  38. package/build-esm/enums/purpose.js +44 -0
  39. package/build-esm/enums/purpose.js.map +1 -0
  40. package/build-esm/enums/viewState.d.ts +121 -0
  41. package/build-esm/enums/viewState.d.ts.map +1 -0
  42. package/build-esm/enums/viewState.js +90 -0
  43. package/build-esm/enums/viewState.js.map +1 -0
  44. package/build-esm/experience.d.ts +57 -0
  45. package/build-esm/experience.d.ts.map +1 -0
  46. package/build-esm/experience.js +107 -0
  47. package/build-esm/experience.js.map +1 -0
  48. package/build-esm/iab.d.ts +307 -0
  49. package/build-esm/iab.d.ts.map +1 -0
  50. package/build-esm/iab.js +150 -0
  51. package/build-esm/iab.js.map +1 -0
  52. package/build-esm/index.d.ts +7 -0
  53. package/build-esm/index.d.ts.map +1 -0
  54. package/build-esm/index.js +7 -0
  55. package/build-esm/index.js.map +1 -0
  56. package/build-esm/ui.d.ts +499 -0
  57. package/build-esm/ui.d.ts.map +1 -0
  58. package/build-esm/ui.js +101 -0
  59. package/build-esm/ui.js.map +1 -0
  60. package/package.json +4 -3
@@ -0,0 +1,101 @@
1
+ // external
2
+ import * as t from 'io-ts';
3
+ // main
4
+ import { applyEnum, valuesOf } from '@transcend-io/type-utils';
5
+ // local
6
+ import { InitialTranscendViewState, InitialViewState, PrivacyRegimeEnum, DismissedViewState, } from './enums';
7
+ /**
8
+ * Customer theming
9
+ */
10
+ export const ConsentManagerTheme = t.type({
11
+ /** Primary color */
12
+ primaryColor: t.string,
13
+ /** Font color */
14
+ fontColor: t.string,
15
+ });
16
+ /**
17
+ * Mobile-first responsive breakpoints
18
+ * No media query for mobile, which is the default
19
+ */
20
+ export const ConsentManagerBreakpoints = t.type({
21
+ /** In px, at or above this width is tablet */
22
+ tablet: t.string,
23
+ /** In px, at or above this width is desktop */
24
+ desktop: t.string,
25
+ });
26
+ /**
27
+ * TODO: https://transcend.height.app/T-19149 - remove
28
+ *
29
+ * @deprecated
30
+ */
31
+ export const PrivacyRegimeToInitialViewStateInput = t.partial(applyEnum(PrivacyRegimeEnum, () => valuesOf(InitialTranscendViewState)));
32
+ /**
33
+ * TODO: https://transcend.height.app/T-19149 - remove
34
+ *
35
+ * @deprecated
36
+ */
37
+ export const PrivacyRegimeToInitialViewState = t.record(valuesOf(PrivacyRegimeEnum), valuesOf(InitialTranscendViewState));
38
+ export const ExperienceToInitialViewState = t.record(t.string, valuesOf(InitialViewState));
39
+ export const RequiredConsentManagerConfig = t.type({
40
+ /** Customer theming */
41
+ theme: ConsentManagerTheme,
42
+ /** A set of responsive breakpoints */
43
+ breakpoints: ConsentManagerBreakpoints,
44
+ /** The privacy policy URL to redirect to */
45
+ privacyPolicy: t.string,
46
+ /** The secondary policy URL to redirect to */
47
+ secondaryPolicy: t.string,
48
+ /** Custom CSS stylesheet */
49
+ css: t.string,
50
+ /** Path to localizations directory */
51
+ messages: t.string,
52
+ /** What state the consent manager should launch in */
53
+ initialViewStateByPrivacyRegime: ExperienceToInitialViewState,
54
+ /** What state the consent manager should go to when dismissed */
55
+ dismissedViewState: valuesOf(DismissedViewState),
56
+ });
57
+ export const OptionalConsentManagerConfig = t.partial({
58
+ /** The set of enabled languages - CSV of ConsentManagerLanguageKey */
59
+ languages: t.string,
60
+ /** The override value for the consent banner z-index */
61
+ uiZIndex: t.string,
62
+ });
63
+ /** Consent manager UI configuration */
64
+ export const ConsentManagerConfig = t.intersection([
65
+ RequiredConsentManagerConfig,
66
+ OptionalConsentManagerConfig,
67
+ ]);
68
+ /** Input for Consent manager UI configuration */
69
+ export const ConsentManagerConfigInput = t.partial({
70
+ ...OptionalConsentManagerConfig.props,
71
+ ...RequiredConsentManagerConfig.props,
72
+ });
73
+ export const TCFConfig = t.type({
74
+ /** Path to vendor-list.json */
75
+ vendorList: t.string,
76
+ /** Custom CSS stylesheet */
77
+ css: t.string,
78
+ /** Path to localizations directory */
79
+ messages: t.string,
80
+ });
81
+ /** Input for Consent manager UI configuration */
82
+ export const TCFConfigInput = t.partial(TCFConfig.props);
83
+ export const DEFAULT_VIEW_STATE_BY_PRIVACY_REGIME = {
84
+ // EU
85
+ GDPR: InitialViewState.QuickOptions,
86
+ // Brazil
87
+ LGPD: InitialViewState.QuickOptions,
88
+ // Switzerland
89
+ nFADP: InitialViewState.QuickOptions,
90
+ // US: California
91
+ CPRA: InitialViewState.Hidden,
92
+ // US: Virginia
93
+ CDPA: InitialViewState.Hidden,
94
+ // US: Colorado
95
+ CPA: InitialViewState.Hidden,
96
+ // US: Nevada
97
+ NEVADA_SB220: InitialViewState.Hidden,
98
+ // Other
99
+ Unknown: InitialViewState.Hidden,
100
+ };
101
+ //# sourceMappingURL=ui.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,WAAW;AACX,OAAO,KAAK,CAAC,MAAM,OAAO,CAAC;AAE3B,OAAO;AACP,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAG/D,QAAQ;AACR,OAAO,EAEL,yBAAyB,EACzB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,SAAS,CAAC;AAsEjB;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,IAAI,CAAC;IACxC,oBAAoB;IACpB,YAAY,EAAE,CAAC,CAAC,MAAM;IACtB,iBAAiB;IACjB,SAAS,EAAE,CAAC,CAAC,MAAM;CACpB,CAAC,CAAC;AAKH;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC9C,8CAA8C;IAC9C,MAAM,EAAE,CAAC,CAAC,MAAM;IAChB,+CAA+C;IAC/C,OAAO,EAAE,CAAC,CAAC,MAAM;CAClB,CAAC,CAAC;AAOH;;;;GAIG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,OAAO,CAC3D,SAAS,CAAC,iBAAiB,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,CACxE,CAAC;AAWF;;;;GAIG;AACH,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,GAAG,CAAC,CAAC,IAAI,CAAC;IAC9B,+BAA+B;IAC/B,UAAU,EAAE,CAAC,CAAC,MAAM;IACpB,4BAA4B;IAC5B,GAAG,EAAE,CAAC,CAAC,MAAM;IACb,sCAAsC;IACtC,QAAQ,EAAE,CAAC,CAAC,MAAM;CACnB,CAAC,CAAC;AAKH,iDAAiD;AACjD,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAazD,MAAM,CAAC,MAAM,oCAAoC,GAC/C;IACE,KAAK;IACL,IAAI,EAAE,gBAAgB,CAAC,YAAY;IACnC,SAAS;IACT,IAAI,EAAE,gBAAgB,CAAC,YAAY;IACnC,cAAc;IACd,KAAK,EAAE,gBAAgB,CAAC,YAAY;IACpC,iBAAiB;IACjB,IAAI,EAAE,gBAAgB,CAAC,MAAM;IAC7B,eAAe;IACf,IAAI,EAAE,gBAAgB,CAAC,MAAM;IAC7B,eAAe;IACf,GAAG,EAAE,gBAAgB,CAAC,MAAM;IAC5B,aAAa;IACb,YAAY,EAAE,gBAAgB,CAAC,MAAM;IACrC,QAAQ;IACR,OAAO,EAAE,gBAAgB,CAAC,MAAM;CACjC,CAAC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Transcend Inc.",
3
3
  "name": "@transcend-io/airgap.js-types",
4
4
  "description": "TypeScript types for airgap.js interoperability with custom consent UIs",
5
- "version": "10.7.8",
5
+ "version": "10.8.0",
6
6
  "homepage": "https://github.com/transcend-io/airgap.js-types",
7
7
  "repository": {
8
8
  "type": "git",
@@ -12,13 +12,14 @@
12
12
  "main": "build/index",
13
13
  "files": [
14
14
  "build/**/*",
15
+ "build-esm/**/*",
15
16
  "package.json"
16
17
  ],
17
18
  "scripts": {
18
19
  "update:sdks": "yarn set version from sources && yarn sdks base",
19
20
  "update:deps": "yarn upgrade-interactive && yarn update:sdks",
20
- "build": "yarn pnpify tsc --build",
21
- "clean": "yarn pnpify tsc --build --clean",
21
+ "build": "yarn pnpify tsc --build && yarn pnpify tsc --module es2022 --outDir build-esm",
22
+ "clean": "yarn pnpify tsc --build --clean && rm -rf build && rm -rf build-esm",
22
23
  "lint": "yarn pnpify eslint src --ext .ts",
23
24
  "prepublish": "yarn build",
24
25
  "test": "echo 'no tests'"