@marcoappio/marco-config 2.0.158 → 2.0.159

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/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
+ export { accountUtils } from './utils';
1
2
  export { marcoClients, marcoClientsUtils } from './clients';
2
3
  export { marcoPublicConfig, MARCO_ENV, MarcoEnvironment } from './marcoPublicConfig';
3
- export { marcoSDK } from './sdk';
4
- export { MarcoWSEvent, MarcoClient, MarcoWSSyncPoke, EndpointConfig, EndpointError, EndpointResponse, LabelSpecialUse } from './types';
5
4
  export { marcoSchemas } from './schemas';
5
+ export { marcoSDK } from './sdk';
6
6
  export { marcoWS } from './ws';
7
+ export { MarcoWSEvent, MarcoClient, MarcoWSSyncPoke, EndpointConfig, EndpointError, EndpointResponse, LabelSpecialUse } from './types';
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AACtI,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -1,5 +1,6 @@
1
+ export { accountUtils } from './utils';
1
2
  export { marcoClients, marcoClientsUtils } from './clients';
2
3
  export { marcoPublicConfig, MARCO_ENV } from './marcoPublicConfig';
3
- export { marcoSDK } from './sdk';
4
4
  export { marcoSchemas } from './schemas';
5
+ export { marcoSDK } from './sdk';
5
6
  export { marcoWS } from './ws';
@@ -0,0 +1,2 @@
1
+ export declare const generateAccountColor: (emailAddress: string) => string;
2
+ //# sourceMappingURL=generateAccountColor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateAccountColor.d.ts","sourceRoot":"","sources":["../../../src/utils/accounts/generateAccountColor.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,iBAAkB,MAAM,KAAG,MAqC3D,CAAA"}
@@ -0,0 +1,38 @@
1
+ export const generateAccountColor = (emailAddress) => {
2
+ const goldenRatio = 0.618033988749895;
3
+ let hash = 0;
4
+ for (let i = 0; i < emailAddress.length; i++) {
5
+ hash = emailAddress.charCodeAt(i) + ((hash << 5) - hash);
6
+ }
7
+ const normalizedHash = Math.abs(hash) / (2 ** 32);
8
+ const hue = (normalizedHash + goldenRatio) % 1;
9
+ const h = hue * 6;
10
+ const s = 0.8;
11
+ const v = 0.95;
12
+ const i = Math.floor(h);
13
+ const f = h - i;
14
+ const p = v * (1 - s);
15
+ const q = v * (1 - s * f);
16
+ const t = v * (1 - s * (1 - f));
17
+ let r, g, b;
18
+ switch (i % 6) {
19
+ case 0:
20
+ [r, g, b] = [v, t, p];
21
+ break;
22
+ case 1:
23
+ [r, g, b] = [q, v, p];
24
+ break;
25
+ case 2:
26
+ [r, g, b] = [p, v, t];
27
+ break;
28
+ case 3:
29
+ [r, g, b] = [p, q, v];
30
+ break;
31
+ case 4:
32
+ [r, g, b] = [t, p, v];
33
+ break;
34
+ default: [r, g, b] = [v, p, q];
35
+ }
36
+ const toHex = (n) => Math.floor(n * 255).toString(16).padStart(2, '0');
37
+ return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
38
+ };
@@ -0,0 +1,4 @@
1
+ export declare const accountUtils: {
2
+ generateColor: (emailAddress: string) => string;
3
+ };
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/accounts/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY;;CAExB,CAAA"}
@@ -0,0 +1,4 @@
1
+ import { generateAccountColor } from './generateAccountColor';
2
+ export const accountUtils = {
3
+ generateColor: generateAccountColor,
4
+ };
@@ -0,0 +1,2 @@
1
+ export { accountUtils } from './accounts';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA"}
@@ -0,0 +1 @@
1
+ export { accountUtils } from './accounts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marcoappio/marco-config",
3
- "version": "2.0.158",
3
+ "version": "2.0.159",
4
4
  "author": "team@marcoapp.io",
5
5
  "main": "dist/index.js",
6
6
  "repository": "git@github.com:marcoappio/marco-config.git",