@adtrackify/at-service-common 1.1.20 → 1.2.0

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.
Files changed (146) hide show
  1. package/dist/__tests__/helpers/subscription-helper.spec.d.ts +1 -0
  2. package/dist/__tests__/helpers/subscription-helper.spec.js +28 -0
  3. package/dist/__tests__/helpers/subscription-helper.spec.js.map +1 -0
  4. package/dist/clients/generic/cognito-client.d.ts +19 -0
  5. package/dist/clients/generic/cognito-client.js +140 -0
  6. package/dist/clients/generic/cognito-client.js.map +1 -0
  7. package/dist/clients/generic/dynamodb-client.d.ts +15 -0
  8. package/dist/clients/generic/dynamodb-client.js +123 -0
  9. package/dist/clients/generic/dynamodb-client.js.map +1 -0
  10. package/dist/clients/generic/eventbridge-client.d.ts +14 -0
  11. package/dist/clients/generic/eventbridge-client.js +46 -0
  12. package/dist/clients/generic/eventbridge-client.js.map +1 -0
  13. package/dist/clients/generic/http-client.d.ts +29 -0
  14. package/dist/clients/generic/http-client.js +30 -0
  15. package/dist/clients/generic/http-client.js.map +1 -0
  16. package/{src/clients/generic/index.ts → dist/clients/generic/index.d.ts} +5 -5
  17. package/dist/clients/generic/index.js +6 -0
  18. package/dist/clients/generic/index.js.map +1 -0
  19. package/dist/clients/generic/s3-client.d.ts +6 -0
  20. package/dist/clients/generic/s3-client.js +25 -0
  21. package/dist/clients/generic/s3-client.js.map +1 -0
  22. package/{src/clients/index.ts → dist/clients/index.d.ts} +3 -3
  23. package/dist/clients/index.js +4 -0
  24. package/dist/clients/index.js.map +1 -0
  25. package/dist/clients/internal-api/accounts-client.d.ts +82 -0
  26. package/dist/clients/internal-api/accounts-client.js +79 -0
  27. package/dist/clients/internal-api/accounts-client.js.map +1 -0
  28. package/dist/clients/internal-api/destinations-client.d.ts +54 -0
  29. package/dist/clients/internal-api/destinations-client.js +37 -0
  30. package/dist/clients/internal-api/destinations-client.js.map +1 -0
  31. package/{src/clients/internal-api/index.ts → dist/clients/internal-api/index.d.ts} +4 -4
  32. package/dist/clients/internal-api/index.js +5 -0
  33. package/dist/clients/internal-api/index.js.map +1 -0
  34. package/dist/clients/internal-api/shopify-app-install-client.d.ts +57 -0
  35. package/dist/clients/internal-api/shopify-app-install-client.js +43 -0
  36. package/dist/clients/internal-api/shopify-app-install-client.js.map +1 -0
  37. package/dist/clients/internal-api/users-auth-client.d.ts +61 -0
  38. package/dist/clients/internal-api/users-auth-client.js +74 -0
  39. package/dist/clients/internal-api/users-auth-client.js.map +1 -0
  40. package/dist/clients/third-party/index.d.ts +1 -0
  41. package/dist/clients/third-party/index.js +2 -0
  42. package/dist/clients/third-party/index.js.map +1 -0
  43. package/dist/clients/third-party/shopify-client.d.ts +90 -0
  44. package/dist/clients/third-party/shopify-client.js +122 -0
  45. package/dist/clients/third-party/shopify-client.js.map +1 -0
  46. package/{src/helpers/index.ts → dist/helpers/index.d.ts} +5 -5
  47. package/dist/helpers/index.js +6 -0
  48. package/dist/helpers/index.js.map +1 -0
  49. package/dist/helpers/input-validation-helper.d.ts +2 -0
  50. package/dist/helpers/input-validation-helper.js +19 -0
  51. package/dist/helpers/input-validation-helper.js.map +1 -0
  52. package/dist/helpers/logging-helper.d.ts +1 -0
  53. package/dist/helpers/logging-helper.js +10 -0
  54. package/dist/helpers/logging-helper.js.map +1 -0
  55. package/dist/helpers/response-helper.d.ts +36 -0
  56. package/dist/helpers/response-helper.js +36 -0
  57. package/dist/helpers/response-helper.js.map +1 -0
  58. package/dist/helpers/shopify-helper.d.ts +9 -0
  59. package/dist/helpers/shopify-helper.js +24 -0
  60. package/dist/helpers/shopify-helper.js.map +1 -0
  61. package/dist/helpers/subscription-helper.d.ts +8 -0
  62. package/dist/helpers/subscription-helper.js +182 -0
  63. package/dist/helpers/subscription-helper.js.map +1 -0
  64. package/dist/index.d.ts +5 -737
  65. package/dist/index.esm.js +6 -2
  66. package/dist/index.esm.js.map +2 -2
  67. package/dist/index.js +6 -1404
  68. package/dist/index.js.map +1 -7
  69. package/dist/libs/crypto.d.ts +1 -0
  70. package/dist/libs/crypto.js +6 -0
  71. package/dist/libs/crypto.js.map +1 -0
  72. package/dist/libs/dates.d.ts +3 -0
  73. package/dist/libs/dates.js +11 -0
  74. package/dist/libs/dates.js.map +1 -0
  75. package/dist/libs/http-error.d.ts +21 -0
  76. package/dist/libs/http-error.js +56 -0
  77. package/dist/libs/http-error.js.map +1 -0
  78. package/dist/libs/http-status-codes.d.ts +58 -0
  79. package/dist/libs/http-status-codes.js +60 -0
  80. package/dist/libs/http-status-codes.js.map +1 -0
  81. package/{src/libs/index.ts → dist/libs/index.d.ts} +6 -7
  82. package/dist/libs/index.js +7 -0
  83. package/dist/libs/index.js.map +1 -0
  84. package/dist/libs/url.d.ts +1 -0
  85. package/dist/libs/url.js +10 -0
  86. package/dist/libs/url.js.map +1 -0
  87. package/dist/services/eventbridge-integration-service.d.ts +9 -0
  88. package/dist/services/eventbridge-integration-service.js +25 -0
  89. package/dist/services/eventbridge-integration-service.js.map +1 -0
  90. package/dist/services/index.d.ts +1 -0
  91. package/dist/services/index.js +2 -0
  92. package/dist/services/index.js.map +1 -0
  93. package/{src/types/api-response.ts → dist/types/api-response.d.ts} +6 -6
  94. package/dist/types/api-response.js +2 -0
  95. package/dist/types/api-response.js.map +1 -0
  96. package/dist/types/index.d.ts +1 -0
  97. package/dist/types/index.js +2 -0
  98. package/dist/types/index.js.map +1 -0
  99. package/dist/types/internal-events/event-detail-types.d.ts +20 -0
  100. package/dist/types/internal-events/event-detail-types.js +25 -0
  101. package/dist/types/internal-events/event-detail-types.js.map +1 -0
  102. package/dist/types/internal-events/index.d.ts +1 -0
  103. package/dist/types/internal-events/index.js +2 -0
  104. package/dist/types/internal-events/index.js.map +1 -0
  105. package/package.json +11 -10
  106. package/.editorconfig +0 -12
  107. package/.eslintignore +0 -3
  108. package/.eslintrc.json +0 -37
  109. package/.husky/pre-push +0 -4
  110. package/.vscode/settings.json +0 -10
  111. package/bitbucket-pipelines.yml +0 -20
  112. package/build.js +0 -39
  113. package/env.yml +0 -9
  114. package/jest.config.ts +0 -41
  115. package/src/__tests__/helpers/subscription-helper.spec.ts +0 -41
  116. package/src/clients/generic/axios.d.ts +0 -8
  117. package/src/clients/generic/cognito-client.ts +0 -154
  118. package/src/clients/generic/dynamodb-client.ts +0 -127
  119. package/src/clients/generic/eventbridge-client.ts +0 -53
  120. package/src/clients/generic/http-client.ts +0 -34
  121. package/src/clients/generic/s3-client.ts +0 -27
  122. package/src/clients/internal-api/accounts-client.ts +0 -126
  123. package/src/clients/internal-api/destinations-client.ts +0 -58
  124. package/src/clients/internal-api/shopify-app-install-client.ts +0 -66
  125. package/src/clients/internal-api/users-auth-client.ts +0 -112
  126. package/src/clients/third-party/index.ts +0 -1
  127. package/src/clients/third-party/shopify-client.ts +0 -139
  128. package/src/helpers/input-validation-helper.ts +0 -22
  129. package/src/helpers/logging-helper.ts +0 -10
  130. package/src/helpers/response-helper.ts +0 -40
  131. package/src/helpers/shopify-helper.ts +0 -39
  132. package/src/helpers/subscription-helper.ts +0 -243
  133. package/src/index.ts +0 -5
  134. package/src/libs/crypto.ts +0 -6
  135. package/src/libs/dates.ts +0 -14
  136. package/src/libs/http-error.ts +0 -90
  137. package/src/libs/http-status-codes.ts +0 -344
  138. package/src/libs/url.ts +0 -10
  139. package/src/services/eventbridge-integration-service.ts +0 -44
  140. package/src/services/index.ts +0 -1
  141. package/src/types/index.ts +0 -1
  142. package/src/types/internal-events/event-detail-types.ts +0 -10
  143. package/src/types/internal-events/index.ts +0 -1
  144. package/tsconfig.json +0 -35
  145. package/tsconfig.tsbuildinfo +0 -1
  146. package/tslint.json +0 -6
