@8ms/helpers 1.1.79 → 1.1.82

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.
@@ -0,0 +1,6 @@
1
+ import { Response } from './response';
2
+ declare type IsSuccess = {
3
+ response: Response;
4
+ };
5
+ declare const isError: ({ response }: IsSuccess) => boolean;
6
+ export default isError;
package/api/isError.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const states_1 = __importDefault(require("./states"));
7
+ const isError = ({ response }) => {
8
+ return states_1.default.ERROR === response.state;
9
+ };
10
+ exports.default = isError;
@@ -0,0 +1,6 @@
1
+ import { Response } from './response';
2
+ declare type IsSuccess = {
3
+ response: Response;
4
+ };
5
+ declare const isSuccess: ({ response }: IsSuccess) => boolean;
6
+ export default isSuccess;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const states_1 = __importDefault(require("./states"));
7
+ const isSuccess = ({ response }) => {
8
+ return states_1.default.SUCCESS === response.state;
9
+ };
10
+ exports.default = isSuccess;
@@ -11,9 +11,9 @@ global.awsLambdaClient = null;
11
11
  */
12
12
  const initClient = ({ config }) => {
13
13
  if (!global.awsLambdaClient) {
14
- const { S3Client } = require('@aws-sdk/client-lambda');
14
+ const { LambdaClient } = require('@aws-sdk/client-lambda');
15
15
  const formattedConfig = (0, getConfig_1.default)({ config });
16
- global.awsLambdaClient = new S3Client(formattedConfig);
16
+ global.awsLambdaClient = new LambdaClient(formattedConfig);
17
17
  }
18
18
  };
19
19
  exports.default = initClient;
@@ -1 +1,10 @@
1
- export {};
1
+ declare type CreateTable = {
2
+ datasetId: string;
3
+ options: object;
4
+ tableId: string;
5
+ };
6
+ /**
7
+ * Create a Table if it doesn't already exist.
8
+ */
9
+ declare const createTable: ({ datasetId, options, tableId }: CreateTable) => Promise<void>;
10
+ export default createTable;
@@ -14,3 +14,4 @@ const createTable = async ({ datasetId, options, tableId }) => {
14
14
  .createTable(tableId, options);
15
15
  }
16
16
  };
