asma-helpers 0.14.14 → 0.14.16

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.
@@ -12,6 +12,18 @@ declare const OpenReplayObject: {
12
12
  }) => void) | undefined;
13
13
  };
14
14
  export type IGlobalOpenReplay = Required<typeof OpenReplayObject>;
15
+ export declare function getOpenReplayObject(): {
16
+ started: boolean;
17
+ tracker: Tracker | undefined;
18
+ trackerProfiler: ((name: string) => (fn: () => Function, thisArg?: unknown) => unknown) | undefined;
19
+ trackerGraphQL: ((_1: string, _2: string, _3: unknown, result: unknown) => unknown) | undefined;
20
+ mobxObserver: ((ev: {
21
+ type: string;
22
+ name: string;
23
+ object: any;
24
+ debugObjectName: string;
25
+ }) => void) | undefined;
26
+ };
15
27
  export declare function getOpenReplayTrackerObject<Keys extends keyof IGlobalOpenReplay>(name: Keys): Required<{
16
28
  started: boolean;
17
29
  tracker: Tracker | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"openReplayObject.d.ts","sourceRoot":"","sources":["../../src/helpers/openReplayObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAA;AAE9C,QAAA,MAAM,gBAAgB;;;6BAKoB,MAAM,UAAU,MAAM,QAAQ,YAAY,OAAO,KAAK,OAAO;0BAChE,MAAM,MAAM,MAAM,MAAM,OAAO,UAAU,OAAO,KAAK,OAAO;wBAEnF;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,MAAM,CAAC;QAAC,MAAM,EAAE,GAAG,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;CAE5F,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEjE,wBAAgB,0BAA0B,CAAC,IAAI,SAAS,MAAM,iBAAiB,EAAE,IAAI,EAAE,IAAI;;;;;;;;;;;SAK1F;AAED,wBAAgB,0BAA0B,CAAC,GAAG,SAAS,MAAM,iBAAiB,EAC1E,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,iBAAiB,CAAC,GAAG,CAAC,QAOjC"}
1
+ {"version":3,"file":"openReplayObject.d.ts","sourceRoot":"","sources":["../../src/helpers/openReplayObject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAA;AAE9C,QAAA,MAAM,gBAAgB;;;6BAKoB,MAAM,UAAU,MAAM,QAAQ,YAAY,OAAO,KAAK,OAAO;0BAChE,MAAM,MAAM,MAAM,MAAM,OAAO,UAAU,OAAO,KAAK,OAAO;wBAEnF;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,MAAM,CAAC;QAAC,MAAM,EAAE,GAAG,CAAC;QAAC,eAAe,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI;CAE5F,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAEjE,wBAAgB,mBAAmB;;;;;;;;;;;EAKlC;AACD,wBAAgB,0BAA0B,CAAC,IAAI,SAAS,MAAM,iBAAiB,EAAE,IAAI,EAAE,IAAI;;;;;;;;;;;SAK1F;AAED,wBAAgB,0BAA0B,CAAC,GAAG,SAAS,MAAM,iBAAiB,EAC1E,IAAI,EAAE,GAAG,EACT,MAAM,EAAE,iBAAiB,CAAC,GAAG,CAAC,QAOjC"}
@@ -6,6 +6,13 @@ const OpenReplayObject = {
6
6
  trackerGraphQL: undefined,
7
7
  mobxObserver: undefined,
8
8
  };
9
+ export function getOpenReplayObject() {
10
+ var _a;
11
+ if ((_a = window.__ASMA__SHELL__) === null || _a === void 0 ? void 0 : _a.openreplay_object) {
12
+ return window.__ASMA__SHELL__.openreplay_object;
13
+ }
14
+ return OpenReplayObject;
15
+ }
9
16
  export function getOpenReplayTrackerObject(name) {
10
17
  var _a;
11
18
  if ((_a = window.__ASMA__SHELL__) === null || _a === void 0 ? void 0 : _a.openreplay_object) {
@@ -1 +1 @@
1
- {"version":3,"file":"openReplayObject.js","sourceRoot":"","sources":["../../src/helpers/openReplayObject.ts"],"names":[],"mappings":"AAEA,MAAM,gBAAgB,GAAG;IACrB,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,SAAgC;IAEzC,wDAAwD;IACxD,eAAe,EAAE,SAA+F;IAChH,cAAc,EAAE,SAA4F;IAC5G,YAAY,EAAE,SAEC;CAClB,CAAA;AAID,MAAM,UAAU,0BAA0B,CAAuC,IAAU;;IACvF,IAAI,MAAA,MAAM,CAAC,eAAe,0CAAE,iBAAiB,EAAE;QAC3C,OAAO,MAAM,CAAC,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;KACxD;IACD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC;AAED,MAAM,UAAU,0BAA0B,CACtC,IAAS,EACT,MAA8B;IAE9B,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAA;IAE/B,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAA;IAErD,MAAM,CAAC,eAAe,CAAC,iBAAiB,GAAG,gBAAgB,CAAA;AAC/D,CAAC"}
1
+ {"version":3,"file":"openReplayObject.js","sourceRoot":"","sources":["../../src/helpers/openReplayObject.ts"],"names":[],"mappings":"AAEA,MAAM,gBAAgB,GAAG;IACrB,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,SAAgC;IAEzC,wDAAwD;IACxD,eAAe,EAAE,SAA+F;IAChH,cAAc,EAAE,SAA4F;IAC5G,YAAY,EAAE,SAEC;CAClB,CAAA;AAID,MAAM,UAAU,mBAAmB;;IAC/B,IAAI,MAAA,MAAM,CAAC,eAAe,0CAAE,iBAAiB,EAAE;QAC3C,OAAO,MAAM,CAAC,eAAe,CAAC,iBAAiB,CAAA;KAClD;IACD,OAAO,gBAAgB,CAAA;AAC3B,CAAC;AACD,MAAM,UAAU,0BAA0B,CAAuC,IAAU;;IACvF,IAAI,MAAA,MAAM,CAAC,eAAe,0CAAE,iBAAiB,EAAE;QAC3C,OAAO,MAAM,CAAC,eAAe,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAA;KACxD;IACD,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAA;AACjC,CAAC;AAED,MAAM,UAAU,0BAA0B,CACtC,IAAS,EACT,MAA8B;IAE9B,gBAAgB,CAAC,IAAI,CAAC,GAAG,MAAM,CAAA;IAE/B,MAAM,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,IAAI,EAAE,CAAA;IAErD,MAAM,CAAC,eAAe,CAAC,iBAAiB,GAAG,gBAAgB,CAAA;AAC/D,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function sha256(ascii: string): string;
2
+ //# sourceMappingURL=sha256.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sha256.d.ts","sourceRoot":"","sources":["../../src/helpers/sha256.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAoG5C"}
@@ -0,0 +1,89 @@
1
+ export function sha256(ascii) {
2
+ function rightRotate(value, amount) {
3
+ return (value >>> amount) | (value << (32 - amount));
4
+ }
5
+ const mathPow = Math.pow;
6
+ const maxWord = mathPow(2, 32);
7
+ const lengthProperty = 'length';
8
+ let i, j; // Used as a counter across the whole file
9
+ let result = '';
10
+ const words = [];
11
+ const asciiBitLength = ascii[lengthProperty] * 8;
12
+ //* caching results is optional - remove/add slash from front of this line to toggle
13
+ // Initial hash value: first 32 bits of the fractional parts of the square roots of the first 8 primes
14
+ // (we actually calculate the first 64, but extra values are just ignored)
15
+ let hash = []; //(sha256.h = sha256.h || [])
16
+ // Round constants: first 32 bits of the fractional parts of the cube roots of the first 64 primes
17
+ const k = []; //(sha256.k = sha256.k || [])
18
+ let primeCounter = k[lengthProperty];
19
+ /*/
20
+ var hash = [], k = [];
21
+ var primeCounter = 0;
22
+ //*/
23
+ const isComposite = [];
24
+ for (let candidate = 2; primeCounter < 64; candidate++) {
25
+ if (!isComposite[candidate]) {
26
+ for (i = 0; i < 313; i += candidate) {
27
+ isComposite[i] = candidate;
28
+ }
29
+ hash[primeCounter] = (mathPow(candidate, 0.5) * maxWord) | 0;
30
+ k[primeCounter++] = (mathPow(candidate, 1 / 3) * maxWord) | 0;
31
+ }
32
+ }
33
+ ascii += '\x80'; // Append Ƈ' bit (plus zero padding)
34
+ while ((ascii[lengthProperty] % 64) - 56)
35
+ ascii += '\x00'; // More zero padding
36
+ for (i = 0; i < ascii[lengthProperty]; i++) {
37
+ j = ascii.charCodeAt(i);
38
+ if (j >> 8)
39
+ return ''; // ASCII check: only accept characters in range 0-255
40
+ words[i >> 2] |= j << (((3 - i) % 4) * 8);
41
+ }
42
+ words[words[lengthProperty]] = (asciiBitLength / maxWord) | 0;
43
+ words[words[lengthProperty]] = asciiBitLength;
44
+ // process each chunk
45
+ for (j = 0; j < words[lengthProperty];) {
46
+ const w = words.slice(j, (j += 16)); // The message is expanded into 64 words as part of the iteration
47
+ const oldHash = hash;
48
+ // This is now the undefinedworking hash", often labelled as variables a...g
49
+ // (we have to truncate as well, otherwise extra entries at the end accumulate
50
+ hash = hash.slice(0, 8);
51
+ for (i = 0; i < 64; i++) {
52
+ //const i2 = i + j
53
+ // Expand the message into 64 words
54
+ // Used below if
55
+ const w15 = w[i - 15] || 0, w2 = w[i - 2] || 0;
56
+ // Iterate
57
+ const a = hash[0] || 0, e = hash[4] || 0;
58
+ const temp1 = (hash[7] || 0) +
59
+ (rightRotate(e, 6) ^ rightRotate(e, 11) ^ rightRotate(e, 25)) + // S1
60
+ ((e & (hash[5] || 0)) ^ (~e & (hash[6] || 0))) + // ch
61
+ (k[i] || 0) +
62
+ // Expand the message schedule if needed
63
+ (w[i] =
64
+ i < 16
65
+ ? w[i] || 0
66
+ : ((w[i - 16] || 0) +
67
+ (rightRotate(w15, 7) ^ rightRotate(w15, 18) ^ (w15 >>> 3)) + // s0
68
+ (w[i - 7] || 0) +
69
+ (rightRotate(w2, 17) ^ rightRotate(w2, 19) ^ (w2 >>> 10))) | // s1
70
+ 0);
71
+ // This is only used once, so *could* be moved below, but it only saves 4 bytes and makes things unreadble
72
+ const temp2 = (rightRotate(a, 2) ^ rightRotate(a, 13) ^ rightRotate(a, 22)) + // S0
73
+ ((a & (hash[1] || 0)) ^ (a & (hash[2] || 0)) ^ ((hash[1] || 0) & (hash[2] || 0))); // maj
74
+ hash = [(temp1 + temp2) | 0].concat(hash); // We don't bother trimming off the extra ones, they're harmless as long as we're truncating when we do the slice()
75
+ hash[4] = ((hash[4] || 0) + temp1) | 0;
76
+ }
77
+ for (i = 0; i < 8; i++) {
78
+ hash[i] = ((hash[i] || 0) + (oldHash[i] || 0)) | 0;
79
+ }
80
+ }
81
+ for (i = 0; i < 8; i++) {
82
+ for (j = 3; j + 1; j--) {
83
+ const b = ((hash[i] || 0) >> (j * 8)) & 255;
84
+ result += (b < 16 ? 0 : '') + b.toString(16);
85
+ }
86
+ }
87
+ return result;
88
+ }
89
+ //# sourceMappingURL=sha256.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sha256.js","sourceRoot":"","sources":["../../src/helpers/sha256.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAC,KAAa;IAChC,SAAS,WAAW,CAAC,KAAa,EAAE,MAAc;QAC9C,OAAO,CAAC,KAAK,KAAK,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAA;IACxD,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAA;IACxB,MAAM,OAAO,GAAG,OAAO,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;IAC9B,MAAM,cAAc,GAAG,QAAQ,CAAA;IAC/B,IAAI,CAAC,EAAE,CAAC,CAAA,CAAC,0CAA0C;IACnD,IAAI,MAAM,GAAG,EAAE,CAAA;IAEf,MAAM,KAAK,GAAa,EAAE,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 export * from './helpers/initASMAAppVitals';
23
23
  export * from './helpers/registerOpenReplay';
24
24
  export * from './helpers/urlParams.helpers';
25
25
  export * from './helpers/openReplayConfigs';
26
+ export * from './helpers/sha256';
26
27
  export * from './utility/fetch';
27
28
  export * from './clients/srvAuth';
28
29
  export type { IUploadedDocument } from './interfaces/api/advoca/IUploadedDocument';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gDAAgD,CAAA;AAE9D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qCAAqC,CAAA;AACnD,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AAEtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sCAAsC,CAAA;AACpD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wCAAwC,CAAA;AACtD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAE3C,cAAc,iBAAiB,CAAA;AAE/B,cAAc,mBAAmB,CAAA;AAEjC,YAAY,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAEzF,cAAc,oBAAoB,CAAA;AAElC,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gDAAgD,CAAA;AAE9D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qCAAqC,CAAA;AACnD,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AAEtC,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sCAAsC,CAAA;AACpD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wCAAwC,CAAA;AACtD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kBAAkB,CAAA;AAEhC,cAAc,iBAAiB,CAAA;AAE/B,cAAc,mBAAmB,CAAA;AAEjC,YAAY,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAClF,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,yCAAyC,CAAA;AAEzF,cAAc,oBAAoB,CAAA;AAElC,cAAc,UAAU,CAAA"}
package/lib/index.js CHANGED
@@ -24,6 +24,7 @@ export * from './helpers/initASMAAppVitals';
24
24
  export * from './helpers/registerOpenReplay';
25
25
  export * from './helpers/urlParams.helpers';
26
26
  export * from './helpers/openReplayConfigs';
27
+ export * from './helpers/sha256';
27
28
  export * from './utility/fetch';
28
29
  export * from './clients/srvAuth';
29
30
  export * from './interfaces/enums';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gDAAgD,CAAA;AAE9D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qCAAqC,CAAA;AACnD,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,wDAAwD;AACxD,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sCAAsC,CAAA;AACpD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wCAAwC,CAAA;AACtD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAE3C,cAAc,iBAAiB,CAAA;AAE/B,cAAc,mBAAmB,CAAA;AAKjC,cAAc,oBAAoB,CAAA;AAElC,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAA;AAC7C,cAAc,iCAAiC,CAAA;AAC/C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,gCAAgC,CAAA;AAC9C,cAAc,qBAAqB,CAAA;AACnC,cAAc,sBAAsB,CAAA;AACpC,cAAc,kBAAkB,CAAA;AAChC,cAAc,gDAAgD,CAAA;AAE9D,cAAc,+BAA+B,CAAA;AAC7C,cAAc,oBAAoB,CAAA;AAClC,cAAc,4BAA4B,CAAA;AAC1C,cAAc,qCAAqC,CAAA;AACnD,cAAc,mCAAmC,CAAA;AACjD,cAAc,wBAAwB,CAAA;AACtC,wDAAwD;AACxD,cAAc,0BAA0B,CAAA;AACxC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,sCAAsC,CAAA;AACpD,cAAc,4BAA4B,CAAA;AAC1C,cAAc,wBAAwB,CAAA;AACtC,cAAc,sBAAsB,CAAA;AACpC,cAAc,wCAAwC,CAAA;AACtD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,6BAA6B,CAAA;AAC3C,cAAc,kBAAkB,CAAA;AAEhC,cAAc,iBAAiB,CAAA;AAE/B,cAAc,mBAAmB,CAAA;AAKjC,cAAc,oBAAoB,CAAA;AAElC,cAAc,UAAU,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asma-helpers",
3
- "version": "0.14.14",
3
+ "version": "0.14.16",
4
4
  "description": "helpers methods for asma",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib",
package/pnpm-lock.yaml ADDED
@@ -0,0 +1,278 @@
1
+ lockfileVersion: '6.1'
2
+
3
+ settings:
4
+ autoInstallPeers: true
5
+ excludeLinksFromLockfile: false
6
+
7
+ dependencies:
8
+ asma-event-bus:
9
+ specifier: ^0.0.45
10
+ version: 0.0.45
11
+ idb-keyval:
12
+ specifier: ^6.2.0
13
+ version: 6.2.1
14
+ mobx:
15
+ specifier: ^6.6.1
16
+ version: 6.9.0
17
+ mobx-state-tree:
18
+ specifier: ^5.1.5
19
+ version: 5.1.8(mobx@6.9.0)
20
+
21
+ devDependencies:
22
+ '@genql/runtime':
23
+ specifier: ^2.10.0
24
+ version: 2.10.0(graphql@16.6.0)
25
+ '@openreplay/tracker':
26
+ specifier: ^8.0.0
27
+ version: 8.0.0
28
+ asma-types:
29
+ specifier: ^1.3.4
30
+ version: 1.3.9
31
+ history:
32
+ specifier: ^5.3.0
33
+ version: 5.3.0
34
+ typescript:
35
+ specifier: ^5.0.4
36
+ version: 5.1.3
37
+
38
+ packages:
39
+
40
+ /@babel/runtime@7.22.5:
41
+ resolution: {integrity: sha512-ecjvYlnAaZ/KVneE/OdKYBYfgXV3Ptu6zQWmgEF7vwKhQnvVS6bjMD2XYgj+SNvQ1GfK/pjgokfPkC/2CO8CuA==}
42
+ engines: {node: '>=6.9.0'}
43
+ dependencies:
44
+ regenerator-runtime: 0.13.11
45
+ dev: true
46
+
47
+ /@genql/runtime@2.10.0(graphql@16.6.0):
48
+ resolution: {integrity: sha512-hWy4fkHAk0OUW/cmjAOhbE3PnR9YfwaE8DRl5oEf7r9K6Owju8ogTDV3RMkG6Vm57H9xYxI5+am5ImAUbqPH8A==}
49
+ peerDependencies:
50
+ graphql: '*'
51
+ dependencies:
52
+ '@types/qs': 6.9.7
53
+ '@types/ws': 6.0.4
54
+ graphql: 16.6.0
55
+ graphql-query-batcher: 1.0.1
56
+ isomorphic-unfetch: 3.1.0
57
+ lodash: 4.17.21
58
+ subscriptions-transport-ws: 0.9.19(graphql@16.6.0)
59
+ tslib: 2.5.3
60
+ utility-types: 3.10.0
61
+ ws: 6.2.2
62
+ zen-observable-ts: 0.8.21
63
+ transitivePeerDependencies:
64
+ - bufferutil
65
+ - encoding
66
+ - utf-8-validate
67
+ dev: true
68
+
69
+ /@medv/finder@3.1.0:
70
+ resolution: {integrity: sha512-ojkXjR3K0Zz3jnCR80tqPL+0yvbZk/lEodb6RIVjLz7W8RVA2wrw8ym/CzCpXO9SYVUIKHFUpc7jvf8UKfIM3w==}
71
+ dev: true
72
+
73
+ /@openreplay/tracker@8.0.0:
74
+ resolution: {integrity: sha512-PGHRiHQFC5aTQPjkHe6YiiaqRtTbc9a4LPt8daJIFMzd1xAUZGhdRwb9/BZi+z6vv5PBRboKprPpjzJrvshPVA==}
75
+ engines: {node: '>=14.0'}
76
+ dependencies:
77
+ '@medv/finder': 3.1.0
78
+ error-stack-parser: 2.1.4
79
+ fflate: 0.7.4
80
+ dev: true
81
+
82
+ /@types/node@20.2.5:
83
+ resolution: {integrity: sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==}
84
+ dev: true
85
+
86
+ /@types/qs@6.9.7:
87
+ resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==}
88
+ dev: true
89
+
90
+ /@types/ws@6.0.4:
91
+ resolution: {integrity: sha512-PpPrX7SZW9re6+Ha8ojZG4Se8AZXgf0GK6zmfqEuCsY49LFDNXO3SByp44X3dFEqtB73lkCDAdUazhAjVPiNwg==}
92
+ dependencies:
93
+ '@types/node': 20.2.5
94
+ dev: true
95
+
96
+ /asma-event-bus@0.0.45:
97
+ resolution: {integrity: sha512-0MvhFMnk510T/2Cq1WIkRNMi4w8DbESNndKGuAOUlGbC07MvERGy6mvMNX7EM7YcAWOOZAu3m3xenGlQU9J53Q==}
98
+ dependencies:
99
+ asma-types: 1.3.9
100
+ dev: false
101
+
102
+ /asma-types@1.3.9:
103
+ resolution: {integrity: sha512-gYZ5Rqljbmn4zNUBG/3HxUossCM4XDbqJsBgvvZqihAQ6F5GFAPAIi8Sd/8ZkGVAFDtGkYxk1Z1tHKilWg19Ew==}
104
+
105
+ /async-limiter@1.0.1:
106
+ resolution: {integrity: sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==}
107
+ dev: true
108
+
109
+ /backo2@1.0.2:
110
+ resolution: {integrity: sha512-zj6Z6M7Eq+PBZ7PQxl5NT665MvJdAkzp0f60nAJ+sLaSCBPMwVak5ZegFbgVCzFcCJTKFoMizvM5Ld7+JrRJHA==}
111
+ dev: true
112
+
113
+ /error-stack-parser@2.1.4:
114
+ resolution: {integrity: sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==}
115
+ dependencies:
116
+ stackframe: 1.3.4
117
+ dev: true
118
+
119
+ /eventemitter3@3.1.2:
120
+ resolution: {integrity: sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==}
121
+ dev: true
122
+
123
+ /fflate@0.7.4:
124
+ resolution: {integrity: sha512-5u2V/CDW15QM1XbbgS+0DfPxVB+jUKhWEKuuFuHncbk3tEEqzmoXL+2KyOFuKGqOnmdIy0/davWF1CkuwtibCw==}
125
+ dev: true
126
+
127
+ /graphql-query-batcher@1.0.1:
128
+ resolution: {integrity: sha512-NGntvsC2R6c+yqOiMfKXZL3/PpQUIpy70RgroPXRcuDJ1wxJJFesJAEu3Wv5gLbOpr/xPqXCMw2yTGHbqs8uqQ==}
129
+ dev: true
130
+
131
+ /graphql@16.6.0:
132
+ resolution: {integrity: sha512-KPIBPDlW7NxrbT/eh4qPXz5FiFdL5UbaA0XUNz2Rp3Z3hqBSkbj0GVjwFDztsWVauZUWsbKHgMg++sk8UX0bkw==}
133
+ engines: {node: ^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0}
134
+ dev: true
135
+
136
+ /history@5.3.0:
137
+ resolution: {integrity: sha512-ZqaKwjjrAYUYfLG+htGaIIZ4nioX2L70ZUMIFysS3xvBsSG4x/n1V6TXV3N8ZYNuFGlDirFg32T7B6WOUPDYcQ==}
138
+ dependencies:
139
+ '@babel/runtime': 7.22.5
140
+ dev: true
141
+
142
+ /idb-keyval@6.2.1:
143
+ resolution: {integrity: sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==}
144
+ dev: false
145
+
146
+ /isomorphic-unfetch@3.1.0:
147
+ resolution: {integrity: sha512-geDJjpoZ8N0kWexiwkX8F9NkTsXhetLPVbZFQ+JTW239QNOwvB0gniuR1Wc6f0AMTn7/mFGyXvHTifrCp/GH8Q==}
148
+ dependencies:
149
+ node-fetch: 2.6.11
150
+ unfetch: 4.2.0
151
+ transitivePeerDependencies:
152
+ - encoding
153
+ dev: true
154
+
155
+ /iterall@1.3.0:
156
+ resolution: {integrity: sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==}
157
+ dev: true
158
+
159
+ /lodash@4.17.21:
160
+ resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==}
161
+ dev: true
162
+
163
+ /mobx-state-tree@5.1.8(mobx@6.9.0):
164
+ resolution: {integrity: sha512-oe82BNgMr408e6DxMDNat8msXQTuyuqzJ97DPupbhchEfjjHyjsmPSwtXHl+nXiW3tybpb/cr5siUClBqKqv+Q==}
165
+ peerDependencies:
166
+ mobx: ^6.3.0
167
+ dependencies:
168
+ mobx: 6.9.0
169
+ dev: false
170
+
171
+ /mobx@6.9.0:
172
+ resolution: {integrity: sha512-HdKewQEREEJgsWnErClfbFoVebze6rGazxFLU/XUyrII8dORfVszN1V0BMRnQSzcgsNNtkX8DHj3nC6cdWE9YQ==}
173
+ dev: false
174
+
175
+ /node-fetch@2.6.11:
176
+ resolution: {integrity: sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==}
177
+ engines: {node: 4.x || >=6.0.0}
178
+ peerDependencies:
179
+ encoding: ^0.1.0
180
+ peerDependenciesMeta:
181
+ encoding:
182
+ optional: true
183
+ dependencies:
184
+ whatwg-url: 5.0.0
185
+ dev: true
186
+
187
+ /regenerator-runtime@0.13.11:
188
+ resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==}
189
+ dev: true
190
+
191
+ /stackframe@1.3.4:
192
+ resolution: {integrity: sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==}
193
+ dev: true
194
+
195
+ /subscriptions-transport-ws@0.9.19(graphql@16.6.0):
196
+ resolution: {integrity: sha512-dxdemxFFB0ppCLg10FTtRqH/31FNRL1y1BQv8209MK5I4CwALb7iihQg+7p65lFcIl8MHatINWBLOqpgU4Kyyw==}
197
+ deprecated: The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md
198
+ peerDependencies:
199
+ graphql: '>=0.10.0'
200
+ dependencies:
201
+ backo2: 1.0.2
202
+ eventemitter3: 3.1.2
203
+ graphql: 16.6.0
204
+ iterall: 1.3.0
205
+ symbol-observable: 1.2.0
206
+ ws: 6.2.2
207
+ transitivePeerDependencies:
208
+ - bufferutil
209
+ - utf-8-validate
210
+ dev: true
211
+
212
+ /symbol-observable@1.2.0:
213
+ resolution: {integrity: sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==}
214
+ engines: {node: '>=0.10.0'}
215
+ dev: true
216
+
217
+ /tr46@0.0.3:
218
+ resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}
219
+ dev: true
220
+
221
+ /tslib@1.14.1:
222
+ resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==}
223
+ dev: true
224
+
225
+ /tslib@2.5.3:
226
+ resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==}
227
+ dev: true
228
+
229
+ /typescript@5.1.3:
230
+ resolution: {integrity: sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==}
231
+ engines: {node: '>=14.17'}
232
+ hasBin: true
233
+ dev: true
234
+
235
+ /unfetch@4.2.0:
236
+ resolution: {integrity: sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==}
237
+ dev: true
238
+
239
+ /utility-types@3.10.0:
240
+ resolution: {integrity: sha512-O11mqxmi7wMKCo6HKFt5AhO4BwY3VV68YU07tgxfz8zJTIxr4BpsezN49Ffwy9j3ZpwwJp4fkRwjRzq3uWE6Rg==}
241
+ engines: {node: '>= 4'}
242
+ dev: true
243
+
244
+ /webidl-conversions@3.0.1:
245
+ resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}
246
+ dev: true
247
+
248
+ /whatwg-url@5.0.0:
249
+ resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}
250
+ dependencies:
251
+ tr46: 0.0.3
252
+ webidl-conversions: 3.0.1
253
+ dev: true
254
+
255
+ /ws@6.2.2:
256
+ resolution: {integrity: sha512-zmhltoSR8u1cnDsD43TX59mzoMZsLKqUweyYBAIvTngR3shc0W6aOZylZmq/7hqyVxPdi+5Ud2QInblgyE72fw==}
257
+ peerDependencies:
258
+ bufferutil: ^4.0.1
259
+ utf-8-validate: ^5.0.2
260
+ peerDependenciesMeta:
261
+ bufferutil:
262
+ optional: true
263
+ utf-8-validate:
264
+ optional: true
265
+ dependencies:
266
+ async-limiter: 1.0.1
267
+ dev: true
268
+
269
+ /zen-observable-ts@0.8.21:
270
+ resolution: {integrity: sha512-Yj3yXweRc8LdRMrCC8nIc4kkjWecPAUVh0TI0OUrWXx6aX790vLcDlWca6I4vsyCGH3LpWxq0dJRcMOFoVqmeg==}
271
+ dependencies:
272
+ tslib: 1.14.1
273
+ zen-observable: 0.8.15
274
+ dev: true
275
+
276
+ /zen-observable@0.8.15:
277
+ resolution: {integrity: sha512-PQ2PC7R9rslx84ndNBZB/Dkv8V8fZEpk83RLgXtYd0fwUgEjseMn1Dgajh2x6S8QbZAFa9p2qVCEuYZNgve0dQ==}
278
+ dev: true
@@ -14,6 +14,12 @@ const OpenReplayObject = {
14
14
 
15
15
  export type IGlobalOpenReplay = Required<typeof OpenReplayObject>
16
16
 
17
+ export function getOpenReplayObject() {
18
+ if (window.__ASMA__SHELL__?.openreplay_object) {
19
+ return window.__ASMA__SHELL__.openreplay_object
20
+ }
21
+ return OpenReplayObject
22
+ }
17
23
  export function getOpenReplayTrackerObject<Keys extends keyof IGlobalOpenReplay>(name: Keys) {
18
24
  if (window.__ASMA__SHELL__?.openreplay_object) {
19
25
  return window.__ASMA__SHELL__.openreplay_object[name]
@@ -0,0 +1,101 @@
1
+ export function sha256(ascii: string): string {
2
+ function rightRotate(value: number, amount: number) {
3
+ return (value >>> amount) | (value << (32 - amount))
4
+ }
5
+
6
+ const mathPow = Math.pow
7
+ const maxWord = mathPow(2, 32)
8
+ const lengthProperty = 'length'
9
+ let i, j // Used as a counter across the whole file
10
+ let result = ''
11
+
12
+ const words: number[] = []
13
+ const asciiBitLength = ascii[lengthProperty] * 8
14
+
15
+ //* caching results is optional - remove/add slash from front of this line to toggle
16
+ // Initial hash value: first 32 bits of the fractional parts of the square roots of the first 8 primes
17
+ // (we actually calculate the first 64, but extra values are just ignored)
18
+ let hash: number[] = [] //(sha256.h = sha256.h || [])
19
+ // Round constants: first 32 bits of the fractional parts of the cube roots of the first 64 primes
20
+ const k: number[] = [] //(sha256.k = sha256.k || [])
21
+ let primeCounter = k[lengthProperty]
22
+ /*/
23
+ var hash = [], k = [];
24
+ var primeCounter = 0;
25
+ //*/
26
+
27
+ const isComposite = []
28
+ for (let candidate = 2; primeCounter < 64; candidate++) {
29
+ if (!isComposite[candidate]) {
30
+ for (i = 0; i < 313; i += candidate) {
31
+ isComposite[i] = candidate
32
+ }
33
+ hash[primeCounter] = (mathPow(candidate, 0.5) * maxWord) | 0
34
+ k[primeCounter++] = (mathPow(candidate, 1 / 3) * maxWord) | 0
35
+ }
36
+ }
37
+
38
+ ascii += '\x80' // Append Ƈ' bit (plus zero padding)
39
+ while ((ascii[lengthProperty] % 64) - 56) ascii += '\x00' // More zero padding
40
+ for (i = 0; i < ascii[lengthProperty]; i++) {
41
+ j = ascii.charCodeAt(i)
42
+ if (j >> 8) return '' // ASCII check: only accept characters in range 0-255
43
+ words[i >> 2] |= j << (((3 - i) % 4) * 8)
44
+ }
45
+ words[words[lengthProperty]] = (asciiBitLength / maxWord) | 0
46
+ words[words[lengthProperty]] = asciiBitLength
47
+
48
+ // process each chunk
49
+ for (j = 0; j < words[lengthProperty]; ) {
50
+ const w = words.slice(j, (j += 16)) // The message is expanded into 64 words as part of the iteration
51
+ const oldHash = hash
52
+ // This is now the undefinedworking hash", often labelled as variables a...g
53
+ // (we have to truncate as well, otherwise extra entries at the end accumulate
54
+ hash = hash.slice(0, 8)
55
+
56
+ for (i = 0; i < 64; i++) {
57
+ //const i2 = i + j
58
+ // Expand the message into 64 words
59
+ // Used below if
60
+ const w15 = w[i - 15] || 0,
61
+ w2 = w[i - 2] || 0
62
+
63
+ // Iterate
64
+ const a = hash[0] || 0,
65
+ e = hash[4] || 0
66
+ const temp1 =
67
+ (hash[7] || 0) +
68
+ (rightRotate(e, 6) ^ rightRotate(e, 11) ^ rightRotate(e, 25)) + // S1
69
+ ((e & (hash[5] || 0)) ^ (~e & (hash[6] || 0))) + // ch
70
+ (k[i] || 0) +
71
+ // Expand the message schedule if needed
72
+ (w[i] =
73
+ i < 16
74
+ ? w[i] || 0
75
+ : ((w[i - 16] || 0) +
76
+ (rightRotate(w15, 7) ^ rightRotate(w15, 18) ^ (w15 >>> 3)) + // s0
77
+ (w[i - 7] || 0) +
78
+ (rightRotate(w2, 17) ^ rightRotate(w2, 19) ^ (w2 >>> 10))) | // s1
79
+ 0)
80
+ // This is only used once, so *could* be moved below, but it only saves 4 bytes and makes things unreadble
81
+ const temp2 =
82
+ (rightRotate(a, 2) ^ rightRotate(a, 13) ^ rightRotate(a, 22)) + // S0
83
+ ((a & (hash[1] || 0)) ^ (a & (hash[2] || 0)) ^ ((hash[1] || 0) & (hash[2] || 0))) // maj
84
+
85
+ hash = [(temp1 + temp2) | 0].concat(hash) // We don't bother trimming off the extra ones, they're harmless as long as we're truncating when we do the slice()
86
+ hash[4] = ((hash[4] || 0) + temp1) | 0
87
+ }
88
+
89
+ for (i = 0; i < 8; i++) {
90
+ hash[i] = ((hash[i] || 0) + (oldHash[i] || 0)) | 0
91
+ }
92
+ }
93
+
94
+ for (i = 0; i < 8; i++) {
95
+ for (j = 3; j + 1; j--) {
96
+ const b = ((hash[i] || 0) >> (j * 8)) & 255
97
+ result += (b < 16 ? 0 : '') + b.toString(16)
98
+ }
99
+ }
100
+ return result
101
+ }
package/src/index.ts CHANGED
@@ -25,6 +25,7 @@ export * from './helpers/initASMAAppVitals'
25
25
  export * from './helpers/registerOpenReplay'
26
26
  export * from './helpers/urlParams.helpers'
27
27
  export * from './helpers/openReplayConfigs'
28
+ export * from './helpers/sha256'
28
29
 
29
30
  export * from './utility/fetch'
30
31