@adtrackify/at-service-common 3.5.25 → 3.5.27
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/cjs/clients/internal-api/destinations-client.d.ts +1 -1
- package/dist/cjs/clients/internal-api/destinations-client.js +2 -2
- package/dist/cjs/clients/internal-api/destinations-client.js.map +1 -1
- package/dist/cjs/clients/third-party/index.d.ts +1 -0
- package/dist/cjs/clients/third-party/index.js +1 -0
- package/dist/cjs/clients/third-party/index.js.map +1 -1
- package/dist/cjs/clients/third-party/loops-client.d.ts +10 -0
- package/dist/cjs/clients/third-party/loops-client.js +31 -0
- package/dist/cjs/clients/third-party/loops-client.js.map +1 -0
- package/dist/esm/clients/internal-api/destinations-client.d.ts +1 -1
- package/dist/esm/clients/internal-api/destinations-client.js +2 -2
- package/dist/esm/clients/internal-api/destinations-client.js.map +1 -1
- package/dist/esm/clients/third-party/index.d.ts +1 -0
- package/dist/esm/clients/third-party/index.js +1 -0
- package/dist/esm/clients/third-party/index.js.map +1 -1
- package/dist/esm/clients/third-party/loops-client.d.ts +10 -0
- package/dist/esm/clients/third-party/loops-client.js +27 -0
- package/dist/esm/clients/third-party/loops-client.js.map +1 -0
- package/package.json +3 -2
|
@@ -21,7 +21,7 @@ export declare class DestinationsClient {
|
|
|
21
21
|
'x-api-key'?: undefined;
|
|
22
22
|
};
|
|
23
23
|
createDestination: (createDestinationRequest: any) => Promise<ApiResponse<CreateDestinationResponseData>>;
|
|
24
|
-
updateDestination: (destinationId: string, body: any
|
|
24
|
+
updateDestination: (destinationId: string, body: any) => Promise<ApiResponse<CreateDestinationResponseData>>;
|
|
25
25
|
getPixelDestinations: (pixelId: string) => Promise<ApiResponse<GetDestinationsResponseData>>;
|
|
26
26
|
getAllDestinationByDestinationType: (destinationType: DESTINATION_TYPE, start: string) => Promise<ApiResponse<GetDestinationsResponseData>>;
|
|
27
27
|
}
|
|
@@ -32,8 +32,8 @@ class DestinationsClient {
|
|
|
32
32
|
index_js_1.Logger.debug('createDestinationResponse', { response });
|
|
33
33
|
return response;
|
|
34
34
|
};
|
|
35
|
-
updateDestination = async (destinationId, body
|
|
36
|
-
const response = await client.patch(`${this.SERVICE_API_ROOT_URL}/${destinationId}/private
|
|
35
|
+
updateDestination = async (destinationId, body) => {
|
|
36
|
+
const response = await client.patch(`${this.SERVICE_API_ROOT_URL}/${destinationId}/private`, body, { headers: this.getHeaders() });
|
|
37
37
|
index_js_1.Logger.debug('updateDestinationResponse', { response });
|
|
38
38
|
return response;
|
|
39
39
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destinations-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/destinations-client.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAExC,8DAAgF;AAYhF,MAAM,MAAM,GAAG,IAAA,iCAAgB,EAAC;IAE9B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAEH,MAAa,kBAAkB;IACtB,YAAY,CAAS;IACrB,oBAAoB,CAAS;IAC7B,MAAM,CAAoB;IAC1B,oBAAoB,CAAS;IAEpC,YAAY,UAAkB,EAAE,kBAA0B;QACxD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC/B,IAAI,CAAC,oBAAoB,GAAG,kBAAkB,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,GAAG,IAAI,CAAC,YAAY,eAAe,CAAC;QAChE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,UAAU,GAAG,GAAG,EAAE;QAChB,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC7B,OAAO;gBACL,WAAW,EAAE,IAAI,CAAC,oBAAoB;aACvC,CAAC;SACH;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;IAGF,iBAAiB,GAAG,KAAK,EAAE,wBAA6B,EAAuD,EAAE;QAC/G,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,QAAQ,EAAE,wBAAwB,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACnI,iBAAM,CAAC,KAAK,CAAC,2BAA2B,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxD,OAAO,QAAsD,CAAC;IAChE,CAAC,CAAC;IAEF,iBAAiB,GAAG,KAAK,EAAE,aAAqB,EAAE,IAAS,
|
|
1
|
+
{"version":3,"file":"destinations-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/destinations-client.ts"],"names":[],"mappings":";;;AAAA,6CAAwC;AAExC,8DAAgF;AAYhF,MAAM,MAAM,GAAG,IAAA,iCAAgB,EAAC;IAE9B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAEH,MAAa,kBAAkB;IACtB,YAAY,CAAS;IACrB,oBAAoB,CAAS;IAC7B,MAAM,CAAoB;IAC1B,oBAAoB,CAAS;IAEpC,YAAY,UAAkB,EAAE,kBAA0B;QACxD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC/B,IAAI,CAAC,oBAAoB,GAAG,kBAAkB,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,GAAG,IAAI,CAAC,YAAY,eAAe,CAAC;QAChE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,UAAU,GAAG,GAAG,EAAE;QAChB,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC7B,OAAO;gBACL,WAAW,EAAE,IAAI,CAAC,oBAAoB;aACvC,CAAC;SACH;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;IAGF,iBAAiB,GAAG,KAAK,EAAE,wBAA6B,EAAuD,EAAE;QAC/G,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,QAAQ,EAAE,wBAAwB,EAAE,EAA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C9D,CAAC,CAAA;CACF;AA9CD,gDA8CC"}
|
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./shopify-client.js"), exports);
|
|
18
18
|
__exportStar(require("./emailable-client.js"), exports);
|
|
19
|
+
__exportStar(require("./loops-client.js"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/clients/third-party/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,wDAAsC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/clients/third-party/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,wDAAsC;AACtC,oDAAkC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LoopsClient as LoopsSdkClient } from 'loops';
|
|
2
|
+
export type { TransactionalSuccess, TransactionalVariables, TransactionalAttachment, EventSuccessResponse, EventProperties, ContactProperties, } from 'loops';
|
|
3
|
+
type SendTransactionalEmailParams = Parameters<LoopsSdkClient['sendTransactionalEmail']>[0];
|
|
4
|
+
type SendEventParams = Parameters<LoopsSdkClient['sendEvent']>[0];
|
|
5
|
+
export declare class LoopsClient {
|
|
6
|
+
private client;
|
|
7
|
+
constructor(apiKey: string);
|
|
8
|
+
sendTransactionalEmail: (params: SendTransactionalEmailParams) => Promise<import("loops").TransactionalSuccess>;
|
|
9
|
+
sendEvent: (params: SendEventParams) => Promise<import("loops").EventSuccessResponse>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoopsClient = void 0;
|
|
4
|
+
const loops_1 = require("loops");
|
|
5
|
+
const logging_helper_js_1 = require("../../helpers/logging-helper.js");
|
|
6
|
+
class LoopsClient {
|
|
7
|
+
client;
|
|
8
|
+
constructor(apiKey) {
|
|
9
|
+
this.client = new loops_1.LoopsClient(apiKey);
|
|
10
|
+
}
|
|
11
|
+
sendTransactionalEmail = async (params) => {
|
|
12
|
+
try {
|
|
13
|
+
return await this.client.sendTransactionalEmail(params);
|
|
14
|
+
}
|
|
15
|
+
catch (error) {
|
|
16
|
+
logging_helper_js_1.Logger.error('Failed to send Loops transactional email', { error, params });
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
sendEvent = async (params) => {
|
|
21
|
+
try {
|
|
22
|
+
return await this.client.sendEvent(params);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
logging_helper_js_1.Logger.error('Failed to send Loops event', { error, params });
|
|
26
|
+
throw error;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
exports.LoopsClient = LoopsClient;
|
|
31
|
+
//# sourceMappingURL=loops-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loops-client.js","sourceRoot":"","sources":["../../../../src/clients/third-party/loops-client.ts"],"names":[],"mappings":";;;AAAA,iCAAsD;AACtD,uEAAyD;AAkBzD,MAAa,WAAW;IACd,MAAM,CAAiB;IAE/B,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,mBAAc,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAEM,sBAAsB,GAAG,KAAK,EAAE,MAAoC,EAAE,EAAE;QAC7E,IAAI;YACF,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;SACzD;QAAC,OAAO,KAAK,EAAE;YACd,0BAAM,CAAC,KAAK,CAAC,0CAA0C,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YAC5E,MAAM,KAAK,CAAC;SACb;IACH,CAAC,CAAC;IAEK,SAAS,GAAG,KAAK,EAAE,MAAuB,EAAE,EAAE;QACnD,IAAI;YACF,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;SAC5C;QAAC,OAAO,KAAK,EAAE;YACd,0BAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YAC9D,MAAM,KAAK,CAAC;SACb;IACH,CAAC,CAAC;CACH;AAxBD,kCAwBC"}
|
|
@@ -21,7 +21,7 @@ export declare class DestinationsClient {
|
|
|
21
21
|
'x-api-key'?: undefined;
|
|
22
22
|
};
|
|
23
23
|
createDestination: (createDestinationRequest: any) => Promise<ApiResponse<CreateDestinationResponseData>>;
|
|
24
|
-
updateDestination: (destinationId: string, body: any
|
|
24
|
+
updateDestination: (destinationId: string, body: any) => Promise<ApiResponse<CreateDestinationResponseData>>;
|
|
25
25
|
getPixelDestinations: (pixelId: string) => Promise<ApiResponse<GetDestinationsResponseData>>;
|
|
26
26
|
getAllDestinationByDestinationType: (destinationType: DESTINATION_TYPE, start: string) => Promise<ApiResponse<GetDestinationsResponseData>>;
|
|
27
27
|
}
|
|
@@ -29,8 +29,8 @@ export class DestinationsClient {
|
|
|
29
29
|
Logger.debug('createDestinationResponse', { response });
|
|
30
30
|
return response;
|
|
31
31
|
};
|
|
32
|
-
updateDestination = async (destinationId, body
|
|
33
|
-
const response = await client.patch(`${this.SERVICE_API_ROOT_URL}/${destinationId}/private
|
|
32
|
+
updateDestination = async (destinationId, body) => {
|
|
33
|
+
const response = await client.patch(`${this.SERVICE_API_ROOT_URL}/${destinationId}/private`, body, { headers: this.getHeaders() });
|
|
34
34
|
Logger.debug('updateDestinationResponse', { response });
|
|
35
35
|
return response;
|
|
36
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"destinations-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/destinations-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,OAAO,EAAE,gBAAgB,EAAqB,MAAM,2BAA2B,CAAC;AAYhF,MAAM,MAAM,GAAG,gBAAgB,CAAC;IAE9B,OAAO,EAAE;QACP,cAAc,EAAE,kBAAkB;KACnC;CACF,CAAC,CAAC;AAEH,MAAM,OAAO,kBAAkB;IACtB,YAAY,CAAS;IACrB,oBAAoB,CAAS;IAC7B,MAAM,CAAoB;IAC1B,oBAAoB,CAAS;IAEpC,YAAY,UAAkB,EAAE,kBAA0B;QACxD,IAAI,CAAC,YAAY,GAAG,UAAU,CAAC;QAC/B,IAAI,CAAC,oBAAoB,GAAG,kBAAkB,CAAC;QAC/C,IAAI,CAAC,oBAAoB,GAAG,GAAG,IAAI,CAAC,YAAY,eAAe,CAAC;QAChE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,UAAU,GAAG,GAAG,EAAE;QAChB,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC7B,OAAO;gBACL,WAAW,EAAE,IAAI,CAAC,oBAAoB;aACvC,CAAC;SACH;QACD,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;IAGF,iBAAiB,GAAG,KAAK,EAAE,wBAA6B,EAAuD,EAAE;QAC/G,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,oBAAoB,QAAQ,EAAE,wBAAwB,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACnI,MAAM,CAAC,KAAK,CAAC,2BAA2B,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxD,OAAO,QAAsD,CAAC;IAChE,CAAC,CAAC;IAEF,iBAAiB,GAAG,KAAK,EAAE,aAAqB,EAAE,IAAS,
|
|
1
|
+
{"version":3,"file":"destinations-client.js","sourceRoot":"","sources":["../../../../src/clients/internal-api/destinations-client.ts"],"names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CAAC,oBAAoB,IAAI,aAAa,UAAU,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACnI,MAAM,CAAC,KAAK,CAAC,2BAA2B,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxD,OAAO,QAAsD,CAAC;IAChE,CAAC,CAAA;IAED,oBAAoB,GAAG,KAAK,EAAE,OAAe,EAAqD,EAAE;QAClG,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,oBAAoB,YAAY,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACrH,MAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC/C,OAAO,QAAoD,CAAC;IAC9D,CAAC,CAAC;IAEF,kCAAkC,GAAG,KAAK,EAAE,eAAiC,EAAE,KAAa,EAAqD,EAAE;QACjJ,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,oBAAoB,yBAAyB,eAAe,UAAU,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QACzJ,MAAM,CAAC,KAAK,CAAC,oCAAoC,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC;QACjE,OAAO,QAAoD,CAAC;IAC9D,CAAC,CAAA;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/clients/third-party/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/clients/third-party/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LoopsClient as LoopsSdkClient } from 'loops';
|
|
2
|
+
export type { TransactionalSuccess, TransactionalVariables, TransactionalAttachment, EventSuccessResponse, EventProperties, ContactProperties, } from 'loops';
|
|
3
|
+
type SendTransactionalEmailParams = Parameters<LoopsSdkClient['sendTransactionalEmail']>[0];
|
|
4
|
+
type SendEventParams = Parameters<LoopsSdkClient['sendEvent']>[0];
|
|
5
|
+
export declare class LoopsClient {
|
|
6
|
+
private client;
|
|
7
|
+
constructor(apiKey: string);
|
|
8
|
+
sendTransactionalEmail: (params: SendTransactionalEmailParams) => Promise<import("loops").TransactionalSuccess>;
|
|
9
|
+
sendEvent: (params: SendEventParams) => Promise<import("loops").EventSuccessResponse>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { LoopsClient as LoopsSdkClient } from 'loops';
|
|
2
|
+
import { Logger } from '../../helpers/logging-helper.js';
|
|
3
|
+
export class LoopsClient {
|
|
4
|
+
client;
|
|
5
|
+
constructor(apiKey) {
|
|
6
|
+
this.client = new LoopsSdkClient(apiKey);
|
|
7
|
+
}
|
|
8
|
+
sendTransactionalEmail = async (params) => {
|
|
9
|
+
try {
|
|
10
|
+
return await this.client.sendTransactionalEmail(params);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
Logger.error('Failed to send Loops transactional email', { error, params });
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
sendEvent = async (params) => {
|
|
18
|
+
try {
|
|
19
|
+
return await this.client.sendEvent(params);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
Logger.error('Failed to send Loops event', { error, params });
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=loops-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loops-client.js","sourceRoot":"","sources":["../../../../src/clients/third-party/loops-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,cAAc,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAkBzD,MAAM,OAAO,WAAW;IACd,MAAM,CAAiB;IAE/B,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAEM,sBAAsB,GAAG,KAAK,EAAE,MAAoC,EAAE,EAAE;QAC7E,IAAI;YACF,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,MAAM,CAAC,CAAC;SACzD;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,CAAC,0CAA0C,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YAC5E,MAAM,KAAK,CAAC;SACb;IACH,CAAC,CAAC;IAEK,SAAS,GAAG,KAAK,EAAE,MAAuB,EAAE,EAAE;QACnD,IAAI;YACF,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;SAC5C;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YAC9D,MAAM,KAAK,CAAC;SACb;IACH,CAAC,CAAC;CACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adtrackify/at-service-common",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.27",
|
|
4
4
|
"description": "",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/*"
|
|
@@ -44,6 +44,7 @@
|
|
|
44
44
|
"big.js": "^7.0.1",
|
|
45
45
|
"ioredis": "^5.4.1",
|
|
46
46
|
"libphonenumber-js": "^1.12.15",
|
|
47
|
+
"loops": "^6.0.1",
|
|
47
48
|
"pako": "^2.1.0",
|
|
48
49
|
"papaparse": "^5.5.3",
|
|
49
50
|
"psl": "^1.15.0",
|
|
@@ -128,4 +129,4 @@
|
|
|
128
129
|
"author": "",
|
|
129
130
|
"license": "ISC",
|
|
130
131
|
"homepage": "https://bitbucket.org/eacap/at-service-common#readme"
|
|
131
|
-
}
|
|
132
|
+
}
|