17
+ exports.default = createTable;
@@ -0,0 +1,222 @@
1
+ /**
2
+ * As defined in:
3
+ * https://docs.google.com/spreadsheets/d/1T2ObmYoo6BNzrqYKb2ts75A6IKfnXmnndr2wujgNpak/edit#gid=2146701026
4
+ */
5
+ declare const countries: {
6
+ AFGHANISTAN: number;
7
+ ALBANIA: number;
8
+ ANTARCTICA: number;
9
+ ALGERIA: number;
10
+ AMERICAN_SAMOA: number;
11
+ ANDORRA: number;
12
+ ANGOLA: number;
13
+ ANTIGUA_AND_BARBUDA: number;
14
+ AZERBAIJAN: number;
15
+ ARGENTINA: number;
16
+ AUSTRALIA: number;
17
+ AUSTRIA: number;
18
+ THE_BAHAMAS: number;
19
+ BAHRAIN: number;
20
+ BANGLADESH: number;
21
+ ARMENIA: number;
22
+ BARBADOS: number;
23
+ BELGIUM: number;
24
+ BHUTAN: number;
25
+ BOLIVIA: number;
26
+ BOSNIA_AND_HERZEGOVINA: number;
27
+ BOTSWANA: number;
28
+ BRAZIL: number;
29
+ BELIZE: number;
30
+ SOLOMON_ISLANDS: number;
31
+ BRUNEI: number;
32
+ BULGARIA: number;
33
+ MYANMAR_BURMA: number;
34
+ BURUNDI: number;
35
+ BELARUS: number;
36
+ CAMBODIA: number;
37
+ CAMEROON: number;
38
+ CANADA: number;
39
+ CAPE_VERDE: number;
40
+ CENTRAL_AFRICAN_REPUBLIC: number;
41
+ SRI_LANKA: number;
42
+ CHAD: number;
43
+ CHILE: number;
44
+ CHINA: number;
45
+ CHRISTMAS_ISLAND: number;
46
+ COCOS_KEELING_ISLANDS: number;
47
+ COLOMBIA: number;
48
+ COMOROS: number;
49
+ REPUBLIC_OF_THE_CONGO: number;
50
+ DEMOCRATIC_REPUBLIC_OF_THE_CONGO: number;
51
+ COOK_ISLANDS: number;
52
+ COSTA_RICA: number;
53
+ CROATIA: number;
54
+ CYPRUS: number;
55
+ CZECHIA: number;
56
+ BENIN: number;
57
+ DENMARK: number;
58
+ DOMINICA: number;
59
+ DOMINICAN_REPUBLIC: number;
60
+ ECUADOR: number;
61
+ EL_SALVADOR: number;
62
+ EQUATORIAL_GUINEA: number;
63
+ ETHIOPIA: number;
64
+ ERITREA: number;
65
+ ESTONIA: number;
66
+ SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS: number;
67
+ FIJI: number;
68
+ FINLAND: number;
69
+ FRANCE: number;
70
+ FRENCH_POLYNESIA: number;
71
+ FRENCH_SOUTHERN_AND_ANTARCTIC_LANDS: number;
72
+ DJIBOUTI: number;
73
+ GABON: number;
74
+ GEORGIA: number;
75
+ THE_GAMBIA: number;
76
+ GERMANY: number;
77
+ GHANA: number;
78
+ KIRIBATI: number;
79
+ GREECE: number;
80
+ GRENADA: number;
81
+ GUAM: number;
82
+ GUATEMALA: number;
83
+ GUINEA: number;
84
+ GUYANA: number;
85
+ HAITI: number;
86
+ HEARD_ISLAND_AND_MCDONALD_ISLANDS: number;
87
+ VATICAN_CITY: number;
88
+ HONDURAS: number;
89
+ HUNGARY: number;
90
+ ICELAND: number;
91
+ INDIA: number;
92
+ INDONESIA: number;
93
+ IRAQ: number;
94
+ IRELAND: number;
95
+ ISRAEL: number;
96
+ ITALY: number;
97
+ COTE_DIVOIRE: number;
98
+ JAMAICA: number;
99
+ JAPAN: number;
100
+ KAZAKHSTAN: number;
101
+ JORDAN: number;
102
+ KENYA: number;
103
+ SOUTH_KOREA: number;
104
+ KUWAIT: number;
105
+ KYRGYZSTAN: number;
106
+ LAOS: number;
107
+ LEBANON: number;
108
+ LESOTHO: number;
109
+ LATVIA: number;
110
+ LIBERIA: number;
111
+ LIBYA: number;
112
+ LIECHTENSTEIN: number;
113
+ LITHUANIA: number;
114
+ LUXEMBOURG: number;
115
+ MADAGASCAR: number;
116
+ MALAWI: number;
117
+ MALAYSIA: number;
118
+ MALDIVES: number;
119
+ MALI: number;
120
+ MALTA: number;
121
+ MAURITANIA: number;
122
+ MAURITIUS: number;
123
+ MEXICO: number;
124
+ MONACO: number;
125
+ MONGOLIA: number;
126
+ MOLDOVA: number;
127
+ MONTENEGRO: number;
128
+ MOROCCO: number;
129
+ MOZAMBIQUE: number;
130
+ OMAN: number;
131
+ NAMIBIA: number;
132
+ NAURU: number;
133
+ NEPAL: number;
134
+ NETHERLANDS: number;
135
+ CURACAO: number;
136
+ SINT_MAARTEN: number;
137
+ CARIBBEAN_NETHERLANDS: number;
138
+ NEW_CALEDONIA: number;
139
+ VANUATU: number;
140
+ NEW_ZEALAND: number;
141
+ NICARAGUA: number;
142
+ NIGER: number;
143
+ NIGERIA: number;
144
+ NIUE: number;
145
+ NORFOLK_ISLAND: number;
146
+ NORWAY: number;
147
+ NORTHERN_MARIANA_ISLANDS: number;
148
+ UNITED_STATES_MINOR_OUTLYING_ISLANDS: number;
149
+ FEDERATED_STATES_OF_MICRONESIA: number;
150
+ MARSHALL_ISLANDS: number;
151
+ PALAU: number;
152
+ PAKISTAN: number;
153
+ PANAMA: number;
154
+ PAPUA_NEW_GUINEA: number;
155
+ PARAGUAY: number;
156
+ PERU: number;
157
+ PHILIPPINES: number;
158
+ PITCAIRN_ISLANDS: number;
159
+ POLAND: number;
160
+ PORTUGAL: number;
161
+ GUINEA_BISSAU: number;
162
+ TIMOR_LESTE: number;
163
+ QATAR: number;
164
+ ROMANIA: number;
165
+ RUSSIA: number;
166
+ RWANDA: number;
167
+ SAINT_HELENA__ASCENSION_AND_TRISTAN_DA_CUNHA: number;
168
+ SAINT_KITTS_AND_NEVIS: number;
169
+ SAINT_LUCIA: number;
170
+ SAINT_PIERRE_AND_MIQUELON: number;
171
+ SAINT_VINCENT_AND_THE_GRENADINES: number;
172
+ SAN_MARINO: number;
173
+ SAO_TOME_AND_PRINCIPE: number;
174
+ SAUDI_ARABIA: number;
175
+ SENEGAL: number;
176
+ SERBIA: number;
177
+ SEYCHELLES: number;
178
+ SIERRA_LEONE: number;
179
+ SINGAPORE: number;
180
+ SLOVAKIA: number;
181
+ VIETNAM: number;
182
+ SLOVENIA: number;
183
+ SOMALIA: number;
184
+ SOUTH_AFRICA: number;
185
+ ZIMBABWE: number;
186
+ SPAIN: number;
187
+ SUDAN: number;
188
+ SURINAME: number;
189
+ ESWATINI: number;
190
+ SWEDEN: number;
191
+ SWITZERLAND: number;
192
+ TAJIKISTAN: number;
193
+ THAILAND: number;
194
+ TOGO: number;
195
+ TOKELAU: number;
196
+ TONGA: number;
197
+ TRINIDAD_AND_TOBAGO: number;
198
+ UNITED_ARAB_EMIRATES: number;
199
+ TUNISIA: number;
200
+ TURKEY: number;
201
+ TURKMENISTAN: number;
202
+ TUVALU: number;
203
+ UGANDA: number;
204
+ UKRAINE: number;
205
+ NORTH_MACEDONIA: number;
206
+ EGYPT: number;
207
+ UNITED_KINGDOM: number;
208
+ GUERNSEY: number;
209
+ JERSEY: number;
210
+ TANZANIA: number;
211
+ UNITED_STATES: number;
212
+ BURKINA_FASO: number;
213
+ URUGUAY: number;
214
+ UZBEKISTAN: number;
215
+ VENEZUELA: number;
216
+ WALLIS_AND_FUTUNA: number;
217
+ SAMOA: number;
218
+ YEMEN: number;
219
+ ZAMBIA: number;
220
+ };
221
+ export declare type Country = typeof countries.AFGHANISTAN | typeof countries.ALBANIA | typeof countries.ANTARCTICA | typeof countries.ALGERIA | typeof countries.AMERICAN_SAMOA | typeof countries.ANDORRA | typeof countries.ANGOLA | typeof countries.ANTIGUA_AND_BARBUDA | typeof countries.AZERBAIJAN | typeof countries.ARGENTINA | typeof countries.AUSTRALIA | typeof countries.AUSTRIA | typeof countries.THE_BAHAMAS | typeof countries.BAHRAIN | typeof countries.BANGLADESH | typeof countries.ARMENIA | typeof countries.BARBADOS | typeof countries.BELGIUM | typeof countries.BHUTAN | typeof countries.BOLIVIA | typeof countries.BOSNIA_AND_HERZEGOVINA | typeof countries.BOTSWANA | typeof countries.BRAZIL | typeof countries.BELIZE | typeof countries.SOLOMON_ISLANDS | typeof countries.BRUNEI | typeof countries.BULGARIA | typeof countries.MYANMAR_BURMA | typeof countries.BURUNDI | typeof countries.BELARUS | typeof countries.CAMBODIA | typeof countries.CAMEROON | typeof countries.CANADA | typeof countries.CAPE_VERDE | typeof countries.CENTRAL_AFRICAN_REPUBLIC | typeof countries.SRI_LANKA | typeof countries.CHAD | typeof countries.CHILE | typeof countries.CHINA | typeof countries.CHRISTMAS_ISLAND | typeof countries.COCOS_KEELING_ISLANDS | typeof countries.COLOMBIA | typeof countries.COMOROS | typeof countries.REPUBLIC_OF_THE_CONGO | typeof countries.DEMOCRATIC_REPUBLIC_OF_THE_CONGO | typeof countries.COOK_ISLANDS | typeof countries.COSTA_RICA | typeof countries.CROATIA | typeof countries.CYPRUS | typeof countries.CZECHIA | typeof countries.BENIN | typeof countries.DENMARK | typeof countries.DOMINICA | typeof countries.DOMINICAN_REPUBLIC | typeof countries.ECUADOR | typeof countries.EL_SALVADOR | typeof countries.EQUATORIAL_GUINEA | typeof countries.ETHIOPIA | typeof countries.ERITREA | typeof countries.ESTONIA | typeof countries.SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS | typeof countries.FIJI | typeof countries.FINLAND | typeof countries.FRANCE | typeof countries.FRENCH_POLYNESIA | typeof countries.FRENCH_SOUTHERN_AND_ANTARCTIC_LANDS | typeof countries.DJIBOUTI | typeof countries.GABON | typeof countries.GEORGIA | typeof countries.THE_GAMBIA | typeof countries.GERMANY | typeof countries.GHANA | typeof countries.KIRIBATI | typeof countries.GREECE | typeof countries.GRENADA | typeof countries.GUAM | typeof countries.GUATEMALA | typeof countries.GUINEA | typeof countries.GUYANA | typeof countries.HAITI | typeof countries.HEARD_ISLAND_AND_MCDONALD_ISLANDS | typeof countries.VATICAN_CITY | typeof countries.HONDURAS | typeof countries.HUNGARY | typeof countries.ICELAND | typeof countries.INDIA | typeof countries.INDONESIA | typeof countries.IRAQ | typeof countries.IRELAND | typeof countries.ISRAEL | typeof countries.ITALY | typeof countries.COTE_DIVOIRE | typeof countries.JAMAICA | typeof countries.JAPAN | typeof countries.KAZAKHSTAN | typeof countries.JORDAN | typeof countries.KENYA | typeof countries.SOUTH_KOREA | typeof countries.KUWAIT | typeof countries.KYRGYZSTAN | typeof countries.LAOS | typeof countries.LEBANON | typeof countries.LESOTHO | typeof countries.LATVIA | typeof countries.LIBERIA | typeof countries.LIBYA | typeof countries.LIECHTENSTEIN | typeof countries.LITHUANIA | typeof countries.LUXEMBOURG | typeof countries.MADAGASCAR | typeof countries.MALAWI | typeof countries.MALAYSIA | typeof countries.MALDIVES | typeof countries.MALI | typeof countries.MALTA | typeof countries.MAURITANIA | typeof countries.MAURITIUS | typeof countries.MEXICO | typeof countries.MONACO | typeof countries.MONGOLIA | typeof countries.MOLDOVA | typeof countries.MONTENEGRO | typeof countries.MOROCCO | typeof countries.MOZAMBIQUE | typeof countries.OMAN | typeof countries.NAMIBIA | typeof countries.NAURU | typeof countries.NEPAL | typeof countries.NETHERLANDS | typeof countries.CURACAO | typeof countries.SINT_MAARTEN | typeof countries.CARIBBEAN_NETHERLANDS | typeof countries.NEW_CALEDONIA | typeof countries.VANUATU | typeof countries.NEW_ZEALAND | typeof countries.NICARAGUA | typeof countries.NIGER | typeof countries.NIGERIA | typeof countries.NIUE | typeof countries.NORFOLK_ISLAND | typeof countries.NORWAY | typeof countries.NORTHERN_MARIANA_ISLANDS | typeof countries.UNITED_STATES_MINOR_OUTLYING_ISLANDS | typeof countries.FEDERATED_STATES_OF_MICRONESIA | typeof countries.MARSHALL_ISLANDS | typeof countries.PALAU | typeof countries.PAKISTAN | typeof countries.PANAMA | typeof countries.PAPUA_NEW_GUINEA | typeof countries.PARAGUAY | typeof countries.PERU | typeof countries.PHILIPPINES | typeof countries.PITCAIRN_ISLANDS | typeof countries.POLAND | typeof countries.PORTUGAL | typeof countries.GUINEA_BISSAU | typeof countries.TIMOR_LESTE | typeof countries.QATAR | typeof countries.ROMANIA | typeof countries.RUSSIA | typeof countries.RWANDA | typeof countries.SAINT_HELENA__ASCENSION_AND_TRISTAN_DA_CUNHA | typeof countries.SAINT_KITTS_AND_NEVIS | typeof countries.SAINT_LUCIA | typeof countries.SAINT_PIERRE_AND_MIQUELON | typeof countries.SAINT_VINCENT_AND_THE_GRENADINES | typeof countries.SAN_MARINO | typeof countries.SAO_TOME_AND_PRINCIPE | typeof countries.SAUDI_ARABIA | typeof countries.SENEGAL | typeof countries.SERBIA | typeof countries.SEYCHELLES | typeof countries.SIERRA_LEONE | typeof countries.SINGAPORE | typeof countries.SLOVAKIA | typeof countries.VIETNAM | typeof countries.SLOVENIA | typeof countries.SOMALIA | typeof countries.SOUTH_AFRICA | typeof countries.ZIMBABWE | typeof countries.SPAIN | typeof countries.SUDAN | typeof countries.SURINAME | typeof countries.ESWATINI | typeof countries.SWEDEN | typeof countries.SWITZERLAND | typeof countries.TAJIKISTAN | typeof countries.THAILAND | typeof countries.TOGO | typeof countries.TOKELAU | typeof countries.TONGA | typeof countries.TRINIDAD_AND_TOBAGO | typeof countries.UNITED_ARAB_EMIRATES | typeof countries.TUNISIA | typeof countries.TURKEY | typeof countries.TURKMENISTAN | typeof countries.TUVALU | typeof countries.UGANDA | typeof countries.UKRAINE | typeof countries.NORTH_MACEDONIA | typeof countries.EGYPT | typeof countries.UNITED_KINGDOM | typeof countries.GUERNSEY | typeof countries.JERSEY | typeof countries.TANZANIA | typeof countries.UNITED_STATES | typeof countries.BURKINA_FASO | typeof countries.URUGUAY | typeof countries.UZBEKISTAN | typeof countries.VENEZUELA | typeof countries.WALLIS_AND_FUTUNA | typeof countries.SAMOA | typeof countries.YEMEN | typeof countries.ZAMBIA;
222
+ export default countries;
@@ -0,0 +1,223 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * As defined in:
5
+ * https://docs.google.com/spreadsheets/d/1T2ObmYoo6BNzrqYKb2ts75A6IKfnXmnndr2wujgNpak/edit#gid=2146701026
6
+ */
7
+ const countries = {
8
+ AFGHANISTAN: 2004,
9
+ ALBANIA: 2008,
10
+ ANTARCTICA: 2010,
11
+ ALGERIA: 2012,
12
+ AMERICAN_SAMOA: 2016,
13
+ ANDORRA: 2020,
14
+ ANGOLA: 2024,
15
+ ANTIGUA_AND_BARBUDA: 2028,
16
+ AZERBAIJAN: 2031,
17
+ ARGENTINA: 2032,
18
+ AUSTRALIA: 2036,
19
+ AUSTRIA: 2040,
20
+ THE_BAHAMAS: 2044,
21
+ BAHRAIN: 2048,
22
+ BANGLADESH: 2050,
23
+ ARMENIA: 2051,
24
+ BARBADOS: 2052,
25
+ BELGIUM: 2056,
26
+ BHUTAN: 2064,
27
+ BOLIVIA: 2068,
28
+ BOSNIA_AND_HERZEGOVINA: 2070,
29
+ BOTSWANA: 2072,
30
+ BRAZIL: 2076,
31
+ BELIZE: 2084,
32
+ SOLOMON_ISLANDS: 2090,
33
+ BRUNEI: 2096,
34
+ BULGARIA: 2100,
35
+ MYANMAR_BURMA: 2104,
36
+ BURUNDI: 2108,
37
+ BELARUS: 2112,
38
+ CAMBODIA: 2116,
39
+ CAMEROON: 2120,
40
+ CANADA: 2124,
41
+ CAPE_VERDE: 2132,
42
+ CENTRAL_AFRICAN_REPUBLIC: 2140,
43
+ SRI_LANKA: 2144,
44
+ CHAD: 2148,
45
+ CHILE: 2152,
46
+ CHINA: 2156,
47
+ CHRISTMAS_ISLAND: 2162,
48
+ COCOS_KEELING_ISLANDS: 2166,
49
+ COLOMBIA: 2170,
50
+ COMOROS: 2174,
51
+ REPUBLIC_OF_THE_CONGO: 2178,
52
+ DEMOCRATIC_REPUBLIC_OF_THE_CONGO: 2180,
53
+ COOK_ISLANDS: 2184,
54
+ COSTA_RICA: 2188,
55
+ CROATIA: 2191,
56
+ CYPRUS: 2196,
57
+ CZECHIA: 2203,
58
+ BENIN: 2204,
59
+ DENMARK: 2208,
60
+ DOMINICA: 2212,
61
+ DOMINICAN_REPUBLIC: 2214,
62
+ ECUADOR: 2218,
63
+ EL_SALVADOR: 2222,
64
+ EQUATORIAL_GUINEA: 2226,
65
+ ETHIOPIA: 2231,
66
+ ERITREA: 2232,
67
+ ESTONIA: 2233,
68
+ SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS: 2239,
69
+ FIJI: 2242,
70
+ FINLAND: 2246,
71
+ FRANCE: 2250,
72
+ FRENCH_POLYNESIA: 2258,
73
+ FRENCH_SOUTHERN_AND_ANTARCTIC_LANDS: 2260,
74
+ DJIBOUTI: 2262,
75
+ GABON: 2266,
76
+ GEORGIA: 2268,
77
+ THE_GAMBIA: 2270,
78
+ GERMANY: 2276,
79
+ GHANA: 2288,
80
+ KIRIBATI: 2296,
81
+ GREECE: 2300,
82
+ GRENADA: 2308,
83
+ GUAM: 2316,
84
+ GUATEMALA: 2320,
85
+ GUINEA: 2324,
86
+ GUYANA: 2328,
87
+ HAITI: 2332,
88
+ HEARD_ISLAND_AND_MCDONALD_ISLANDS: 2334,
89
+ VATICAN_CITY: 2336,
90
+ HONDURAS: 2340,
91
+ HUNGARY: 2348,
92
+ ICELAND: 2352,
93
+ INDIA: 2356,
94
+ INDONESIA: 2360,
95
+ IRAQ: 2368,
96
+ IRELAND: 2372,
97
+ ISRAEL: 2376,
98
+ ITALY: 2380,
99
+ COTE_DIVOIRE: 2384,
100
+ JAMAICA: 2388,
101
+ JAPAN: 2392,
102
+ KAZAKHSTAN: 2398,
103
+ JORDAN: 2400,
104
+ KENYA: 2404,
105
+ SOUTH_KOREA: 2410,
106
+ KUWAIT: 2414,
107
+ KYRGYZSTAN: 2417,
108
+ LAOS: 2418,
109
+ LEBANON: 2422,
110
+ LESOTHO: 2426,
111
+ LATVIA: 2428,
112
+ LIBERIA: 2430,
113
+ LIBYA: 2434,
114
+ LIECHTENSTEIN: 2438,
115
+ LITHUANIA: 2440,
116
+ LUXEMBOURG: 2442,
117
+ MADAGASCAR: 2450,
118
+ MALAWI: 2454,
119
+ MALAYSIA: 2458,
120
+ MALDIVES: 2462,
121
+ MALI: 2466,
122
+ MALTA: 2470,
123
+ MAURITANIA: 2478,
124
+ MAURITIUS: 2480,
125
+ MEXICO: 2484,
126
+ MONACO: 2492,
127
+ MONGOLIA: 2496,
128
+ MOLDOVA: 2498,
129
+ MONTENEGRO: 2499,
130
+ MOROCCO: 2504,
131
+ MOZAMBIQUE: 2508,
132
+ OMAN: 2512,
133
+ NAMIBIA: 2516,
134
+ NAURU: 2520,
135
+ NEPAL: 2524,
136
+ NETHERLANDS: 2528,
137
+ CURACAO: 2531,
138
+ SINT_MAARTEN: 2534,
139
+ CARIBBEAN_NETHERLANDS: 2535,
140
+ NEW_CALEDONIA: 2540,
141
+ VANUATU: 2548,
142
+ NEW_ZEALAND: 2554,
143
+ NICARAGUA: 2558,
144
+ NIGER: 2562,
145
+ NIGERIA: 2566,
146
+ NIUE: 2570,
147
+ NORFOLK_ISLAND: 2574,
148
+ NORWAY: 2578,
149
+ NORTHERN_MARIANA_ISLANDS: 2580,
150
+ UNITED_STATES_MINOR_OUTLYING_ISLANDS: 2581,
151
+ FEDERATED_STATES_OF_MICRONESIA: 2583,
152
+ MARSHALL_ISLANDS: 2584,
153
+ PALAU: 2585,
154
+ PAKISTAN: 2586,
155
+ PANAMA: 2591,
156
+ PAPUA_NEW_GUINEA: 2598,
157
+ PARAGUAY: 2600,
158
+ PERU: 2604,
159
+ PHILIPPINES: 2608,
160
+ PITCAIRN_ISLANDS: 2612,
161
+ POLAND: 2616,
162
+ PORTUGAL: 2620,
163
+ GUINEA_BISSAU: 2624,
164
+ TIMOR_LESTE: 2626,
165
+ QATAR: 2634,
166
+ ROMANIA: 2642,
167
+ RUSSIA: 2643,
168
+ RWANDA: 2646,
169
+ SAINT_HELENA__ASCENSION_AND_TRISTAN_DA_CUNHA: 2654,
170
+ SAINT_KITTS_AND_NEVIS: 2659,
171
+ SAINT_LUCIA: 2662,
172
+ SAINT_PIERRE_AND_MIQUELON: 2666,
173
+ SAINT_VINCENT_AND_THE_GRENADINES: 2670,
174
+ SAN_MARINO: 2674,
175
+ SAO_TOME_AND_PRINCIPE: 2678,
176
+ SAUDI_ARABIA: 2682,
177
+ SENEGAL: 2686,
178
+ SERBIA: 2688,
179
+ SEYCHELLES: 2690,
180
+ SIERRA_LEONE: 2694,
181
+ SINGAPORE: 2702,
182
+ SLOVAKIA: 2703,
183
+ VIETNAM: 2704,
184
+ SLOVENIA: 2705,
185
+ SOMALIA: 2706,
186
+ SOUTH_AFRICA: 2710,
187
+ ZIMBABWE: 2716,
188
+ SPAIN: 2724,
189
+ SUDAN: 2736,
190
+ SURINAME: 2740,
191
+ ESWATINI: 2748,
192
+ SWEDEN: 2752,
193
+ SWITZERLAND: 2756,
194
+ TAJIKISTAN: 2762,
195
+ THAILAND: 2764,
196
+ TOGO: 2768,
197
+ TOKELAU: 2772,
198
+ TONGA: 2776,
199
+ TRINIDAD_AND_TOBAGO: 2780,
200
+ UNITED_ARAB_EMIRATES: 2784,
201
+ TUNISIA: 2788,
202
+ TURKEY: 2792,
203
+ TURKMENISTAN: 2795,
204
+ TUVALU: 2798,
205
+ UGANDA: 2800,
206
+ UKRAINE: 2804,
207
+ NORTH_MACEDONIA: 2807,
208
+ EGYPT: 2818,
209
+ UNITED_KINGDOM: 2826,
210
+ GUERNSEY: 2831,
211
+ JERSEY: 2832,
212
+ TANZANIA: 2834,
213
+ UNITED_STATES: 2840,
214
+ BURKINA_FASO: 2854,
215
+ URUGUAY: 2858,
216
+ UZBEKISTAN: 2860,
217
+ VENEZUELA: 2862,
218
+ WALLIS_AND_FUTUNA: 2876,
219
+ SAMOA: 2882,
220
+ YEMEN: 2887,
221
+ ZAMBIA: 2894,
222
+ };
223
+ exports.default = countries;
@@ -0,0 +1,16 @@
1
+ declare const months: {
2
+ JANUARY: string;
3
+ FEBRUARY: string;
4
+ MARCH: string;
5
+ APRIL: string;
6
+ MAY: string;
7
+ JUNE: string;
8
+ JULY: string;
9
+ AUGUST: string;
10
+ SEPTEMBER: string;
11
+ OCTOBER: string;
12
+ NOVEMBER: string;
13
+ DECEMBER: string;
14
+ };
15
+ export declare type Month = typeof months.JANUARY | typeof months.FEBRUARY | typeof months.MARCH | typeof months.APRIL | typeof months.MAY | typeof months.JUNE | typeof months.JULY | typeof months.AUGUST | typeof months.SEPTEMBER | typeof months.OCTOBER | typeof months.NOVEMBER | typeof months.DECEMBER;
16
+ export default months;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const months = {
4
+ JANUARY: 'JANUARY',
5
+ FEBRUARY: 'FEBRUARY',
6
+ MARCH: 'MARCH',
7
+ APRIL: 'APRIL',
8
+ MAY: 'MAY',
9
+ JUNE: 'JUNE',
10
+ JULY: 'JULY',
11
+ AUGUST: 'AUGUST',
12
+ SEPTEMBER: 'SEPTEMBER',
13
+ OCTOBER: 'OCTOBER',
14
+ NOVEMBER: 'NOVEMBER',
15
+ DECEMBER: 'DECEMBER',
16
+ };
17
+ exports.default = months;
@@ -0,0 +1,6 @@
1
+ declare const networks: {
2
+ GOOGLE_SEARCH_ONLY: number;
3
+ GOOGLE_SEARCH_AND_PARTNERS: number;
4
+ };
5
+ export declare type Network = typeof networks.GOOGLE_SEARCH_ONLY | typeof networks.GOOGLE_SEARCH_AND_PARTNERS;
6
+ export default networks;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const networks = {
4
+ GOOGLE_SEARCH_ONLY: 2,
5
+ GOOGLE_SEARCH_AND_PARTNERS: 3,
6
+ };
7
+ exports.default = networks;
@@ -0,0 +1,19 @@
1
+ import { Country } from './countries';
2
+ import { Month } from './months';
3
+ import { Network } from './networks';
4
+ export declare type Request = {
5
+ customerId: string;
6
+ geoTargetConstants?: Country[];
7
+ historicalMetricsOptions?: {
8
+ start_month: Month;
9
+ start_year: number;
10
+ end_month: Month;
11
+ end_year: number;
12
+ };
13
+ includeAdultKeywords?: boolean;
14
+ keywordPlanNetwork?: Network;
15
+ keywords: string[];
16
+ language?: null;
17
+ };
18
+ declare const request: Request;
19
+ export default request;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const networks_1 = __importDefault(require("./networks"));
7
+ const request = {
8
+ customerId: '',
9
+ geoTargetConstants: [],
10
+ historicalMetricsOptions: null,
11
+ includeAdultKeywords: false,
12
+ keywordPlanNetwork: networks_1.default.GOOGLE_SEARCH_ONLY,
13
+ keywords: [],
14
+ language: null,
15
+ };
16
+ exports.default = request;
@@ -0,0 +1,25 @@
1
+ import { State } from '../../api/states';
2
+ declare type Month = {
3
+ date: string;
4
+ month: number;
5
+ searchVolume: number;
6
+ year: number;
7
+ };
8
+ declare type Keyword = {
9
+ keyword: string;
10
+ avgCpc: number;
11
+ avgSearchVolume: number;
12
+ competition: number;
13
+ competitionIndex: number;
14
+ months: Month[];
15
+ monthsAll: number;
16
+ topOfPageBidHigh: number;
17
+ topOfPageBidLow: number;
18
+ totalSearchVolume: number;
19
+ };
20
+ export declare type Response = {
21
+ body: Keyword[];
22
+ error: null | string;
23
+ state: State;
24
+ };
25
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/initClients.d.ts CHANGED
@@ -33,5 +33,5 @@ declare type InitClients = {
33
33
  /**
34
34
  * Function to simplify initialising the clients.
35
35
  */
36
- declare const initClients: ({ athenaExpress, awsConfig, awsGlue, awsS3, awsSes, awsSsm, deepCrawl, googleAds, googleConfig, googleBigQuery, googleSheets, googleStorage, prisma, }: InitClients) => Promise<void>;
36
+ declare const initClients: ({ athenaExpress, awsConfig, awsGlue, awsLambda, awsS3, awsSes, awsSsm, deepCrawl, googleAds, googleConfig, googleBigQuery, googleSheets, googleStorage, prisma, }: InitClients) => Promise<void>;
37
37
  export default initClients;
package/initClients.js CHANGED
@@ -5,20 +5,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const initClient_1 = __importDefault(require("./aws/athenaExpress/initClient"));
7
7
  const initClient_2 = __importDefault(require("./aws/glue/initClient"));
8
- const initClient_3 = __importDefault(require("./aws/s3/initClient"));
9
- const initClient_4 = __importDefault(require("./aws/ses/initClient"));
8
+ const initClient_3 = __importDefault(require("./aws/lambda/initClient"));
9
+ const initClient_4 = __importDefault(require("./aws/s3/initClient"));
10
+ const initClient_5 = __importDefault(require("./aws/ses/initClient"));
10
11
  const getParameter_1 = __importDefault(require("./aws/ssm/getParameter"));
11
- const initClient_5 = __importDefault(require("./aws/ssm/initClient"));
12
- const initClient_6 = __importDefault(require("./deepCrawl/initClient"));
13
- const initClient_7 = __importDefault(require("./google/bigQuery/initClient"));
14
- const initClient_8 = __importDefault(require("./google/sheets/initClient"));
15
- const initClient_9 = __importDefault(require("./google/storage/initClient"));
16
- const initClient_10 = __importDefault(require("./googleAds/initClient"));
17
- const initClient_11 = __importDefault(require("./prisma/initClient"));
12
+ const initClient_6 = __importDefault(require("./aws/ssm/initClient"));
13
+ const initClient_7 = __importDefault(require("./deepCrawl/initClient"));
14
+ const initClient_8 = __importDefault(require("./google/bigQuery/initClient"));
15
+ const initClient_9 = __importDefault(require("./google/sheets/initClient"));
16
+ const initClient_10 = __importDefault(require("./google/storage/initClient"));
17
+ const initClient_11 = __importDefault(require("./googleAds/initClient"));
18
+ const initClient_12 = __importDefault(require("./prisma/initClient"));
18
19
  /**
19
20
  * Function to simplify initialising the clients.
20
21
  */
21
- const initClients = async ({ athenaExpress, awsConfig, awsGlue, awsS3, awsSes, awsSsm, deepCrawl, googleAds, googleConfig, googleBigQuery, googleSheets, googleStorage, prisma, }) => {
22
+ const initClients = async ({ athenaExpress, awsConfig, awsGlue, awsLambda, awsS3, awsSes, awsSsm, deepCrawl, googleAds, googleConfig, googleBigQuery, googleSheets, googleStorage, prisma, }) => {
22
23
  if (athenaExpress) {
23
24
  (0, initClient_1.default)({
24
25
  config: awsConfig,
@@ -32,27 +33,32 @@ const initClients = async ({ athenaExpress, awsConfig, awsGlue, awsS3, awsSes, a
32
33
  config: awsConfig,
33
34
  });
34
35
  }
35
- if (awsS3) {
36
+ if (awsLambda) {
36
37
  (0, initClient_3.default)({
37
38
  config: awsConfig,
38
39
  });
39
40
  }
40
- if (awsSes) {
41
+ if (awsS3) {
41
42
  (0, initClient_4.default)({
42
43
  config: awsConfig,
43
44
  });
44
45
  }
45
- if (awsSsm || deepCrawl || googleAds || googleConfig) {
46
+ if (awsSes) {
46
47
  (0, initClient_5.default)({
47
48
  config: awsConfig,
48
49
  });
49
50
  }
51
+ if (awsSsm || deepCrawl || googleAds || googleConfig) {
52
+ (0, initClient_6.default)({
53
+ config: awsConfig,
54
+ });
55
+ }
50
56
  // Deepcrawl authentication using SSM Parameter
51
57
  if (deepCrawl) {
52
58
  const deepcrawlParameter = await (0, getParameter_1.default)({
53
59
  name: deepCrawl.parameterName,
54
60
  });
55
- await (0, initClient_6.default)({ auth: deepcrawlParameter });
61
+ await (0, initClient_7.default)({ auth: deepcrawlParameter });
56
62
  }
57
63
  // Google authentication using SSM
58
64
  if (googleConfig) {
@@ -62,20 +68,20 @@ const initClients = async ({ athenaExpress, awsConfig, awsGlue, awsS3, awsSes, a
62
68
  });
63
69
  // BigQuery
64
70
  if (googleBigQuery && googleConfig.projectId) {
65
- (0, initClient_7.default)({
71
+ (0, initClient_8.default)({
66
72
  parameter: googleParameter,
67
73
  projectId: googleConfig.projectId,
68
74
  });
69
75
  }
70
76
  // Google Sheets
71
77
  if (googleSheets) {
72
- (0, initClient_8.default)({
78
+ (0, initClient_9.default)({
73
79
  parameter: googleParameter,
74
80
  });
75
81
  }
76
82
  // Google Storage
77
83
  if (googleStorage && googleConfig.projectId) {
78
- (0, initClient_9.default)({
84
+ (0, initClient_10.default)({
79
85
  parameter: googleParameter,
80
86
  projectId: googleConfig.projectId,
81
87
  });
@@ -86,13 +92,13 @@ const initClients = async ({ athenaExpress, awsConfig, awsGlue, awsS3, awsSes, a
86
92
  const googleAdsParameter = await (0, getParameter_1.default)({
87
93
  name: googleAds.parameterName,
88
94
  });
89
- await (0, initClient_10.default)({
95
+ await (0, initClient_11.default)({
90
96
  parameter: googleAdsParameter,
91
97
  });
92
98
  }
93
99
  // Initialise Prisma
94
100
  if (prisma) {
95
- (0, initClient_11.default)({
101
+ (0, initClient_12.default)({
96
102
  debug: prisma ? false : prisma.debug || false,
97
103
  });
98
104
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@8ms/helpers",
3
3
  "license": "UNLICENSED",
4
- "version": "1.1.79",
4
+ "version": "1.1.82",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/8millionstories-organisation/8ms-helpers-ts.git"