@ampsec/platform-client 48.3.0 → 50.0.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.
@@ -1,4 +1,7 @@
1
+ /** @deprecated: Use AMP_SETTINGS instead */
1
2
  export declare enum AmpSettingKeys {
3
+ /** @deprecated: Use AMP_SETTINGS.tenant.DEFAULT_NOTIFICATION_CONNECTOR_ID instead */
2
4
  DEFAULT_NOTIFICATION_CONNECTOR = "DEFAULT_NOTIFICATION_CONNECTOR",
5
+ /** @deprecated: Use AMP_SETTINGS.tenant.GHOST_MODE instead */
3
6
  GHOST_MODE = "GHOST_MODE"
4
7
  }
@@ -2,9 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AmpSettingKeys = void 0;
4
4
  /* eslint-disable no-unused-vars */
5
+ /** @deprecated: Use AMP_SETTINGS instead */
5
6
  var AmpSettingKeys;
6
7
  (function (AmpSettingKeys) {
8
+ /** @deprecated: Use AMP_SETTINGS.tenant.DEFAULT_NOTIFICATION_CONNECTOR_ID instead */
7
9
  AmpSettingKeys["DEFAULT_NOTIFICATION_CONNECTOR"] = "DEFAULT_NOTIFICATION_CONNECTOR";
10
+ /** @deprecated: Use AMP_SETTINGS.tenant.GHOST_MODE instead */
8
11
  AmpSettingKeys["GHOST_MODE"] = "GHOST_MODE";
9
12
  })(AmpSettingKeys || (exports.AmpSettingKeys = AmpSettingKeys = {}));
10
13
  //# sourceMappingURL=ampSettingKeys.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ampSettingKeys.enum.js","sourceRoot":"","sources":["../../../../src/dto/enums/ampSettingKeys.enum.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,mFAAiE,CAAA;IACjE,2CAAyB,CAAA;AAC3B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB"}
