ConfigBuilder.d.ts 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. export interface InstrumentationConfiguration {
  2. enabled: boolean;
  3. key: string;
  4. scriptURL: string;
  5. productTitle: string;
  6. productID: string;
  7. versionNumber: string;
  8. partIds: Array<string>;
  9. capabilities: Array<string>;
  10. accountId?: string;
  11. accountIdType?: string;
  12. tenantId?: string;
  13. digitalContextEnable?: boolean;
  14. whitelistedValues?: Array<string>;
  15. whitelist?: boolean;
  16. autoSPAEnabled?: boolean;
  17. email?: string;
  18. creationTime?: string;
  19. productLocale?: string;
  20. gbt10?: string;
  21. gbt15?: string;
  22. gbt17?: string;
  23. gbt20?: string;
  24. gbtlvlcd?: string;
  25. category?: string;
  26. environment?: string;
  27. isTrial?: boolean;
  28. roles?: Array<string>;
  29. }
  30. export declare enum SegmentKeys {
  31. accountId = "accountId",
  32. accountIdType = "accountIdType",
  33. browserLanguage = "browserLanguage",
  34. capabilities = "capabilities",
  35. gbt10 = "GBT10",
  36. gbt15 = "GBT15",
  37. gbt17 = "GBT17",
  38. gbt20 = "GBT20",
  39. gbtlvlcd = "GBTLVLCD",
  40. isIBMer = "isIBMer",
  41. isTestUser = "isTestUser",
  42. isTrial = "isTrial",
  43. productVersion = "productVersion",
  44. partIds = "partNumber",
  45. productID = "productId",
  46. productTitle = "productTitle",
  47. roles = "user.role",
  48. tenantId = "tenantId",
  49. url = "url"
  50. }
  51. export interface IdentifyTraits {
  52. [SegmentKeys.productVersion]: string;
  53. [SegmentKeys.partIds]: string;
  54. [SegmentKeys.tenantId]: string;
  55. [SegmentKeys.accountId]: string;
  56. [SegmentKeys.isIBMer]: boolean;
  57. [SegmentKeys.isTestUser]: boolean;
  58. [SegmentKeys.url]: string;
  59. createdAt: string;
  60. }
  61. export interface IdentifyContext {
  62. context: {
  63. isIBMer: boolean;
  64. isTestUser: boolean;
  65. page: {
  66. referrer: string;
  67. search: string;
  68. title: string;
  69. url: string;
  70. };
  71. };
  72. }
  73. export declare enum EmailDomains {
  74. IBM = "ibm.com",
  75. YOPMAIL = "yopmail.com",
  76. MAILINATOR = "mailinator.com",
  77. COGNOS = "cognos.com"
  78. }
  79. export default class ConfigBuilder {
  80. private serviceConfig;
  81. constructor(config: InstrumentationConfiguration);
  82. readonly config: InstrumentationConfiguration;
  83. disableService(): void;
  84. buildTraits(): IdentifyTraits;
  85. buildContext(): IdentifyContext;
  86. buildAnalyticsKey(): object;
  87. buildDigitalDataKey(category: string): any;
  88. buildDDO(): {};
  89. pageEventPayload(): {};
  90. trackEventPayload(): {};
  91. private readonly isEnabled;
  92. private readonly commonHrefProps;
  93. private isIBMer;
  94. private isTestUser;
  95. private validateEmail;
  96. private readonly commonEvtProps;
  97. private readonly email;
  98. private readonly creationTime;
  99. private readonly productLocale;
  100. private readonly url;
  101. private readonly search;
  102. private readonly pathname;
  103. private readonly referrer;
  104. private readonly whitelist;
  105. private readonly whitelistedValues;
  106. private readonly key;
  107. private readonly environment;
  108. private readonly version;
  109. private readonly productID;
  110. private readonly productTitle;
  111. private readonly tenantId;
  112. private readonly accountId;
  113. private readonly accountIdType;
  114. private readonly gbt10;
  115. private readonly gbt15;
  116. private readonly gbt17;
  117. private readonly gbt20;
  118. private readonly gbtlvlcd;
  119. private readonly partIds;
  120. private readonly partIdsString;
  121. private readonly isAutoSPAEnabled;
  122. private readonly capabilities;
  123. private readonly capabilitiesString;
  124. private readonly isTrial;
  125. private readonly roles;
  126. private readonly rolesString;
  127. }