package/dist/index.d.ts CHANGED
@@ -1,737 +1,5 @@
1
- declare module '@adtrackify/at-service-common/clients/generic/cognito-client' {
2
- export function dictToAwsAttributes(input: any): {
3
- Name: string;
4
- Value: any;
5
- }[];
6
- export class CognitoClient {
7
- cognitoClient: any;
8
- USER_POOL_ID: string;
9
- USER_POOL_NO_SECRET_CLIENT_ID: string;
10
- constructor(userPoolId: string, userPoolNoSecretClientId: string);
11
- signupUser: (data: any) => Promise<any>;
12
- forgotPassword: (email: string) => Promise<any>;
13
- adminEmailVerify: (email: string) => Promise<void>;
14
- forceValidateEmail: (email: string) => Promise<void>;
15
- adminConfirmUser: (data: any) => Promise<any>;
16
- confirmUser: (data: any) => Promise<any>;
17
- resendCode: (email: string) => Promise<void>;
18
- adminDeleteUser: (userId: string) => Promise<boolean>;
19
- getUserByEmail: (email: string) => Promise<any>;
20
- }
21
-
22
- }
23
- declare module '@adtrackify/at-service-common/clients/generic/dynamodb-client' {
24
- export class DynamoDbClient {
25
- static safeGet: (tableName: string, keyName: string, keyValue: any) => Promise<Record<string, any> | null>;
26
- static safePut: (tableName: string, data: any) => Promise<import("@aws-sdk/lib-dynamodb").PutCommandOutput | null>;
27
- static safeDelete: (tableName: string, keyName: string, keyValue: any) => Promise<import("@aws-sdk/lib-dynamodb").DeleteCommandOutput | null>;
28
- static safeQueryByGSI: (tableName: string, gsiName: string, keyName: string, keyValue: any) => Promise<any[] | null>;
29
- static safeBatchGet: (tableName: string, keys: any) => Promise<Record<string, any>[]>;
30
- static queryAll: (params: any) => Promise<any[] | null>;
31
- static batchGet: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").BatchGetCommandOutput>;
32
- static get: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").GetCommandOutput>;
33
- static put: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").PutCommandOutput>;
34
- static query: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").QueryCommandOutput>;
35
- static scan: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").ScanCommandOutput>;
36
- static update: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").UpdateCommandOutput>;
37
- static delete: (params: any) => Promise<import("@aws-sdk/lib-dynamodb").DeleteCommandOutput>;
38
- }
39
-
40
- }
41
- declare module '@adtrackify/at-service-common/clients/generic/eventbridge-client' {
42
- import { EventBridgeClient as EventBridge } from '@aws-sdk/client-eventbridge';
43
- export class EventBridgeClient {
44
- eventBridge: EventBridge;
45
- EVENT_BUS_NAME: string;
46
- constructor(eventBusName: string);
47
- buildAndSendEvent: (eventSource: string, eventType: string, eventData: any) => Promise<import("@aws-sdk/client-eventbridge").PutEventsCommandOutput>;
48
- buildEvent: (eventType: string, eventData: any, eventId?: string, eventTime?: string) => {
49
- eventId: string;
50
- eventType: string;
51
- eventTime: string;
52
- eventData: any;
53
- };
54
- putEvent: (source: string, detailType: string, data: any, headers?: any) => Promise<import("@aws-sdk/client-eventbridge").PutEventsCommandOutput>;
55
- }
56
-
57
- }
58
- declare module '@adtrackify/at-service-common/clients/generic/http-client' {
59
- export const axiosHttpService: (config?: any) => {
60
- instance: () => import("axios").AxiosInstance;
61
- get: (url: string, config?: any) => Promise<{
62
- headers: any;
63
- data: any;
64
- status: any;
65
- }>;
66
- post: (url: string, data?: any, config?: any) => Promise<{
67
- headers: any;
68
- data: any;
69
- status: any;
70
- }>;
71
- delete: (url: string, config?: any) => Promise<{
72
- headers: any;
73
- data: any;
74
- status: any;
75
- }>;
76
- put: (url: string, data?: any, config?: any) => Promise<{
77
- headers: any;
78
- data: any;
79
- status: any;
80
- }>;
81
- patch: (url: string, data?: any, config?: any) => Promise<{
82
- headers: any;
83
- data: any;
84
- status: any;
85
- }>;
86
- setBaseUrl: (url: string) => boolean;
87
- };
88
-
89
- }
90
- declare module '@adtrackify/at-service-common/clients/generic/index' {
91
- export * from '@adtrackify/at-service-common/clients/generic/dynamodb-client.js/index';
92
- export * from '@adtrackify/at-service-common/clients/generic/eventbridge-client.js/index';
93
- export * from '@adtrackify/at-service-common/clients/generic/http-client.js/index';
94
- export * from '@adtrackify/at-service-common/clients/generic/s3-client.js/index';
95
- export * from '@adtrackify/at-service-common/clients/generic/cognito-client.js/index';
96
-
97
- }
98
- declare module '@adtrackify/at-service-common/clients/generic/s3-client' {
99
- import { ObjectCannedACL, S3 } from '@aws-sdk/client-s3';
100
- export class S3Client {
101
- s3: S3;
102
- constructor(region?: string);
103
- uploadJson(path: string, bucket: string, jsonData: any, ACL?: ObjectCannedACL | string): Promise<unknown>;
104
- }
105
-
106
- }
107
- declare module '@adtrackify/at-service-common/clients/index' {
108
- export * from '@adtrackify/at-service-common/clients/generic/index.js/index';
109
- export * from '@adtrackify/at-service-common/clients/internal-api/index.js/index';
110
- export * from '@adtrackify/at-service-common/clients/third-party/index.js/index';
111
-
112
- }
113
- declare module '@adtrackify/at-service-common/clients/internal-api/accounts-client' {
114
- import { ApiResponse } from '@adtrackify/at-service-common/types/api-response.js/index';
115
- import { Account, ACCOUNT_STATUS, Destination } from '@adtrackify/at-tracking-event-types';
116
- export interface AccountResponseData {
117
- account: Account;
118
- [key: string]: any;
119
- }
120
- export interface IsAuthorizedUserResponseData {
121
- isAccountUser: boolean;
122
- [key: string]: any;
123
- }
124
- export interface PixelConfigResponseData {
125
- id: string;
126
- destinations: Destination[];
127
- [key: string]: any;
128
- }
129
- export interface AddUserToAccountResponseData {
130
- userId: string;
131
- accountId: string;
132
- }
133
- export interface UpdateAccountRequest {
134
- accountName?: string;
135
- companyName?: string;
136
- primaryEmail?: string;
137
- ownerId?: string;
138
- subscriptionId?: string;
139
- accountStatus?: ACCOUNT_STATUS;
140
- }
141
- export class AccountsClient {
142
- BASE_API_URL: string;
143
- ACCOUNTS_API_KEY?: string;
144
- constructor(baseApiUrl: string, accountsApiKey?: string);
145
- getConfig: () => any;
146
- getClient: () => Promise<{
147
- instance: () => import("axios").AxiosInstance;
148
- get: (url: string, config?: any) => Promise<{
149
- headers: any;
150
- data: any;
151
- status: any;
152
- }>;
153
- post: (url: string, data?: any, config?: any) => Promise<{
154
- headers: any;
155
- data: any;
156
- status: any;
157
- }>;
158
- delete: (url: string, config?: any) => Promise<{
159
- headers: any;
160
- data: any;
161
- status: any;
162
- }>;
163
- put: (url: string, data?: any, config?: any) => Promise<{
164
- headers: any;
165
- data: any;
166
- status: any;
167
- }>;
168
- patch: (url: string, data?: any, config?: any) => Promise<{
169
- headers: any;
170
- data: any;
171
- status: any;
172
- }>;
173
- setBaseUrl: (url: string) => boolean;
174
- }>;
175
- createAccount: (createAccountRequest: any) => Promise<{
176
- headers: any;
177
- data: any;
178
- status: any;
179
- }>;
180
- updateAccount: (accountId: string, body: any) => Promise<ApiResponse<AccountResponseData>>;
181
- addOwner: (accountId: string, userId: string) => Promise<{
182
- headers: any;
183
- data: any;
184
- status: any;
185
- }>;
186
- isAuthorizedUser: (userId: string, accountId: string, pixelId?: string) => Promise<ApiResponse<IsAuthorizedUserResponseData>>;
187
- adminDeleteAccount: (accountId: string) => Promise<{
188
- headers: any;
189
- data: any;
190
- status: any;
191
- }>;
192
- getPixelConfigById: (pixelId: string) => Promise<ApiResponse<PixelConfigResponseData>>;
193
- getAccount: (accountId: string) => Promise<ApiResponse<AccountResponseData>>;
194
- addUserToAccount: (accountId: string, userId: string) => Promise<ApiResponse<AddUserToAccountResponseData>>;
195
- }
196
-
197
- }
198
- declare module '@adtrackify/at-service-common/clients/internal-api/destinations-client' {
199
- import { ApiResponse } from '@adtrackify/at-service-common/types/api-response.js/index';
200
- import { Destination } from '@adtrackify/at-tracking-event-types';
201
- export interface GetDestinationsResponseData {
202
- destinations: Destination[];
203
- [key: string]: any;
204
- }
205
- export interface CreateDestinationResponseData {
206
- destination: Destination;
207
- [key: string]: any;
208
- }
209
- export class DestinationsClient {
210
- BASE_API_URL: string;
211
- DESTINATIONS_API_KEY: string;
212
- constructor(baseApiUrl: string, destinationsApiKey: string);
213
- getConfig: () => {
214
- baseURL: string;
215
- headers: {
216
- common: {
217
- 'x-api-key': string;
218
- };
219
- };
220
- };
221
- getClient: () => Promise<{
222
- instance: () => import("axios").AxiosInstance;
223
- get: (url: string, config?: any) => Promise<{
224
- headers: any;
225
- data: any;
226
- status: any;
227
- }>;
228
- post: (url: string, data?: any, config?: any) => Promise<{
229
- headers: any;
230
- data: any;
231
- status: any;
232
- }>;
233
- delete: (url: string, config?: any) => Promise<{
234
- headers: any;
235
- data: any;
236
- status: any;
237
- }>;
238
- put: (url: string, data?: any, config?: any) => Promise<{
239
- headers: any;
240
- data: any;
241
- status: any;
242
- }>;
243
- patch: (url: string, data?: any, config?: any) => Promise<{
244
- headers: any;
245
- data: any;
246
- status: any;
247
- }>;
248
- setBaseUrl: (url: string) => boolean;
249
- }>;
250
- createDestination: (createDestinationRequest: any) => Promise<ApiResponse<CreateDestinationResponseData>>;
251
- getPixelDestinations: (pixelId: string) => Promise<ApiResponse<GetDestinationsResponseData>>;
252
- }
253
-
254
- }
255
- declare module '@adtrackify/at-service-common/clients/internal-api/index' {
256
- export * from '@adtrackify/at-service-common/clients/internal-api/destinations-client.js/index';
257
- export * from '@adtrackify/at-service-common/clients/internal-api/accounts-client.js/index';
258
- export * from '@adtrackify/at-service-common/clients/internal-api/users-auth-client.js/index';
259
- export * from '@adtrackify/at-service-common/clients/internal-api/shopify-app-install-client.js/index';
260
-
261
- }
262
- declare module '@adtrackify/at-service-common/clients/internal-api/shopify-app-install-client' {
263
- import { ApiResponse } from '@adtrackify/at-service-common/types/api-response.js/index';
264
- import { ShopifyAppInstall, ShopifyAppSubscriptionStatus } from '@adtrackify/at-tracking-event-types';
265
- export interface ShopifyAppInstallResponseData {
266
- shopifyAppInstall: ShopifyAppInstall;
267
- [key: string]: any;
268
- }
269
- export interface UpdateShopifyAppInstallRequest {
270
- appSubscriptionStatus?: ShopifyAppSubscriptionStatus;
271
- pixelId?: string;
272
- shopifyAppInstallId: string;
273
- isAppEnabled?: boolean;
274
- }
275
- export class ShopifyAppInstallClient {
276
- BASE_API_URL: string;
277
- SHOPIFY_APP_INSTALL_API_KEY: string;
278
- constructor(baseApiUrl: string, shopifyAppInstallApiKey: string);
279
- getConfig: () => {
280
- baseURL: string;
281
- headers: {
282
- common: {
283
- 'x-api-key': string;
284
- };
285
- };
286
- };
287
- getClient: () => Promise<{
288
- instance: () => import("axios").AxiosInstance;
289
- get: (url: string, config?: any) => Promise<{
290
- headers: any;
291
- data: any;
292
- status: any;
293
- }>;
294
- post: (url: string, data?: any, config?: any) => Promise<{
295
- headers: any;
296
- data: any;
297
- status: any;
298
- }>;
299
- delete: (url: string, config?: any) => Promise<{
300
- headers: any;
301
- data: any;
302
- status: any;
303
- }>;
304
- put: (url: string, data?: any, config?: any) => Promise<{
305
- headers: any;
306
- data: any;
307
- status: any;
308
- }>;
309
- patch: (url: string, data?: any, config?: any) => Promise<{
310
- headers: any;
311
- data: any;
312
- status: any;
313
- }>;
314
- setBaseUrl: (url: string) => boolean;
315
- }>;
316
- updateShopifyAppInstall: (shopifyAppInstallId: string, updateShopifyAppInstallRequest: UpdateShopifyAppInstallRequest) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
317
- getShopifyAppInstall: (shopifyAppInstallId: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
318
- getShopifyAppInstallByShop: (shop: string) => Promise<ApiResponse<ShopifyAppInstallResponseData>>;
319
- }
320
-
321
- }
322
- declare module '@adtrackify/at-service-common/clients/internal-api/users-auth-client' {
323
- import { User } from '@adtrackify/at-tracking-event-types';
324
- import { ApiResponse } from '@adtrackify/at-service-common/types/api-response.js/index';
325
- export interface UserResponseData {
326
- user: User;
327
- [key: string]: any;
328
- }
329
- export interface UserSignupRequest {
330
- email: string;
331
- password: string;
332
- givenName: string;
333
- familyName: string;
334
- }
335
- export class UsersAuthClient {
336
- SERVICE_API_ROOT_URL: string;
337
- BASE_API_URL: string;
338
- USERS_AUTH_API_KEY: string;
339
- constructor(baseApiUrl: string, usersAuthApiKey?: string);
340
- getConfig: () => {
341
- baseURL: string;
342
- headers: {
343
- common: {};
344
- };
345
- };
346
- getClient: () => Promise<{
347
- instance: () => import("axios").AxiosInstance;
348
- get: (url: string, config?: any) => Promise<{
349
- headers: any;
350
- data: any;
351
- status: any;
352
- }>;
353
- post: (url: string, data?: any, config?: any) => Promise<{
354
- headers: any;
355
- data: any;
356
- status: any;
357
- }>;
358
- delete: (url: string, config?: any) => Promise<{
359
- headers: any;
360
- data: any;
361
- status: any;
362
- }>;
363
- put: (url: string, data?: any, config?: any) => Promise<{
364
- headers: any;
365
- data: any;
366
- status: any;
367
- }>;
368
- patch: (url: string, data?: any, config?: any) => Promise<{
369
- headers: any;
370
- data: any;
371
- status: any;
372
- }>;
373
- setBaseUrl: (url: string) => boolean;
374
- }>;
375
- signupAndConfirmUser: (userSignupRequest: any) => Promise<any>;
376
- signupUser: (userSignupRequest: UserSignupRequest) => Promise<any>;
377
- adminConfirmUser: (email: string) => Promise<{
378
- headers: any;
379
- data: any;
380
- status: any;
381
- }>;
382
- getUserByEmail: (email: string) => Promise<ApiResponse<UserResponseData>>;
383
- }
384
-
385
- }
386
- declare module '@adtrackify/at-service-common/clients/third-party/index' {
387
- export * from '@adtrackify/at-service-common/clients/third-party/shopify-client.js/index';
388
-
389
- }
390
- declare module '@adtrackify/at-service-common/clients/third-party/shopify-client' {
391
- export class ShopifyClient {
392
- static _shopify_api_version: string;
393
- static getConfig: (shopifyDomain: string, accessToken: string) => {
394
- baseURL: string;
395
- headers: {
396
- common: {
397
- 'X-Shopify-Access-Token': string;
398
- };
399
- };
400
- };
401
- static getClient: (shopifyDomain: string, accessToken: string) => {
402
- instance: () => import("axios").AxiosInstance;
403
- get: (url: string, config?: any) => Promise<{
404
- headers: any;
405
- data: any;
406
- status: any;
407
- }>;
408
- post: (url: string, data?: any, config?: any) => Promise<{
409
- headers: any;
410
- data: any;
411
- status: any;
412
- }>;
413
- delete: (url: string, config?: any) => Promise<{
414
- headers: any;
415
- data: any;
416
- status: any;
417
- }>;
418
- put: (url: string, data?: any, config?: any) => Promise<{
419
- headers: any;
420
- data: any;
421
- status: any;
422
- }>;
423
- patch: (url: string, data?: any, config?: any) => Promise<{
424
- headers: any;
425
- data: any;
426
- status: any;
427
- }>;
428
- setBaseUrl: (url: string) => boolean;
429
- };
430
- static registerApp: (shop: string, code: string, appKey: string, appSecret: string) => Promise<{
431
- headers: any;
432
- data: any;
433
- status: any;
434
- }>;
435
- static registerWebhookTopic: (shop: string, accessToken: string, eventBridgeArn: string, topic: string) => Promise<{
436
- headers: any;
437
- data: any;
438
- status: any;
439
- }>;
440
- static updateShopifyAppMetafield: (shop: string, accessToken: string, pixelId: string) => Promise<{
441
- headers: any;
442
- data: any;
443
- status: any;
444
- }>;
445
- static getShopifyStoreProperties: (shop: string, accessToken: string) => Promise<{
446
- headers: any;
447
- data: any;
448
- status: any;
449
- }>;
450
- static createAppSubscription: (shop: string, accessToken: string, planName: string, price: number, returnUrl: string, trialDays: number, test?: boolean) => Promise<{
451
- headers: any;
452
- data: any;
453
- status: any;
454
- }>;
455
- static cancelAppSubscription: (shop: string, accessToken: string, chargeId: string) => Promise<{
456
- headers: any;
457
- data: any;
458
- status: any;
459
- }>;
460
- static listAppSubscriptions: (shop: string, accessToken: string) => Promise<{
461
- headers: any;
462
- data: any;
463
- status: any;
464
- }>;
465
- static genericShopifyPost: (url: string, accessToken: string, payload: any) => Promise<{
466
- headers: any;
467
- data: any;
468
- status: any;
469
- }>;
470
- static genericShopifyGet: (url: string, accessToken: string) => Promise<{
471
- headers: any;
472
- data: any;
473
- status: any;
474
- }>;
475
- static genericShopifyPut: (url: string, accessToken: string, payload: any) => Promise<{
476
- headers: any;
477
- data: any;
478
- status: any;
479
- }>;
480
- }
481
-
482
- }
483
- declare module '@adtrackify/at-service-common/helpers/index' {
484
- export * from '@adtrackify/at-service-common/helpers/input-validation-helper.js/index';
485
- export * from '@adtrackify/at-service-common/helpers/logging-helper.js/index';
486
- export * from '@adtrackify/at-service-common/helpers/response-helper.js/index';
487
- export * from '@adtrackify/at-service-common/helpers/shopify-helper.js/index';
488
- export * from '@adtrackify/at-service-common/helpers/subscription-helper.js/index';
489
-
490
- }
491
- declare module '@adtrackify/at-service-common/helpers/input-validation-helper' {
492
- import Joi from 'joi';
493
- export const validateInput: (schema: Joi.ObjectSchema<any>, input: any) => any;
494
-
495
- }
496
- declare module '@adtrackify/at-service-common/helpers/logging-helper' {
497
- export const configureLogger: (event: any, context: any, debug?: boolean) => void;
498
-
499
- }
500
- declare module '@adtrackify/at-service-common/helpers/response-helper' {
501
- export const success: (body: any) => {
502
- statusCode: number;
503
- headers: {
504
- 'Access-Control-Allow-Origin': string;
505
- 'Access-Control-Allow-Credentials': boolean;
506
- 'cache-control': string;
507
- Date: Date;
508
- 'Last-Modified': Date;
509
- 'Access-Control-Allow-Headers': string;
510
- };
511
- body: string;
512
- };
513
- export const failure: (error: any, statusCode?: number) => {
514
- statusCode: number;
515
- headers: {
516
- 'Access-Control-Allow-Origin': string;
517
- 'Access-Control-Allow-Credentials': boolean;
518
- 'cache-control': string;
519
- Date: Date;
520
- 'Last-Modified': Date;
521
- 'Access-Control-Allow-Headers': string;
522
- };
523
- body: string;
524
- };
525
- export const buildResponse: (statusCode: number, body?: any) => {
526
- statusCode: number;
527
- headers: {
528
- 'Access-Control-Allow-Origin': string;
529
- 'Access-Control-Allow-Credentials': boolean;
530
- 'cache-control': string;
531
- Date: Date;
532
- 'Last-Modified': Date;
533
- 'Access-Control-Allow-Headers': string;
534
- };
535
- body: string;
536
- };
537
-
538
- }
539
- declare module '@adtrackify/at-service-common/helpers/shopify-helper' {
540
- export interface ShopifyRequestValidationParameters {
541
- code: string;
542
- hmac?: string;
543
- shop: string;
544
- state: string;
545
- timestamp: string;
546
- }
547
- export const isShopifyRequestValid: (validationParams: ShopifyRequestValidationParameters, validationHmac: string, shopifyAppApiSecret: string) => boolean;
548
- export const validateShopifyRequest: (validationParams: ShopifyRequestValidationParameters, validationHmac: string, shopifyAppApiSecret: string) => boolean;
549
-
550
- }
551
- declare module '@adtrackify/at-service-common/helpers/subscription-helper' {
552
- import { SubscriptionPlan } from '@adtrackify/at-tracking-event-types';
553
- export const StripeBillingMap: any;
554
- export const CommonPlanInfo: string[];
555
- export const SubscriptionPlanSeedItems: {
556
- items: SubscriptionPlan[];
557
- };
558
- export const getPlanDetails: (planId: number, stage: string) => SubscriptionPlan;
559
- export const getPlanByStripePriceId: (stripePriceId: string, stage: string) => SubscriptionPlan;
560
-
561
- }
562
- declare module '@adtrackify/at-service-common/index' {
563
- export * from '@adtrackify/at-service-common/clients/index.js/index';
564
- export * from '@adtrackify/at-service-common/helpers/index.js/index';
565
- export * from '@adtrackify/at-service-common/libs/index.js/index';
566
- export * from '@adtrackify/at-service-common/types/index.js/index';
567
- export * from '@adtrackify/at-service-common/services/index.js/index';
568
-
569
- }
570
- declare module '@adtrackify/at-service-common/libs/crypto' {
571
- export const generatePublicKey: () => string;
572
-
573
- }
574
- declare module '@adtrackify/at-service-common/libs/dates' {
575
- export const getCurrentTimestamp: () => string;
576
- export const getDateFromTimestamp: (timestamp: string) => string;
577
- export const getCurrentDate: () => string;
578
-
579
- }
580
- declare module '@adtrackify/at-service-common/libs/http-error' {
581
- export class HttpError extends Error {
582
- body: {
583
- [key: string]: any;
584
- };
585
- headers: object[];
586
- statusCode: number;
587
- isServerError: boolean;
588
- constructor(statusCode: number, message?: string, body?: {
589
- [key: string]: any;
590
- }, headers?: object[]);
591
- static get supportedStatusCodes(): any;
592
- static badRequest: (message?: string, body?: object, headers?: object[]) => HttpError;
593
- static unauthorized: (message?: string, body?: object, headers?: object[]) => HttpError;
594
- static forbidden: (message?: string, body?: object, headers?: object[]) => HttpError;
595
- static notFound: (message?: string, body?: object, headers?: object[]) => HttpError;
596
- static internal: (message?: string, body?: object, headers?: object[]) => HttpError;
597
- static notImplemented: () => HttpError;
598
- static badGateway: () => HttpError;
599
- static serviceUnavailable: (headers: object[]) => HttpError;
600
- static gatewayTimeout: () => HttpError;
601
- }
602
-
603
- }
604
- declare module '@adtrackify/at-service-common/libs/http-status-codes' {
605
- export enum HttpStatusCodes {
606
- CONTINUE = 100,
607
- SWITCHING_PROTOCOLS = 101,
608
- PROCESSING = 102,
609
- OK = 200,
610
- CREATED = 201,
611
- ACCEPTED = 202,
612
- NON_AUTHORITATIVE_INFORMATION = 203,
613
- NO_CONTENT = 204,
614
- RESET_CONTENT = 205,
615
- PARTIAL_CONTENT = 206,
616
- MULTI_STATUS = 207,
617
- MULTIPLE_CHOICES = 300,
618
- MOVED_PERMANENTLY = 301,
619
- MOVED_TEMPORARILY = 302,
620
- SEE_OTHER = 303,
621
- NOT_MODIFIED = 304,
622
- USE_PROXY = 305,
623
- TEMPORARY_REDIRECT = 307,
624
- PERMANENT_REDIRECT = 308,
625
- BAD_REQUEST = 400,
626
- UNAUTHORIZED = 401,
627
- PAYMENT_REQUIRED = 402,
628
- FORBIDDEN = 403,
629
- NOT_FOUND = 404,
630
- METHOD_NOT_ALLOWED = 405,
631
- NOT_ACCEPTABLE = 406,
632
- PROXY_AUTHENTICATION_REQUIRED = 407,
633
- REQUEST_TIMEOUT = 408,
634
- CONFLICT = 409,
635
- GONE = 410,
636
- LENGTH_REQUIRED = 411,
637
- PRECONDITION_FAILED = 412,
638
- REQUEST_TOO_LONG = 413,
639
- REQUEST_URI_TOO_LONG = 414,
640
- UNSUPPORTED_MEDIA_TYPE = 415,
641
- REQUESTED_RANGE_NOT_SATISFIABLE = 416,
642
- EXPECTATION_FAILED = 417,
643
- IM_A_TEAPOT = 418,
644
- INSUFFICIENT_SPACE_ON_RESOURCE = 419,
645
- METHOD_FAILURE = 420,
646
- MISDIRECTED_REQUEST = 421,
647
- UNPROCESSABLE_ENTITY = 422,
648
- LOCKED = 423,
649
- FAILED_DEPENDENCY = 424,
650
- PRECONDITION_REQUIRED = 428,
651
- TOO_MANY_REQUESTS = 429,
652
- REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
653
- UNAVAILABLE_FOR_LEGAL_REASONS = 451,
654
- INTERNAL_SERVER_ERROR = 500,
655
- NOT_IMPLEMENTED = 501,
656
- BAD_GATEWAY = 502,
657
- SERVICE_UNAVAILABLE = 503,
658
- GATEWAY_TIMEOUT = 504,
659
- HTTP_VERSION_NOT_SUPPORTED = 505,
660
- INSUFFICIENT_STORAGE = 507,
661
- NETWORK_AUTHENTICATION_REQUIRED = 511
662
- }
663
-
664
- }
665
- declare module '@adtrackify/at-service-common/libs/index' {
666
- export * from '@adtrackify/at-service-common/helpers/shopify-helper.js/index';
667
- export * from '@adtrackify/at-service-common/libs/crypto.js/index';
668
- export * from '@adtrackify/at-service-common/libs/dates.js/index';
669
- export * from '@adtrackify/at-service-common/libs/http-error.js/index';
670
- export * from '@adtrackify/at-service-common/libs/http-status-codes.js/index';
671
- export * from '@adtrackify/at-service-common/libs/url.js/index';
672
-
673
- }
674
- declare module '@adtrackify/at-service-common/libs/url' {
675
- export const mapObjectToQueryString: (inputObj: any) => string;
676
-
677
- }
678
- declare module '@adtrackify/at-service-common/services/eventbridge-integration-service' {
679
- import { EventBridgeClient } from '@adtrackify/at-service-common/clients/generic/eventbridge-client.js/index';
680
- import { Message, TemplatedMessage } from 'postmark';
681
- export const enum PostmarkRequestType {
682
- SINGLE_EMAIL = "single_email",
683
- TEMPLATE_EMAIL = "template_email"
684
- }
685
- export enum ADTRACKIFY_EVENT_BRIDGE_EVENTS {
686
- SEND_POSTMARK_EMAIL = "integration.sendPostmarkEmail"
687
- }
688
- export class EventBridgeIntegrationService {
689
- eventBridgeClient: EventBridgeClient;
690
- EVENT_BUS_NAME: string;
691
- constructor(eventBusName: string);
692
- sendPostmarkEmailEvent: (eventSource: string, postmarkMessage: Message, postmarkServerToken: string) => Promise<import("@aws-sdk/client-eventbridge").PutEventsCommandOutput>;
693
- sendPostmarkTemplatedEmailEvent: (eventSource: string, postmarkMessage: TemplatedMessage, postmarkServerToken: string) => Promise<import("@aws-sdk/client-eventbridge").PutEventsCommandOutput>;
694
- }
695
-
696
- }
697
- declare module '@adtrackify/at-service-common/services/index' {
698
- export * from '@adtrackify/at-service-common/services/eventbridge-integration-service.js/index';
699
-
700
- }
701
- declare module '@adtrackify/at-service-common/types/api-response' {
702
- import { AxiosResponseHeaders } from 'axios';
703
- export interface ApiResponse<T> {
704
- data: T;
705
- status: number;
706
- headers?: AxiosResponseHeaders;
707
- }
708
-
709
- }
710
- declare module '@adtrackify/at-service-common/types/index' {
711
- export * from '@adtrackify/at-service-common/types/internal-events/index.js/index';
712
-
713
- }
714
- declare module '@adtrackify/at-service-common/types/internal-events/event-detail-types' {
715
- export enum ADTRACKIFY_EVENT_TYPES {
716
- NOTIFY_SHOPIFY_SUBSCRIPTION_CREATED = "shopifySubscriptionCreated",
717
- NOTIFY_SUBSCRIPTION_SIGNUP_COMPLETED = "subscription.signupCompleted",
718
- REQUEST_SET_ACCOUNT_OWNER = "setAccountOwner",
719
- REQUEST_SET_ACCOUNT_SUBSCRIPTION_ID = "setAccountSubscriptionId"
720
- }
721
- export enum ADTRACKIFY_EVENT_SOURCES {
722
- SUBSCRIPTIONS = "subscriptions"
723
- }
724
-
725
- }
726
- declare module '@adtrackify/at-service-common/types/internal-events/index' {
727
- export * from '@adtrackify/at-service-common/types/internal-events/event-detail-types.js/index';
728
-
729
- }
730
- declare module '@adtrackify/at-service-common/__tests__/helpers/subscription-helper.spec' {
731
- export {};
732
-
733
- }
734
- declare module '@adtrackify/at-service-common' {
735
- import main = require('@adtrackify/at-service-common/src/index');
736
- export = main;
737
- }
1
+ export * from './clients/index.js';
2
+ export * from './helpers/index.js';
3
+ export * from './libs/index.js';
4
+ export * from './types/index.js';
5
+ export * from './services/index.js';