1
+ {"version":3,"file":"ampSettingKeys.enum.js","sourceRoot":"","sources":["../../../../src/dto/enums/ampSettingKeys.enum.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,4CAA4C;AAC5C,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,qFAAqF;IACrF,mFAAiE,CAAA;IACjE,8DAA8D;IAC9D,2CAAyB,CAAA;AAC3B,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB"}
@@ -2,4 +2,5 @@ export * from './dto';
2
2
  export * from './etag';
3
3
  export * from './logging';
4
4
  export * from './services';
5
+ export * from './settings';
5
6
  export * from './FilterCriteria';
@@ -18,5 +18,6 @@ __exportStar(require("./dto"), exports);
18
18
  __exportStar(require("./etag"), exports);
19
19
  __exportStar(require("./logging"), exports);
20
20
  __exportStar(require("./services"), exports);
21
+ __exportStar(require("./settings"), exports);
21
22
  __exportStar(require("./FilterCriteria"), exports);
22
23
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,yCAAuB;AACvB,4CAA0B;AAC1B,6CAA2B;AAC3B,mDAAiC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAsB;AACtB,yCAAuB;AACvB,4CAA0B;AAC1B,6CAA2B;AAC3B,6CAA2B;AAC3B,mDAAiC"}
@@ -35,9 +35,9 @@ export declare class AmpSettingsMap {
35
35
  private readonly settings;
36
36
  private readonly rawSettingsList;
37
37
  constructor(settings: TenantSettingsMap, rawSettingsList: AmpSettingDto[]);
38
- getGlobalSetting: <T>(key: TypedAmpSettingsKey<T>) => T;
39
- getConnectorSetting: <T>(cid: string, key: TypedAmpSettingsKey<T>) => T;
38
+ getGlobalSetting: <T>(key: TypedAmpSettingsKey<T>) => T | undefined;
39
+ getConnectorSetting: <T>(cid: string, key: TypedAmpSettingsKey<T>) => T | undefined;
40
40
  getConnectorSettings: (cid: string) => RawAmpSettingsMap | undefined;
41
41
  getRawMap: () => TenantSettingsMap;
42
- static asKey: <T>(key: AmpSettingKey, defaultValue: T) => TypedAmpSettingsKey<T>;
42
+ static asKey: <T>(key: AmpSettingKey, defaultValue?: T | undefined) => TypedAmpSettingsKey<T>;
43
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"settings.service.js","sourceRoot":"","sources":["../../../src/services/settings.service.ts"],"names":[],"mappings":";;;;;;AAAA,oDAAuB;AAoBvB,MAAa,kBAAkB;IAG7B,YAAY,IAAgB,EAAE,YAAuB,KAAK;QAK1D,mBAAc,GAAG,KAAK,EAAE,GAAY,EAA2B,EAAE;YAC/D,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC/B,GAAG,EAAE,IAAI,IAAI,CAAC,SAAS,cAAc;gBACrC,MAAM,EAAE,KAAK;gBACb,MAAM,EAAE,EAAC,GAAG,EAAC;aACd,CAAC,CAAC;YACH,MAAM,IAAI,GAAG,GAAG,CAAC,IAA2B,CAAC;YAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC;YAC3B,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE;gBACzB,IAAI,gBAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,0CAA0C,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;oBAC/F,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;iBAC3C;YACH,CAAC,CAAC,CAAC;YACH,MAAM,cAAc,GAAsB,kBAAkB,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC9F,OAAO,IAAI,cAAc,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;QACtD,CAAC,CAAC;QAEF,mBAAc,GAAG,KAAK,EAAK,SAA2E,EAAE,GAAY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,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;QACvD,CAAC,CAAC;QAEF,cAAS,GAAG,GAAsB,EAAE;YAClC,OAAO,kBAAkB,CAAC,gBAAgB,CAAC,IAAI,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;QAC1E,CAAC,CAAC;QApCA,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;IACzC,CAAC;;AAPH,wCAiDC;AANQ,oBAAK,GAAG,CAAI,GAAkB,EAAE,YAAgB,EAA0B,EAAE;IACjF,OAAO;QACL,EAAE,EAAE,GAAG;QACP,YAAY;KACa,CAAC;AAC9B,CAAC,AALW,CAKV"}
@@ -1,9 +1,65 @@
1
- export declare const NOTIFICATIONS_ENALBED: import("./services").TypedAmpSettingsKey<boolean>;
2
- /********************
3
- * PROVIDERS *
4
- ********************/
5
- export declare const SLACK_EXECUTIVE_GROUPS: import("./services").TypedAmpSettingsKey<string[]>;
6
- export declare const SLACK_PROD_ACCESS_GROUPS: import("./services").TypedAmpSettingsKey<string[]>;
7
- export declare const SLACK_PRIV_ACCESS_GROUPS: import("./services").TypedAmpSettingsKey<string[]>;
8
- export declare const SLACK_CONTACT_SECURITY_CHANNEL: import("./services").TypedAmpSettingsKey<string>;
9
- export declare const SLACK_CONTACT_SECURITY_TEMPLATE: import("./services").TypedAmpSettingsKey<string>;
1
+ /**
2
+ * Collection of hard coded settings to be use centrally across services and user interfaces.
3
+ *
4
+ * # Naming convention:
5
+ * Keys should be name spaced following dot notation, e.g. notifications.ghost_mode.enabled`.
6
+ *
7
+ * ## Use Cases
8
+ * 1. Boolean "enabled" toggles should end in `*.enabled`. You should never use the inverse `*.disabled`
9
+ * 2. Id's should always end in the typed abbreviation, e.g.
10
+ * - connector => `*.cid`
11
+ * - provider => `*.pid`
12
+ * - user => `*.uid`
13
+ * - external id => `*.extId`
14
+ * 3. Arrays are plurals of other rules
15
+ * ... more to come
16
+ */
17
+ export declare const AMP_SETTINGS: {
18
+ /**
19
+ * GLOBAL ONLY
20
+ * ===========
21
+ * These are tenant level settings that are not meant to be overridden at the connector level
22
+ */
23
+ tenant: {
24
+ /** Disables all automated messages from being sent to end users. */
25
+ GHOST_MODE: import("./services").TypedAmpSettingsKey<boolean>;
26
+ /** Enables mock providers on the tenant. */
27
+ ENABLE_MOCKS: import("./services").TypedAmpSettingsKey<boolean>;
28
+ /**
29
+ * Specifies which mock tenant to use.
30
+ * - `david`: single insecure user
31
+ * - `ampsec`: founding team of amplifier security with mock data
32
+ * - `stryper`: branded small test tenant
33
+ * - `acme`: mocked data for ~25 users
34
+ * - `ingen`: mocked data for ~250 users
35
+ */
36
+ MOCK_TENANT_ID: import("./services").TypedAmpSettingsKey<string>;
37
+ /** Specifies the default connector for the `messages` delivery strategy. */
38
+ DEFAULT_NOTIFICATION_CONNECTOR_ID: import("./services").TypedAmpSettingsKey<string>;
39
+ };
40
+ /**
41
+ * GLOBAL
42
+ * Note: these can be overridden by connector level settings
43
+ */
44
+ inherited: {
45
+ /** Not currently implemented/respected */
46
+ NOTIFICATIONS_ENABLED: import("./services").TypedAmpSettingsKey<boolean>;
47
+ };
48
+ /********************
49
+ * PROVIDERS *
50
+ ********************/
51
+ google: {
52
+ GOOGLE_EXECUTIVE_GROUPS: import("./services").TypedAmpSettingsKey<string[]>;
53
+ GOOGLE_PROD_ACCESS_GROUPS: import("./services").TypedAmpSettingsKey<string[]>;
54
+ GOOGLE_PRIV_ACCESS_GROUPS: import("./services").TypedAmpSettingsKey<string[]>;
55
+ GOOGLE_SERV_ACCT_GROUPS: import("./services").TypedAmpSettingsKey<string[]>;
56
+ };
57
+ slack: {
58
+ SLACK_EXECUTIVE_GROUPS: import("./services").TypedAmpSettingsKey<string[]>;
59
+ SLACK_PROD_ACCESS_GROUPS: import("./services").TypedAmpSettingsKey<string[]>;
60
+ SLACK_PRIV_ACCESS_GROUPS: import("./services").TypedAmpSettingsKey<string[]>;
61
+ SLACK_SERV_ACCT_GROUPS: import("./services").TypedAmpSettingsKey<string[]>;
62
+ SLACK_CONTACT_SECURITY_CHANNEL: import("./services").TypedAmpSettingsKey<string>;
63
+ SLACK_CONTACT_SECURITY_TEMPLATE: import("./services").TypedAmpSettingsKey<string>;
64
+ };
65
+ };
@@ -1,26 +1,72 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SLACK_CONTACT_SECURITY_TEMPLATE = exports.SLACK_CONTACT_SECURITY_CHANNEL = exports.SLACK_PRIV_ACCESS_GROUPS = exports.SLACK_PROD_ACCESS_GROUPS = exports.SLACK_EXECUTIVE_GROUPS = exports.NOTIFICATIONS_ENALBED = void 0;
3
+ exports.AMP_SETTINGS = void 0;
4
4
  const services_1 = require("./services");
5
- /*
6
- * GLOBAL ONLY
7
- * TODO:
5
+ // TODO document this object
6
+ /**
7
+ * Collection of hard coded settings to be use centrally across services and user interfaces.
8
+ *
9
+ * # Naming convention:
10
+ * Keys should be name spaced following dot notation, e.g. notifications.ghost_mode.enabled`.
11
+ *
12
+ * ## Use Cases
13
+ * 1. Boolean "enabled" toggles should end in `*.enabled`. You should never use the inverse `*.disabled`
14
+ * 2. Id's should always end in the typed abbreviation, e.g.
15
+ * - connector => `*.cid`
16
+ * - provider => `*.pid`
17
+ * - user => `*.uid`
18
+ * - external id => `*.extId`
19
+ * 3. Arrays are plurals of other rules
20
+ * ... more to come
8
21
  */
9
- /*
10
- * GLOBAL
11
- * Note: these can be overridden by connector level settings
12
- */
13
- exports.NOTIFICATIONS_ENALBED = services_1.AmpSettingsMap.asKey('notifications.enabled', false); // TODO: enble by default
14
- /********************
15
- * PROVIDERS *
16
- ********************/
17
- /*
18
- * SLACK
19
- */
20
- exports.SLACK_EXECUTIVE_GROUPS = services_1.AmpSettingsMap.asKey('slack.executive.groups', []);
21
- exports.SLACK_PROD_ACCESS_GROUPS = services_1.AmpSettingsMap.asKey('slack.prod_access.groups', []);
22
- exports.SLACK_PRIV_ACCESS_GROUPS = services_1.AmpSettingsMap.asKey('slack.priv_access.groups', []);
23
- exports.SLACK_CONTACT_SECURITY_CHANNEL = services_1.AmpSettingsMap.asKey('slack.contact_security.channel', '');
24
- // TODO: localization
25
- exports.SLACK_CONTACT_SECURITY_TEMPLATE = services_1.AmpSettingsMap.asKey('slack.contact_security.template', 'Thanks for getting in touch! We forwarded your message to our security team and they will get back to you shortly.');
22
+ exports.AMP_SETTINGS = {
23
+ /**
24
+ * GLOBAL ONLY
25
+ * ===========
26
+ * These are tenant level settings that are not meant to be overridden at the connector level
27
+ */
28
+ tenant: {
29
+ /** Disables all automated messages from being sent to end users. */
30
+ GHOST_MODE: services_1.AmpSettingsMap.asKey('notifications.ghost_mode.enabled', false),
31
+ /** Enables mock providers on the tenant. */
32
+ ENABLE_MOCKS: services_1.AmpSettingsMap.asKey('mocks.enabled', false),
33
+ /**
34
+ * Specifies which mock tenant to use.
35
+ * - `david`: single insecure user
36
+ * - `ampsec`: founding team of amplifier security with mock data
37
+ * - `stryper`: branded small test tenant
38
+ * - `acme`: mocked data for ~25 users
39
+ * - `ingen`: mocked data for ~250 users
40
+ */
41
+ MOCK_TENANT_ID: services_1.AmpSettingsMap.asKey('mocks.tenant.id', 'stryper'),
42
+ /** Specifies the default connector for the `messages` delivery strategy. */
43
+ DEFAULT_NOTIFICATION_CONNECTOR_ID: services_1.AmpSettingsMap.asKey('notifications.connectors.default.cid'),
44
+ },
45
+ /**
46
+ * GLOBAL
47
+ * Note: these can be overridden by connector level settings
48
+ */
49
+ inherited: {
50
+ /** Not currently implemented/respected */
51
+ NOTIFICATIONS_ENABLED: services_1.AmpSettingsMap.asKey('notifications.enabled', false),
52
+ },
53
+ /********************
54
+ * PROVIDERS *
55
+ ********************/
56
+ google: {
57
+ GOOGLE_EXECUTIVE_GROUPS: services_1.AmpSettingsMap.asKey('google.groups.exec.extIds', []),
58
+ GOOGLE_PROD_ACCESS_GROUPS: services_1.AmpSettingsMap.asKey('google.groups.prod.extIds', []),
59
+ GOOGLE_PRIV_ACCESS_GROUPS: services_1.AmpSettingsMap.asKey('google.groups.priv.extIds', []),
60
+ GOOGLE_SERV_ACCT_GROUPS: services_1.AmpSettingsMap.asKey('google.groups.serv_acct.extIds', []),
61
+ },
62
+ slack: {
63
+ SLACK_EXECUTIVE_GROUPS: services_1.AmpSettingsMap.asKey('slack.groups.exec.extIds', []),
64
+ SLACK_PROD_ACCESS_GROUPS: services_1.AmpSettingsMap.asKey('slack.groups.prod.extIds', []),
65
+ SLACK_PRIV_ACCESS_GROUPS: services_1.AmpSettingsMap.asKey('slack.groups.priv.extIds', []),
66
+ SLACK_SERV_ACCT_GROUPS: services_1.AmpSettingsMap.asKey('slack.groups.serv_acct.extIds', []),
67
+ SLACK_CONTACT_SECURITY_CHANNEL: services_1.AmpSettingsMap.asKey('slack.channels.contact_security.extId'),
68
+ // TODO localization... does this get moved to contentful? Does the setting "point" to content in contentful?
69
+ SLACK_CONTACT_SECURITY_TEMPLATE: services_1.AmpSettingsMap.asKey('slack.templates.contact_security', 'Thanks for getting in touch! We forwarded your message to our security team and they will get back to you shortly.'),
70
+ },
71
+ };
26
72
  //# sourceMappingURL=settings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/settings.ts"],"names":[],"mappings":";;;AAAA,yCAA0C;AAE1C;;;GAGG;AAEH;;;GAGG;AACU,QAAA,qBAAqB,GAAG,yBAAc,CAAC,KAAK,CAAU,uBAAuB,EAAE,KAAK,CAAC,CAAC,CAAC,yBAAyB;AAE7H;;sBAEsB;AAEtB;;GAEG;AACU,QAAA,sBAAsB,GAAG,yBAAc,CAAC,KAAK,CAAW,wBAAwB,EAAE,EAAE,CAAC,CAAC;AACtF,QAAA,wBAAwB,GAAG,yBAAc,CAAC,KAAK,CAAW,0BAA0B,EAAE,EAAE,CAAC,CAAC;AAC1F,QAAA,wBAAwB,GAAG,yBAAc,CAAC,KAAK,CAAW,0B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c,CAAC,KAAK,CAAW,0BAA0B,EAAE,EAAE,CAAC;QACtF,wBAAwB,EAAE,yBAAc,CAAC,KAAK,CAAW,0BAA0B,EAAE,EAAE,CAAC;QACxF,wBAAwB,EAAE,yBAAc,CAAC,KAAK,CAAW,0BAA0B,EAAE,EAAE,CAAC;QACxF,sBAAsB,EAAE,yBAAc,CAAC,KAAK,CAAW,+BAA+B,EAAE,EAAE,CAAC;QAC3F,8BAA8B,EAAE,yBAAc,CAAC,KAAK,CAAS,uCAAuC,CAAC;QACrG,6GAA6G;QAC7G,+BAA+B,EAAE,yBAAc,CAAC,KAAK,CACnD,kCAAkC,EAClC,oHAAoH,CACrH;KACF;CACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "48.3.0",
3
+ "version": "50.0.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -1,5 +1,8 @@
1
1
  /* eslint-disable no-unused-vars */
2
+ /** @deprecated: Use AMP_SETTINGS instead */
2
3
  export enum AmpSettingKeys {
4
+ /** @deprecated: Use AMP_SETTINGS.tenant.DEFAULT_NOTIFICATION_CONNECTOR_ID instead */
3
5
  DEFAULT_NOTIFICATION_CONNECTOR = 'DEFAULT_NOTIFICATION_CONNECTOR',
6
+ /** @deprecated: Use AMP_SETTINGS.tenant.GHOST_MODE instead */
4
7
  GHOST_MODE = 'GHOST_MODE',
5
8
  }
package/src/index.ts CHANGED
@@ -2,4 +2,5 @@ export * from './dto';
2
2
  export * from './etag';
3
3
  export * from './logging';
4
4
  export * from './services';
5
+ export * from './settings';
5
6
  export * from './FilterCriteria';
@@ -118,7 +118,7 @@ export class AmpSettingsMap {
118
118
  this.rawSettingsList = rawSettingsList;
119
119
  }
120
120
 
121
- getGlobalSetting = <T>(key: TypedAmpSettingsKey<T>): T => {
121
+ getGlobalSetting = <T>(key: TypedAmpSettingsKey<T>): T | undefined => {
122
122
  const tenantVal = this.settings.tenantSettings[key.id];
123
123
  if (!_.isNil(tenantVal)) {
124
124
  return tenantVal as T;
@@ -126,7 +126,7 @@ export class AmpSettingsMap {
126
126
  return key.defaultValue;
127
127
  };
128
128
 
129
- getConnectorSetting = <T>(cid: string, key: TypedAmpSettingsKey<T>): T => {
129
+ getConnectorSetting = <T>(cid: string, key: TypedAmpSettingsKey<T>): T | undefined => {
130
130
  const tenantVal = this.settings.tenantSettings[key.id];
131
131
  const connectorMap = this.settings.connectorSettings[cid];
132
132
  if (connectorMap) {
@@ -152,10 +152,10 @@ export class AmpSettingsMap {
152
152
  return AmpSettingsService.formatSettingMap(this.rawSettingsList, false);
153
153
  };
154
154
 
155
- static asKey = <T>(key: AmpSettingKey, defaultValue: T): TypedAmpSettingsKey<T> => {
155
+ static asKey = <T>(key: AmpSettingKey, defaultValue?: T): TypedAmpSettingsKey<T> => {
156
156
  return {
157
157
  id: key,
158
158
  defaultValue,
159
- };
159
+ } as TypedAmpSettingsKey<T>;
160
160
  };
161
161
  }
package/src/settings.ts CHANGED
@@ -1,29 +1,72 @@
1
1
  import {AmpSettingsMap} from './services';
2
2
 
3
- /*
4
- * GLOBAL ONLY
5
- * TODO:
3
+ // TODO document this object
4
+ /**
5
+ * Collection of hard coded settings to be use centrally across services and user interfaces.
6
+ *
7
+ * # Naming convention:
8
+ * Keys should be name spaced following dot notation, e.g. notifications.ghost_mode.enabled`.
9
+ *
10
+ * ## Use Cases
11
+ * 1. Boolean "enabled" toggles should end in `*.enabled`. You should never use the inverse `*.disabled`
12
+ * 2. Id's should always end in the typed abbreviation, e.g.
13
+ * - connector => `*.cid`
14
+ * - provider => `*.pid`
15
+ * - user => `*.uid`
16
+ * - external id => `*.extId`
17
+ * 3. Arrays are plurals of other rules
18
+ * ... more to come
6
19
  */
7
-
8
- /*
9
- * GLOBAL
10
- * Note: these can be overridden by connector level settings
11
- */
12
- export const NOTIFICATIONS_ENALBED = AmpSettingsMap.asKey<boolean>('notifications.enabled', false); // TODO: enble by default
13
-
14
- /********************
15
- * PROVIDERS *
16
- ********************/
17
-
18
- /*
19
- * SLACK
20
- */
21
- export const SLACK_EXECUTIVE_GROUPS = AmpSettingsMap.asKey<string[]>('slack.executive.groups', []);
22
- export const SLACK_PROD_ACCESS_GROUPS = AmpSettingsMap.asKey<string[]>('slack.prod_access.groups', []);
23
- export const SLACK_PRIV_ACCESS_GROUPS = AmpSettingsMap.asKey<string[]>('slack.priv_access.groups', []);
24
- export const SLACK_CONTACT_SECURITY_CHANNEL = AmpSettingsMap.asKey<string>('slack.contact_security.channel', '');
25
- // TODO: localization
26
- export const SLACK_CONTACT_SECURITY_TEMPLATE = AmpSettingsMap.asKey<string>(
27
- 'slack.contact_security.template',
28
- 'Thanks for getting in touch! We forwarded your message to our security team and they will get back to you shortly.'
29
- );
20
+ export const AMP_SETTINGS = {
21
+ /**
22
+ * GLOBAL ONLY
23
+ * ===========
24
+ * These are tenant level settings that are not meant to be overridden at the connector level
25
+ */
26
+ tenant: {
27
+ /** Disables all automated messages from being sent to end users. */
28
+ GHOST_MODE: AmpSettingsMap.asKey<boolean>('notifications.ghost_mode.enabled', false), // TODO enble by default
29
+ /** Enables mock providers on the tenant. */
30
+ ENABLE_MOCKS: AmpSettingsMap.asKey<boolean>('mocks.enabled', false),
31
+ /**
32
+ * Specifies which mock tenant to use.
33
+ * - `david`: single insecure user
34
+ * - `ampsec`: founding team of amplifier security with mock data
35
+ * - `stryper`: branded small test tenant
36
+ * - `acme`: mocked data for ~25 users
37
+ * - `ingen`: mocked data for ~250 users
38
+ */
39
+ MOCK_TENANT_ID: AmpSettingsMap.asKey<string>('mocks.tenant.id', 'stryper'),
40
+ /** Specifies the default connector for the `messages` delivery strategy. */
41
+ DEFAULT_NOTIFICATION_CONNECTOR_ID: AmpSettingsMap.asKey<string>('notifications.connectors.default.cid'),
42
+ },
43
+ /**
44
+ * GLOBAL
45
+ * Note: these can be overridden by connector level settings
46
+ */
47
+ inherited: {
48
+ /** Not currently implemented/respected */
49
+ NOTIFICATIONS_ENABLED: AmpSettingsMap.asKey<boolean>('notifications.enabled', false),
50
+ },
51
+ /********************
52
+ * PROVIDERS *
53
+ ********************/
54
+ google: {
55
+ GOOGLE_EXECUTIVE_GROUPS: AmpSettingsMap.asKey<string[]>('google.groups.exec.extIds', []),
56
+ GOOGLE_PROD_ACCESS_GROUPS: AmpSettingsMap.asKey<string[]>('google.groups.prod.extIds', []),
57
+ GOOGLE_PRIV_ACCESS_GROUPS: AmpSettingsMap.asKey<string[]>('google.groups.priv.extIds', []),
58
+ GOOGLE_SERV_ACCT_GROUPS: AmpSettingsMap.asKey<string[]>('google.groups.serv_acct.extIds', []),
59
+ },
60
+ slack: {
61
+ SLACK_EXECUTIVE_GROUPS: AmpSettingsMap.asKey<string[]>('slack.groups.exec.extIds', []),
62
+ SLACK_PROD_ACCESS_GROUPS: AmpSettingsMap.asKey<string[]>('slack.groups.prod.extIds', []),
63
+ SLACK_PRIV_ACCESS_GROUPS: AmpSettingsMap.asKey<string[]>('slack.groups.priv.extIds', []),
64
+ SLACK_SERV_ACCT_GROUPS: AmpSettingsMap.asKey<string[]>('slack.groups.serv_acct.extIds', []),
65
+ SLACK_CONTACT_SECURITY_CHANNEL: AmpSettingsMap.asKey<string>('slack.channels.contact_security.extId'),
66
+ // TODO localization... does this get moved to contentful? Does the setting "point" to content in contentful?
67
+ SLACK_CONTACT_SECURITY_TEMPLATE: AmpSettingsMap.asKey<string>(
68
+ 'slack.templates.contact_security',
69
+ 'Thanks for getting in touch! We forwarded your message to our security team and they will get back to you shortly.'
70
+ ),
71
+ },
72
+ };