@adtrackify/at-service-common 1.0.26 → 1.0.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/index.d.ts CHANGED
@@ -77,10 +77,16 @@ declare module '@adtrackify/at-service-common/clients/index' {
77
77
  }
78
78
  declare module '@adtrackify/at-service-common/clients/internal-api/accounts-client' {
79
79
  import { ApiResponse } from '@adtrackify/at-service-common/types/api-response';
80
+ import { Destination } from '@adtrackify/at-service-common/types/db/destination';
80
81
  export interface IsAuthorizedUserResponseData {
81
82
  isAccountUser: boolean;
82
83
  [key: string]: any;
83
84
  }
85
+ export interface PixelConfigResponseData {
86
+ id: string;
87
+ destinations: Destination[];
88
+ [key: string]: any;
89
+ }
84
90
  export class AccountsClient {
85
91
  BASE_API_URL: string;
86
92
  ACCOUNTS_API_KEY: string;
@@ -123,6 +129,7 @@ declare module '@adtrackify/at-service-common/clients/internal-api/accounts-clie
123
129
  setBaseUrl: (url: string) => boolean;
124
130
  }>;
125
131
  isAuthorizedUser: (userId: string, accountId: string, pixelId: string) => Promise<ApiResponse<IsAuthorizedUserResponseData>>;
132
+ getPixelConfigById: (pixelId: string) => Promise<ApiResponse<PixelConfigResponseData>>;
126
133
  }
127
134
 
128
135
  }
@@ -187,6 +194,83 @@ declare module '@adtrackify/at-service-common/clients/internal-api/index' {
187
194
  export * from '@adtrackify/at-service-common/clients/internal-api/destinations-client';
188
195
  export * from '@adtrackify/at-service-common/clients/internal-api/accounts-client';
189
196
 
197
+ }
198
+ declare module '@adtrackify/at-service-common/clients/third-party/shopify-client' {
199
+ export class ShopifyClient {
200
+ getConfig: (shopifyDomain: string, accessToken: string) => {
201
+ baseURL: string;
202
+ headers: {
203
+ common: {
204
+ 'X-Shopify-Access-Token': string;
205
+ };
206
+ };
207
+ };
208
+ getClient: (shopifyDomain: string, accessToken: string) => {
209
+ instance: () => import("axios").AxiosInstance;
210
+ get: (url: string, config?: any) => Promise<{
211
+ headers: any;
212
+ data: any;
213
+ status: any;
214
+ }>;
215
+ post: (url: string, data?: any, config?: any) => Promise<{
216
+ headers: any;
217
+ data: any;
218
+ status: any;
219
+ }>;
220
+ delete: (url: string, config?: any) => Promise<{
221
+ headers: any;
222
+ data: any;
223
+ status: any;
224
+ }>;
225
+ put: (url: string, data?: any, config?: any) => Promise<{
226
+ headers: any;
227
+ data: any;
228
+ status: any;
229
+ }>;
230
+ patch: (url: string, data?: any, config?: any) => Promise<{
231
+ headers: any;
232
+ data: any;
233
+ status: any;
234
+ }>;
235
+ setBaseUrl: (url: string) => boolean;
236
+ };
237
+ registerApp: (shop: string, code: string, appKey: string, appSecret: string) => Promise<{
238
+ headers: any;
239
+ data: any;
240
+ status: any;
241
+ }>;
242
+ registerWebhookTopic: (shop: string, accessToken: string, eventBridgeArn: string, topic: string) => Promise<{
243
+ headers: any;
244
+ data: any;
245
+ status: any;
246
+ }>;
247
+ updateShopifyAppMetafield: (shop: string, accessToken: string, pixelId: string) => Promise<{
248
+ headers: any;
249
+ data: any;
250
+ status: any;
251
+ }>;
252
+ getShopifyStoreProperties: (shop: string, accessToken: string) => Promise<{
253
+ headers: any;
254
+ data: any;
255
+ status: any;
256
+ }>;
257
+ genericShopifyPost: (url: string, accessToken: string, payload: any) => Promise<{
258
+ headers: any;
259
+ data: any;
260
+ status: any;
261
+ }>;
262
+ genericShopifyGet: (url: string, accessToken: string) => Promise<{
263
+ headers: any;
264
+ data: any;
265
+ status: any;
266
+ }>;
267
+ genericShopifyPut: (url: string, accessToken: string, payload: any) => Promise<{
268
+ headers: any;
269
+ data: any;
270
+ status: any;
271
+ }>;
272
+ }
273
+
190
274
  }
191
275
  declare module '@adtrackify/at-service-common/helpers/index' {
192
276
  export * from '@adtrackify/at-service-common/helpers/input-validation-helper';
package/dist/index.js CHANGED
@@ -628189,6 +628189,12 @@ var AccountsClient = class {
628189
628189
  log3.info("checkUserAuthorization", { response });
628190
628190
  return response;
628191
628191
  };
628192
+ getPixelConfigById = async (pixelId) => {
628193
+ const client2 = await this.getClient();
628194
+ const pixelResponse = await client2.get(`/px/${pixelId}/config`);
628195
+ log3.debug("pixelResponse", { pixelResponse });
628196
+ return pixelResponse;
628197
+ };
628192
628198
  };
628193
628199
 
628194
628200
  // src/libs/http-error.ts
@@ -628294,12 +628300,12 @@ var validateInput = (schema, input) => {
628294
628300
  // src/helpers/logging-helper.ts
628295
628301
  import * as log5 from "lambda-log";
628296
628302
  var stage = process?.env?.STAGE;
628297
- var configureLogger = (event, context, debug = true) => {
628303
+ var configureLogger = (event, context, debug2 = true) => {
628298
628304
  log5.options.meta.stage = stage;
628299
628305
  log5.options.meta.source_name = context?.functionName || "unknown";
628300
628306
  log5.options.meta.awsRequestId = context?.awsRequestId || "unknown";
628301
628307
  log5.options.meta.lambdaEvent = event;
628302
- log5.options.debug = debug;
628308
+ log5.options.debug = debug2;
628303
628309
  };
628304
628310
 
628305
628311
  // src/helpers/response-helper.ts