@clipboard-health/notifications 0.1.0 → 0.1.1

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/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@clipboard-health/notifications",
3
3
  "description": "Send notifications through third-party providers.",
4
- "version": "0.1.0",
4
+ "version": "0.1.1",
5
5
  "bugs": "https://github.com/ClipboardHealth/core-utils/issues",
6
6
  "dependencies": {
7
- "@clipboard-health/phone-number": "0.2.0",
8
- "@clipboard-health/util-ts": "3.12.0",
7
+ "@clipboard-health/phone-number": "0.2.1",
8
+ "@clipboard-health/util-ts": "3.12.1",
9
9
  "@knocklabs/node": "1.16.0",
10
10
  "tslib": "2.8.1"
11
11
  },
12
12
  "devDependencies": {
13
- "@clipboard-health/testing-core": "0.21.0"
13
+ "@clipboard-health/testing-core": "0.21.1"
14
14
  },
15
15
  "keywords": [],
16
16
  "license": "MIT",
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.chunkRecipients = chunkRecipients;
4
- const chunk_1 = require("./chunk");
4
+ const util_ts_1 = require("@clipboard-health/util-ts");
5
5
  const notificationClient_1 = require("./notificationClient");
6
6
  function chunkRecipients(params) {
7
7
  const { recipientIds, idempotencyKey } = params;
8
8
  if (recipientIds.length === 0) {
9
9
  return [{ idempotencyKey, recipientIds: [] }];
10
10
  }
11
- const idChunks = (0, chunk_1.chunk)(recipientIds, notificationClient_1.MAXIMUM_RECIPIENTS_COUNT);
11
+ const idChunks = (0, util_ts_1.chunk)(recipientIds, notificationClient_1.MAXIMUM_RECIPIENTS_COUNT);
12
12
  const singleChunk = idChunks.length === 1;
13
13
  return idChunks.map((ids, index) => ({
14
14
  idempotencyKey: singleChunk ? idempotencyKey : `${idempotencyKey}-chunk-${index + 1}`,
@@ -1 +1 @@
1
- {"version":3,"file":"chunkRecipients.js","sourceRoot":"","sources":["../../../../../packages/notifications/src/lib/chunkRecipients.ts"],"names":[],"mappings":";;AAGA,0CAgBC;AAnBD,mCAAgC;AAChC,6DAAgE;AAEhE,SAAgB,eAAe,CAAC,MAG/B;IACC,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IAEhD,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,QAAQ,GAAG,IAAA,aAAK,EAAC,YAAY,EAAE,6CAAwB,CAAC,CAAC;IAC/D,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC;IAC1C,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACnC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,UAAU,KAAK,GAAG,CAAC,EAAE;QACrF,YAAY,EAAE,GAAG;KAClB,CAAC,CAAC,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"chunkRecipients.js","sourceRoot":"","sources":["../../../../../packages/notifications/src/lib/chunkRecipients.ts"],"names":[],"mappings":";;AAIA,0CAgBC;AApBD,uDAAkD;AAElD,6DAAgE;AAEhE,SAAgB,eAAe,CAAC,MAG/B;IACC,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC;IAEhD,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC9B,OAAO,CAAC,EAAE,cAAc,EAAE,YAAY,EAAE,EAAE,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,MAAM,QAAQ,GAAG,IAAA,eAAK,EAAC,YAAY,EAAE,6CAAwB,CAAC,CAAC;IAC/D,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC;IAC1C,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;QACnC,cAAc,EAAE,WAAW,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,cAAc,UAAU,KAAK,GAAG,CAAC,EAAE;QACrF,YAAY,EAAE,GAAG;KAClB,CAAC,CAAC,CAAC;AACN,CAAC"}
@@ -1,9 +0,0 @@
1
- /**
2
- * Creates an `array` of elements split into groups the length of `size`. If `array` can't be split
3
- * evenly, the final chunk will be the remaining elements.
4
- *
5
- * @param array - The array to chunk.
6
- * @param size - The length of each chunk.
7
- * @returns the new 2D array of chunks.
8
- */
9
- export declare function chunk<T>(array: T[], size: number): T[][];
package/src/lib/chunk.js DELETED
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.chunk = chunk;
4
- /**
5
- * Creates an `array` of elements split into groups the length of `size`. If `array` can't be split
6
- * evenly, the final chunk will be the remaining elements.
7
- *
8
- * @param array - The array to chunk.
9
- * @param size - The length of each chunk.
10
- * @returns the new 2D array of chunks.
11
- */
12
- function chunk(array, size) {
13
- if (!Number.isInteger(size) || size <= 0) {
14
- throw new RangeError("size must be a positive integer");
15
- }
16
- if (array.length === 0) {
17
- return [];
18
- }
19
- return Array.from({ length: Math.ceil(array.length / size) }, (_, index) => array.slice(index * size, (index + 1) * size));
20
- }
21
- //# sourceMappingURL=chunk.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunk.js","sourceRoot":"","sources":["../../../../../packages/notifications/src/lib/chunk.ts"],"names":[],"mappings":";;AAQA,sBAYC;AApBD;;;;;;;GAOG;AACH,SAAgB,KAAK,CAAI,KAAU,EAAE,IAAY;IAC/C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,UAAU,CAAC,iCAAiC,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CACzE,KAAK,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAC9C,CAAC;AACJ,CAAC"}