@adobe/spacecat-shared-data-access 1.61.18 → 2.0.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.
- package/CHANGELOG.md +19 -0
- package/package.json +1 -2
- package/src/index.d.ts +4 -934
- package/src/index.js +1 -91
- package/src/{v2/models → models}/base/base.model.js +16 -3
- package/src/{v2 → models}/index.d.ts +14 -3
- package/src/{v2/models → models}/organization/organization.schema.js +1 -1
- package/src/{v2/models → models}/site/site.schema.js +1 -1
- package/src/service/index.d.ts +20 -0
- package/src/service/index.js +6 -46
- package/src/dto/api-key.js +0 -58
- package/src/dto/audit.js +0 -80
- package/src/dto/configuration.js +0 -49
- package/src/dto/dto-utils.js +0 -30
- package/src/dto/experiment.js +0 -66
- package/src/dto/import-job.js +0 -76
- package/src/dto/import-url.js +0 -55
- package/src/dto/key-event.js +0 -52
- package/src/dto/organization.js +0 -54
- package/src/dto/site-candidate.js +0 -54
- package/src/dto/site-top-page.js +0 -52
- package/src/dto/site.js +0 -62
- package/src/models/api-key/api-key.js +0 -182
- package/src/models/audit.js +0 -146
- package/src/models/base.js +0 -42
- package/src/models/configuration.js +0 -194
- package/src/models/experiment.js +0 -67
- package/src/models/importer/import-constants.js +0 -40
- package/src/models/importer/import-job.js +0 -252
- package/src/models/importer/import-url.js +0 -115
- package/src/models/key-event.js +0 -81
- package/src/models/organization.js +0 -120
- package/src/models/site-candidate.js +0 -111
- package/src/models/site-top-page.js +0 -62
- package/src/models/site.js +0 -218
- package/src/service/api-key/accessPatterns.js +0 -110
- package/src/service/api-key/index.js +0 -37
- package/src/service/audits/accessPatterns.js +0 -284
- package/src/service/audits/index.js +0 -72
- package/src/service/configurations/accessPatterns.js +0 -123
- package/src/service/configurations/index.js +0 -38
- package/src/service/experiments/accessPatterns.js +0 -98
- package/src/service/experiments/index.js +0 -40
- package/src/service/import-job/accessPatterns.js +0 -134
- package/src/service/import-job/index.js +0 -60
- package/src/service/import-url/accessPatterns.js +0 -153
- package/src/service/import-url/index.js +0 -53
- package/src/service/key-events/accessPatterns.js +0 -92
- package/src/service/key-events/index.js +0 -38
- package/src/service/organizations/accessPatterns.js +0 -160
- package/src/service/organizations/index.js +0 -51
- package/src/service/site-candidates/accessPatterns.js +0 -112
- package/src/service/site-candidates/index.js +0 -48
- package/src/service/site-top-pages/accessPatterns.js +0 -83
- package/src/service/site-top-pages/index.js +0 -42
- package/src/service/sites/accessPatterns.js +0 -467
- package/src/service/sites/index.js +0 -116
- package/src/v2/index.js +0 -15
- package/src/v2/models/index.d.ts +0 -26
- /package/src/{v2/errors → errors}/data-access.error.js +0 -0
- /package/src/{v2/errors → errors}/index.d.ts +0 -0
- /package/src/{v2/errors → errors}/index.js +0 -0
- /package/src/{v2/errors → errors}/reference.error.js +0 -0
- /package/src/{v2/errors → errors}/schema-validation.error.js +0 -0
- /package/src/{v2/errors → errors}/schema.builder.error.js +0 -0
- /package/src/{v2/errors → errors}/schema.error.js +0 -0
- /package/src/{v2/errors → errors}/validation.error.js +0 -0
- /package/src/{v2/models → models}/api-key/api-key.collection.js +0 -0
- /package/src/{v2/models → models}/api-key/api-key.model.js +0 -0
- /package/src/{v2/models → models}/api-key/api-key.schema.js +0 -0
- /package/src/{v2/models → models}/api-key/index.d.ts +0 -0
- /package/src/{v2/models → models}/api-key/index.js +0 -0
- /package/src/{v2/models → models}/audit/audit.collection.js +0 -0
- /package/src/{v2/models → models}/audit/audit.model.js +0 -0
- /package/src/{v2/models → models}/audit/audit.schema.js +0 -0
- /package/src/{v2/models → models}/audit/index.d.ts +0 -0
- /package/src/{v2/models → models}/audit/index.js +0 -0
- /package/src/{v2/models → models}/base/base.collection.js +0 -0
- /package/src/{v2/models → models}/base/entity.registry.js +0 -0
- /package/src/{v2/models → models}/base/index.d.ts +0 -0
- /package/src/{v2/models → models}/base/index.js +0 -0
- /package/src/{v2/models → models}/base/reference.js +0 -0
- /package/src/{v2/models → models}/base/schema.builder.js +0 -0
- /package/src/{v2/models → models}/base/schema.js +0 -0
- /package/src/{v2/models → models}/configuration/configuration.collection.js +0 -0
- /package/src/{v2/models → models}/configuration/configuration.model.js +0 -0
- /package/src/{v2/models → models}/configuration/configuration.schema.js +0 -0
- /package/src/{v2/models → models}/configuration/index.d.ts +0 -0
- /package/src/{v2/models → models}/configuration/index.js +0 -0
- /package/src/{v2/models → models}/experiment/experiment.collection.js +0 -0
- /package/src/{v2/models → models}/experiment/experiment.model.js +0 -0
- /package/src/{v2/models → models}/experiment/experiment.schema.js +0 -0
- /package/src/{v2/models → models}/experiment/index.d.ts +0 -0
- /package/src/{v2/models → models}/experiment/index.js +0 -0
- /package/src/{v2/models → models}/import-job/import-job.collection.js +0 -0
- /package/src/{v2/models → models}/import-job/import-job.model.js +0 -0
- /package/src/{v2/models → models}/import-job/import-job.schema.js +0 -0
- /package/src/{v2/models → models}/import-job/index.d.ts +0 -0
- /package/src/{v2/models → models}/import-job/index.js +0 -0
- /package/src/{v2/models → models}/import-url/import-url.collection.js +0 -0
- /package/src/{v2/models → models}/import-url/import-url.model.js +0 -0
- /package/src/{v2/models → models}/import-url/import-url.schema.js +0 -0
- /package/src/{v2/models → models}/import-url/index.d.ts +0 -0
- /package/src/{v2/models → models}/import-url/index.js +0 -0
- /package/src/{v2/models → models}/index.js +0 -0
- /package/src/{v2/models → models}/key-event/index.d.ts +0 -0
- /package/src/{v2/models → models}/key-event/index.js +0 -0
- /package/src/{v2/models → models}/key-event/key-event.collection.js +0 -0
- /package/src/{v2/models → models}/key-event/key-event.model.js +0 -0
- /package/src/{v2/models → models}/key-event/key-event.schema.js +0 -0
- /package/src/{v2/models → models}/latest-audit/index.d.ts +0 -0
- /package/src/{v2/models → models}/latest-audit/index.js +0 -0
- /package/src/{v2/models → models}/latest-audit/latest-audit.collection.js +0 -0
- /package/src/{v2/models → models}/latest-audit/latest-audit.model.js +0 -0
- /package/src/{v2/models → models}/latest-audit/latest-audit.schema.js +0 -0
- /package/src/{v2/models → models}/opportunity/index.d.ts +0 -0
- /package/src/{v2/models → models}/opportunity/index.js +0 -0
- /package/src/{v2/models → models}/opportunity/opportunity.collection.js +0 -0
- /package/src/{v2/models → models}/opportunity/opportunity.model.js +0 -0
- /package/src/{v2/models → models}/opportunity/opportunity.schema.js +0 -0
- /package/src/{v2/models → models}/organization/index.d.ts +0 -0
- /package/src/{v2/models → models}/organization/index.js +0 -0
- /package/src/{v2/models → models}/organization/organization.collection.js +0 -0
- /package/src/{v2/models → models}/organization/organization.model.js +0 -0
- /package/src/{v2/models → models}/site/index.d.ts +0 -0
- /package/src/{v2/models → models}/site/index.js +0 -0
- /package/src/{v2/models → models}/site/site.collection.js +0 -0
- /package/src/{v2/models → models}/site/site.model.js +0 -0
- /package/src/{v2/models → models}/site-candidate/index.d.ts +0 -0
- /package/src/{v2/models → models}/site-candidate/index.js +0 -0
- /package/src/{v2/models → models}/site-candidate/site-candidate.collection.js +0 -0
- /package/src/{v2/models → models}/site-candidate/site-candidate.model.js +0 -0
- /package/src/{v2/models → models}/site-candidate/site-candidate.schema.js +0 -0
- /package/src/{v2/models → models}/site-top-page/index.d.ts +0 -0
- /package/src/{v2/models → models}/site-top-page/index.js +0 -0
- /package/src/{v2/models → models}/site-top-page/site-top-page.collection.js +0 -0
- /package/src/{v2/models → models}/site-top-page/site-top-page.model.js +0 -0
- /package/src/{v2/models → models}/site-top-page/site-top-page.schema.js +0 -0
- /package/src/{v2/models → models}/suggestion/index.d.ts +0 -0
- /package/src/{v2/models → models}/suggestion/index.js +0 -0
- /package/src/{v2/models → models}/suggestion/suggestion.collection.js +0 -0
- /package/src/{v2/models → models}/suggestion/suggestion.model.js +0 -0
- /package/src/{v2/models → models}/suggestion/suggestion.schema.js +0 -0
- /package/src/{v2/readme.md → readme.md} +0 -0
- /package/src/{v2/util → util}/accessor.utils.js +0 -0
- /package/src/{v2/util → util}/guards.d.ts +0 -0
- /package/src/{v2/util → util}/guards.js +0 -0
- /package/src/{v2/util → util}/index.d.ts +0 -0
- /package/src/{v2/util → util}/index.js +0 -0
- /package/src/{v2/util → util}/patcher.js +0 -0
- /package/src/{v2/util → util}/util.js +0 -0
package/src/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2024 Adobe. All rights reserved.
|
|
3
3
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
5
5
|
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -10,936 +10,6 @@
|
|
|
10
10
|
* governing permissions and limitations under the License.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
readonly COMPLETE: 'COMPLETE';
|
|
17
|
-
readonly FAILED: 'FAILED';
|
|
18
|
-
readonly STOPPED: 'STOPPED';
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
// packages/spacecat-shared-data-access/src/models/importer/import-constants.js
|
|
22
|
-
export declare const ImportUrlStatus: {
|
|
23
|
-
readonly PENDING: 'PENDING';
|
|
24
|
-
readonly REDIRECT: 'REDIRECT';
|
|
25
|
-
readonly RUNNING: 'RUNNING';
|
|
26
|
-
readonly COMPLETE: 'COMPLETE';
|
|
27
|
-
readonly FAILED: 'FAILED';
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
// TODO: introduce AuditType interface or Scores interface
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Represents an individual audit of a site.
|
|
34
|
-
*/
|
|
35
|
-
export interface Audit {
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Retrieves the ID of the audit.
|
|
39
|
-
* @returns {string} The audit ID.
|
|
40
|
-
*/
|
|
41
|
-
getId: () => string;
|
|
42
|
-
/**
|
|
43
|
-
* Retrieves the site ID associated with this audit.
|
|
44
|
-
* @returns {string} The site ID.
|
|
45
|
-
*/
|
|
46
|
-
getSiteId: () => string;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Retrieves the timestamp when the audit was performed.
|
|
50
|
-
* @returns {string} The audit timestamp.
|
|
51
|
-
*/
|
|
52
|
-
getAuditedAt: () => string;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Retrieves the result of the audit.
|
|
56
|
-
* @returns {object} The audit result.
|
|
57
|
-
*/
|
|
58
|
-
getAuditResult: () => object;
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Retrieves the result of the previous audit.
|
|
62
|
-
* This serves for comparison purposes.
|
|
63
|
-
* @returns {object|null} The parsed audit result.
|
|
64
|
-
*/
|
|
65
|
-
getPreviousAuditResult: () => object | null;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* Sets the result of the previous audit.
|
|
69
|
-
* @param {object} result The parsed audit result.
|
|
70
|
-
*/
|
|
71
|
-
setPreviousAuditResult: (result: object) => void;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Retrieves the type of the audit.
|
|
75
|
-
* @returns {object} The audit type.
|
|
76
|
-
*/
|
|
77
|
-
getAuditType: () => object;
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Retrieves the expiration date of the audit.
|
|
81
|
-
* @returns {Date} The expiration date.
|
|
82
|
-
*/
|
|
83
|
-
getExpiresAt: () => Date;
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Retrieves a reference to the full audit.
|
|
87
|
-
* @returns {string} The full audit reference.
|
|
88
|
-
*/
|
|
89
|
-
getFullAuditRef: () => string;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Indicates whether the audit is live.
|
|
93
|
-
* @returns {boolean} True if the audit is live, false otherwise.
|
|
94
|
-
*/
|
|
95
|
-
isLive: () => boolean;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Indicates whether there was an error in the audit.
|
|
99
|
-
* @returns {boolean} True if there was an error, false otherwise.
|
|
100
|
-
*/
|
|
101
|
-
isError: () => boolean;
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Retrieves the scores from the audit.
|
|
105
|
-
* @returns {object} The audit scores.
|
|
106
|
-
*/
|
|
107
|
-
getScores: () => object;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
111
|
-
export interface Config {
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export interface FulfillableItems {
|
|
116
|
-
items: string[];
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Represents a key event.
|
|
121
|
-
*/
|
|
122
|
-
export interface KeyEvent {
|
|
123
|
-
/**
|
|
124
|
-
* Retrieves the ID of the key event.
|
|
125
|
-
* @returns {string} The Key Event ID.
|
|
126
|
-
*/
|
|
127
|
-
getId: () => string;
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Retrieves the site id of the key event.
|
|
131
|
-
* @returns {string} site id
|
|
132
|
-
*/
|
|
133
|
-
getSiteId: () => string;
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Retrieves the name of the key event.
|
|
137
|
-
* @returns {string} The name
|
|
138
|
-
*/
|
|
139
|
-
getName: () => string;
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Retrieves the type of the key event.
|
|
143
|
-
* @returns {string} The type
|
|
144
|
-
*/
|
|
145
|
-
getType: () => string;
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Retrieves the time of the key event.
|
|
149
|
-
* @returns {string} The time
|
|
150
|
-
*/
|
|
151
|
-
getTime: () => string;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* Retrieves the creation timestamp of the key event.
|
|
155
|
-
* @returns {string} The creation timestamp.
|
|
156
|
-
*/
|
|
157
|
-
getCreatedAt: () => string;
|
|
158
|
-
|
|
159
|
-
/**
|
|
160
|
-
* Retrieves the last update timestamp of the key event.
|
|
161
|
-
* @returns {string} The last update timestamp.
|
|
162
|
-
*/
|
|
163
|
-
getUpdatedAt: () => string;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Represents a site with associated audit and configuration data.
|
|
168
|
-
*/
|
|
169
|
-
export interface Site {
|
|
170
|
-
/**
|
|
171
|
-
* Retrieves the ID of the site.
|
|
172
|
-
* @returns {string} The site ID.
|
|
173
|
-
*/
|
|
174
|
-
getId: () => string;
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* Retrieves the base URL of the site.
|
|
178
|
-
* @returns {string} The base URL.
|
|
179
|
-
*/
|
|
180
|
-
getBaseURL: () => string;
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Retrieves the delivery type of the site.
|
|
184
|
-
* @returns {string} The delivery type.
|
|
185
|
-
*/
|
|
186
|
-
getDeliveryType: () => string;
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* Retrieves the GitHub URL associated with the site.
|
|
190
|
-
* @returns {string} The GitHub URL.
|
|
191
|
-
*/
|
|
192
|
-
getGitHubURL: () => string;
|
|
193
|
-
|
|
194
|
-
/**
|
|
195
|
-
* Retrieves the Organization ID associated with the site.
|
|
196
|
-
* @returns {string} The Org ID.
|
|
197
|
-
*/
|
|
198
|
-
getOrganizationId: () => string;
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Retrieves the creation timestamp of the site.
|
|
202
|
-
* @returns {string} The creation timestamp.
|
|
203
|
-
*/
|
|
204
|
-
getCreatedAt: () => string;
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Retrieves the last update timestamp of the site.
|
|
208
|
-
* @returns {string} The last update timestamp.
|
|
209
|
-
*/
|
|
210
|
-
getUpdatedAt: () => string;
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Retrieves the current configuration for the site.
|
|
214
|
-
* @returns {Config} The current configuration.
|
|
215
|
-
*/
|
|
216
|
-
getConfig: () => Config;
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Retrieves the audits associated with the site.
|
|
220
|
-
* @returns {Audit[]} The list of audits.
|
|
221
|
-
*/
|
|
222
|
-
getAudits: () => Audit[];
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* Indicates whether the site is live.
|
|
226
|
-
* @returns {boolean} True if the site is live, false otherwise.
|
|
227
|
-
*/
|
|
228
|
-
isLive: () => boolean;
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* The timestamp when the site was last toggled to live or non-live.
|
|
232
|
-
* @returns {string} The timestamp when the site was last toggled to live or non-live.
|
|
233
|
-
*/
|
|
234
|
-
getIsLiveToggledAt: () => string;
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
* Updates the list of audits for the site.
|
|
238
|
-
* @param {Audit[]} audits The new list of audits.
|
|
239
|
-
* @returns {Site} The updated site instance.
|
|
240
|
-
*/
|
|
241
|
-
setAudits: (audits: Audit[]) => Site;
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Toggles the live status of the site.
|
|
245
|
-
* @returns {Site} The updated site instance with the toggled live status.
|
|
246
|
-
*/
|
|
247
|
-
toggleLive: () => Site;
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Updates the GitHub URL of the site.
|
|
251
|
-
* @param {string} gitHubURL The new GitHub URL.
|
|
252
|
-
* @returns {Site} The updated site instance.
|
|
253
|
-
*/
|
|
254
|
-
updateGitHubURL: (gitHubURL: string) => Site;
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Updates the IMS Org ID of the site.
|
|
258
|
-
* @param {string} organizationId The new Org ID.
|
|
259
|
-
* @returns {Site} The updated site instance.
|
|
260
|
-
*/
|
|
261
|
-
updateOrganizationId: (organizationId: string) => Site;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
/**
|
|
265
|
-
* Represents a site candidate.
|
|
266
|
-
*/
|
|
267
|
-
export interface SiteCandidate {
|
|
268
|
-
/**
|
|
269
|
-
* Retrieves the base URL of the site candidate.
|
|
270
|
-
* @returns {string} The base URL.
|
|
271
|
-
*/
|
|
272
|
-
getBaseURL: () => string;
|
|
273
|
-
|
|
274
|
-
/**
|
|
275
|
-
* Retrieves the site id of the site candidate.
|
|
276
|
-
* Only set after APPROVED state
|
|
277
|
-
* @returns {string} site id
|
|
278
|
-
*/
|
|
279
|
-
getSiteId: () => string;
|
|
280
|
-
|
|
281
|
-
/**
|
|
282
|
-
* Retrieves the source of the site candidate.
|
|
283
|
-
* @returns {string} The source
|
|
284
|
-
*/
|
|
285
|
-
getSource: () => string;
|
|
286
|
-
|
|
287
|
-
/**
|
|
288
|
-
* Retrieves the status of the site candidate.
|
|
289
|
-
* @returns {string} The status
|
|
290
|
-
*/
|
|
291
|
-
getStatus: () => string;
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Retrieves the creation timestamp of the site candidate.
|
|
295
|
-
* @returns {string} The creation timestamp.
|
|
296
|
-
*/
|
|
297
|
-
getCreatedAt: () => string;
|
|
298
|
-
|
|
299
|
-
/**
|
|
300
|
-
* Retrieves the last update timestamp of the site candidate.
|
|
301
|
-
* @returns {string} The last update timestamp.
|
|
302
|
-
*/
|
|
303
|
-
getUpdatedAt: () => string;
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Retrieves the slack id of the person who last updated the site candidate.
|
|
307
|
-
* @returns {string} The last update timestamp.
|
|
308
|
-
*/
|
|
309
|
-
getUpdatedBy: () => string;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
export interface SiteTopPage {
|
|
313
|
-
/**
|
|
314
|
-
* Retrieves the site ID of the site top page.
|
|
315
|
-
* @returns {string} The site ID.
|
|
316
|
-
*/
|
|
317
|
-
getSiteId: () => string;
|
|
318
|
-
|
|
319
|
-
/**
|
|
320
|
-
* Retrieves the URL of the site top page.
|
|
321
|
-
* @returns {string} The URL.
|
|
322
|
-
*/
|
|
323
|
-
getURL: () => string;
|
|
324
|
-
|
|
325
|
-
/**
|
|
326
|
-
* Retrieves the traffic of the site top page.
|
|
327
|
-
* @returns {number} The traffic.
|
|
328
|
-
*/
|
|
329
|
-
getTraffic: () => number;
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Retrieves the keyword that brings the most organic traffic to the page.
|
|
333
|
-
* @returns {string} The keyword.
|
|
334
|
-
*/
|
|
335
|
-
getTopKeyword: () => string;
|
|
336
|
-
|
|
337
|
-
/**
|
|
338
|
-
* Retrieves the source of the site top page.
|
|
339
|
-
* @returns {string} The source.
|
|
340
|
-
*/
|
|
341
|
-
getSource: () => string;
|
|
342
|
-
|
|
343
|
-
/**
|
|
344
|
-
* Retrieves the geo of the site top page.
|
|
345
|
-
* @returns {string} The geo.
|
|
346
|
-
*/
|
|
347
|
-
getGeo: () => string;
|
|
348
|
-
|
|
349
|
-
/**
|
|
350
|
-
* Retrieves the timestamp when the import was performed.
|
|
351
|
-
* @returns {string} The import timestamp.
|
|
352
|
-
*/
|
|
353
|
-
getImportedAt: () => string;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
export interface Organization {
|
|
357
|
-
/**
|
|
358
|
-
* Retrieves the ID of the site.
|
|
359
|
-
* @returns {string} The site ID.
|
|
360
|
-
*/
|
|
361
|
-
getId: () => string;
|
|
362
|
-
|
|
363
|
-
/**
|
|
364
|
-
* Retrieves the base URL of the site.
|
|
365
|
-
* @returns {string} The base URL.
|
|
366
|
-
*/
|
|
367
|
-
getName: () => string;
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Retrieves the IMS Organization ID associated with the site.
|
|
371
|
-
* @returns {string} The IMS Org ID.
|
|
372
|
-
*/
|
|
373
|
-
getImsOrgId: () => string;
|
|
374
|
-
|
|
375
|
-
/**
|
|
376
|
-
* Retrieves the creation timestamp of the site.
|
|
377
|
-
* @returns {string} The creation timestamp.
|
|
378
|
-
*/
|
|
379
|
-
getCreatedAt: () => string;
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Retrieves the last update timestamp of the site.
|
|
383
|
-
* @returns {string} The last update timestamp.
|
|
384
|
-
*/
|
|
385
|
-
getUpdatedAt: () => string;
|
|
386
|
-
|
|
387
|
-
/**
|
|
388
|
-
* Retrieves the current audit configuration for the site.
|
|
389
|
-
* @returns {Config} The current audit configuration.
|
|
390
|
-
*/
|
|
391
|
-
getConfig: () => Config;
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* Retrieves the fulfillable items object for the org.
|
|
395
|
-
* @returns {FulfillableItems} The current fulfillable items object.
|
|
396
|
-
*/
|
|
397
|
-
getFulfillableItems: () => FulfillableItems;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
export interface Configuration {
|
|
401
|
-
/**
|
|
402
|
-
* Retrieves the configuration version.
|
|
403
|
-
* @returns {number} The configuration version.
|
|
404
|
-
*/
|
|
405
|
-
getVersion: () => number;
|
|
406
|
-
|
|
407
|
-
/**
|
|
408
|
-
* Retrieves the queues configuration.
|
|
409
|
-
* @returns {object} The queues configuration.
|
|
410
|
-
*/
|
|
411
|
-
getQueues: () => object;
|
|
412
|
-
|
|
413
|
-
/**
|
|
414
|
-
* Retrieves the jobs configuration.
|
|
415
|
-
* @returns {Array} The jobs configurations.
|
|
416
|
-
*/
|
|
417
|
-
getJobs: () => Array<object>;
|
|
418
|
-
|
|
419
|
-
/**
|
|
420
|
-
* Retrieves the handlers configuration.
|
|
421
|
-
* @returns {object} The handlers configuration.
|
|
422
|
-
*/
|
|
423
|
-
getHandlers: () => object;
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Retrieves the handler configuration for handler type.
|
|
427
|
-
* @returns {object} The handler type configuration.
|
|
428
|
-
*/
|
|
429
|
-
getHandler: (type) => object;
|
|
430
|
-
|
|
431
|
-
/**
|
|
432
|
-
* Retrieves the slack roles configuration.
|
|
433
|
-
* @returns {object} The slack roles configuration.
|
|
434
|
-
*/
|
|
435
|
-
getSlackRoles: () => object;
|
|
436
|
-
|
|
437
|
-
/**
|
|
438
|
-
* Return true if a handler type is enabled for an organization.
|
|
439
|
-
* @param type handler type
|
|
440
|
-
* @param org organization
|
|
441
|
-
*/
|
|
442
|
-
isHandlerEnabledForOrg: (type: string, org: Organization) => boolean;
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* Return true if a handler type is enabled for a site.
|
|
446
|
-
* @param type handler type
|
|
447
|
-
* @param site site
|
|
448
|
-
*/
|
|
449
|
-
isHandlerEnabledForSite: (type: string, site: Site) => boolean;
|
|
450
|
-
|
|
451
|
-
/**
|
|
452
|
-
* Enables a handler type for an site.
|
|
453
|
-
* @param type handler type
|
|
454
|
-
* @param site site
|
|
455
|
-
*/
|
|
456
|
-
enableHandlerForSite: (type: string, site: Site) => void;
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* Enables a handler type for an organization.
|
|
460
|
-
* @param type handler type
|
|
461
|
-
* @param org organization
|
|
462
|
-
*/
|
|
463
|
-
enableHandlerForOrg: (type: string, org: Organization) => void;
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* Disables a handler type for an site.
|
|
467
|
-
* @param type handler type
|
|
468
|
-
* @param site site
|
|
469
|
-
*/
|
|
470
|
-
disableHandlerForSite: (type: string, site: Site) => void;
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Disables a handler type for an organization.
|
|
474
|
-
* @param type handler type
|
|
475
|
-
* @param org organization
|
|
476
|
-
*/
|
|
477
|
-
disableHandlerForOrg: (type:string, org: Organization) => void;
|
|
478
|
-
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
export interface ImportJob {
|
|
482
|
-
/**
|
|
483
|
-
* Retrieves the ID of the import job.
|
|
484
|
-
*/
|
|
485
|
-
getId: () => string;
|
|
486
|
-
|
|
487
|
-
/**
|
|
488
|
-
* Retrieves the hashed apiKey of the import job.
|
|
489
|
-
*/
|
|
490
|
-
getHashedApiKey: () => string;
|
|
491
|
-
|
|
492
|
-
/**
|
|
493
|
-
* Retrieves the status of the import job.
|
|
494
|
-
*/
|
|
495
|
-
getStatus: () => typeof ImportJobStatus;
|
|
496
|
-
|
|
497
|
-
/**
|
|
498
|
-
* Retrieves the baseURL of the import job.
|
|
499
|
-
*/
|
|
500
|
-
getBaseURL: () => string;
|
|
501
|
-
|
|
502
|
-
/**
|
|
503
|
-
* Retrieves the options of the import job.
|
|
504
|
-
*/
|
|
505
|
-
getOptions: () => object;
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* Retrieves the startTime of the import job.
|
|
509
|
-
*/
|
|
510
|
-
getStartTime: () => string;
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* Retrieves the endTime of the import job.
|
|
514
|
-
*/
|
|
515
|
-
getEndTime: () => string;
|
|
516
|
-
|
|
517
|
-
/**
|
|
518
|
-
* Retrieves the duration of the import job.
|
|
519
|
-
*/
|
|
520
|
-
getDuration: () => number;
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* Retrieves the url count of the import job.
|
|
524
|
-
*/
|
|
525
|
-
getUrlCount: () => number;
|
|
526
|
-
|
|
527
|
-
/**
|
|
528
|
-
* Retrieves the success count of the import job.
|
|
529
|
-
*/
|
|
530
|
-
getSuccessCount: () => number;
|
|
531
|
-
|
|
532
|
-
/**
|
|
533
|
-
* Retrieves the failure count of the import job.
|
|
534
|
-
*/
|
|
535
|
-
getFailedCount: () => number;
|
|
536
|
-
|
|
537
|
-
/**
|
|
538
|
-
* Retrieves the redirect count of the import job.
|
|
539
|
-
*/
|
|
540
|
-
getRedirectCount: () => number;
|
|
541
|
-
|
|
542
|
-
/**
|
|
543
|
-
* Retrieves the importQueueId of the import job.
|
|
544
|
-
*/
|
|
545
|
-
getImportQueueId: () => string;
|
|
546
|
-
|
|
547
|
-
/**
|
|
548
|
-
* Retrieves the initiatedBy metadata (name, imsOrgId, imsUserId, userAgent) of the import job.
|
|
549
|
-
*/
|
|
550
|
-
getInitiatedBy: () => object;
|
|
551
|
-
|
|
552
|
-
/**
|
|
553
|
-
* Indicates if the import job has custom headers.
|
|
554
|
-
*/
|
|
555
|
-
hasCustomHeaders: () => boolean;
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* Indicates if the import job has custom import js.
|
|
559
|
-
*/
|
|
560
|
-
hasCustomImportJs: () => boolean;
|
|
561
|
-
}
|
|
562
|
-
|
|
563
|
-
export interface ImportUrl {
|
|
564
|
-
/**
|
|
565
|
-
* Retrieves the ID of the import URL.
|
|
566
|
-
*/
|
|
567
|
-
getId: () => string;
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* Retrieves the status of the import URL.
|
|
571
|
-
*/
|
|
572
|
-
getStatus: () => typeof ImportUrlStatus;
|
|
573
|
-
|
|
574
|
-
/**
|
|
575
|
-
* Retrieves the URL of the import URL.
|
|
576
|
-
*/
|
|
577
|
-
getUrl: () => string;
|
|
578
|
-
|
|
579
|
-
/**
|
|
580
|
-
* Retrieves the job ID of the import URL.
|
|
581
|
-
*/
|
|
582
|
-
getJobId: () => string;
|
|
583
|
-
|
|
584
|
-
/**
|
|
585
|
-
* The reason that the import of a URL failed.
|
|
586
|
-
*/
|
|
587
|
-
getReason: () => string;
|
|
588
|
-
|
|
589
|
-
/**
|
|
590
|
-
* The absolute path to the resource that is being imported for the given URL.
|
|
591
|
-
*/
|
|
592
|
-
getFile: () => string;
|
|
593
|
-
|
|
594
|
-
/**
|
|
595
|
-
* Retrieves the resulting path and filename of the imported file.
|
|
596
|
-
*/
|
|
597
|
-
getPath: () => string;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
/**
|
|
601
|
-
* Represents an API Key entity.
|
|
602
|
-
*/
|
|
603
|
-
export interface ApiKey {
|
|
604
|
-
/**
|
|
605
|
-
* Retrieves the ID of the API Key.
|
|
606
|
-
*/
|
|
607
|
-
getId: () => string;
|
|
608
|
-
|
|
609
|
-
/**
|
|
610
|
-
* Retrieves the hashed key value of the API Key.
|
|
611
|
-
*/
|
|
612
|
-
getHashedApiKey: () => string;
|
|
613
|
-
|
|
614
|
-
/**
|
|
615
|
-
* Retrieves the name of the API Key.
|
|
616
|
-
*/
|
|
617
|
-
getName: () => string;
|
|
618
|
-
|
|
619
|
-
/**
|
|
620
|
-
* Retrieves the imsUserId of the API Key.
|
|
621
|
-
*/
|
|
622
|
-
getImsUserId: () => string;
|
|
623
|
-
|
|
624
|
-
/**
|
|
625
|
-
* Retrieves the imsOrgId of the API key
|
|
626
|
-
*/
|
|
627
|
-
getImsOrgId: () => string;
|
|
628
|
-
|
|
629
|
-
/**
|
|
630
|
-
* Retrieves the createdAt of the API Key.
|
|
631
|
-
*/
|
|
632
|
-
getCreatedAt: () => string;
|
|
633
|
-
|
|
634
|
-
/**
|
|
635
|
-
* Retrieves the expiresAt of the API Key.
|
|
636
|
-
*/
|
|
637
|
-
getExpiresAt: () => string;
|
|
638
|
-
|
|
639
|
-
/**
|
|
640
|
-
* Retrieves the revokedAt of the API Key.
|
|
641
|
-
*/
|
|
642
|
-
getRevokedAt: () => string;
|
|
643
|
-
|
|
644
|
-
/**
|
|
645
|
-
* Retrieves the deletedAt of the API Key.
|
|
646
|
-
*/
|
|
647
|
-
getDeletedAt: () => string;
|
|
648
|
-
|
|
649
|
-
/**
|
|
650
|
-
* Retrieves the scopes of the API Key.
|
|
651
|
-
*/
|
|
652
|
-
getScopes: () => Array<string>;
|
|
653
|
-
|
|
654
|
-
/**
|
|
655
|
-
* Updates the deletedAt attribute of the API Key.
|
|
656
|
-
*/
|
|
657
|
-
updateDeletedAt: (deletedAt: string) => ApiKey;
|
|
658
|
-
|
|
659
|
-
/**
|
|
660
|
-
* Indicates whether the API Key is valid.
|
|
661
|
-
*/
|
|
662
|
-
isValid: () => boolean;
|
|
663
|
-
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
/**
|
|
667
|
-
* Represents an experiment entity.
|
|
668
|
-
*/
|
|
669
|
-
export interface Experiment {
|
|
670
|
-
/**
|
|
671
|
-
* Retrieves the ID of the experiment.
|
|
672
|
-
*/
|
|
673
|
-
getExperimentId: () => string;
|
|
674
|
-
|
|
675
|
-
/**
|
|
676
|
-
* Retrieves the site ID of the experiment.
|
|
677
|
-
*/
|
|
678
|
-
getSiteId: () => string;
|
|
679
|
-
|
|
680
|
-
/**
|
|
681
|
-
* Retrieves the Control URL of the experiment.
|
|
682
|
-
*/
|
|
683
|
-
getUrl: () => string;
|
|
684
|
-
|
|
685
|
-
/**
|
|
686
|
-
* Retrieves the experiment name.
|
|
687
|
-
*/
|
|
688
|
-
getName: () => string;
|
|
689
|
-
|
|
690
|
-
/**
|
|
691
|
-
* Retrieves the experiment type.
|
|
692
|
-
*/
|
|
693
|
-
getType: () => string;
|
|
694
|
-
|
|
695
|
-
/**
|
|
696
|
-
* Retrieves the experiment status.
|
|
697
|
-
*/
|
|
698
|
-
getStatus: () => string;
|
|
699
|
-
|
|
700
|
-
/**
|
|
701
|
-
* Retrieves the experiment variants.
|
|
702
|
-
*/
|
|
703
|
-
getVariants: () => Array<object>;
|
|
704
|
-
|
|
705
|
-
/**
|
|
706
|
-
* Retrieves the experiment start date.
|
|
707
|
-
*/
|
|
708
|
-
getStartDate: () => string;
|
|
709
|
-
|
|
710
|
-
/**
|
|
711
|
-
* Retrieves the experiment end date.
|
|
712
|
-
*/
|
|
713
|
-
getEndDate: () => string;
|
|
714
|
-
|
|
715
|
-
/**
|
|
716
|
-
* Retrieves the conversion event name.
|
|
717
|
-
*/
|
|
718
|
-
getConversionEventName: () => string;
|
|
719
|
-
|
|
720
|
-
/**
|
|
721
|
-
* Retrieves the conversion event value
|
|
722
|
-
*/
|
|
723
|
-
getConversionEventValue: () => string;
|
|
724
|
-
|
|
725
|
-
/**
|
|
726
|
-
* Retrieves the last update timestamp of the experiment entity in persistent store.
|
|
727
|
-
*/
|
|
728
|
-
getUpdatedAt: () => string;
|
|
729
|
-
|
|
730
|
-
/**
|
|
731
|
-
* Retrieves the updated by of the experiment entity in persistent store.
|
|
732
|
-
*/
|
|
733
|
-
getUpdatedBy: () => string;
|
|
734
|
-
}
|
|
735
|
-
|
|
736
|
-
export interface DataAccess {
|
|
737
|
-
getAuditForSite: (
|
|
738
|
-
sitedId: string,
|
|
739
|
-
auditType: string,
|
|
740
|
-
auditedAt: string,
|
|
741
|
-
) => Promise<Audit | null>;
|
|
742
|
-
getAuditsForSite: (
|
|
743
|
-
siteId: string,
|
|
744
|
-
auditType?: string,
|
|
745
|
-
ascending?: boolean,
|
|
746
|
-
) => Promise<Audit[]>;
|
|
747
|
-
getLatestAuditForSite: (
|
|
748
|
-
siteId: string,
|
|
749
|
-
auditType: string,
|
|
750
|
-
) => Promise<Audit | null>;
|
|
751
|
-
getLatestAudits: (
|
|
752
|
-
auditType: string,
|
|
753
|
-
ascending?: boolean,
|
|
754
|
-
) => Promise<Audit[]>;
|
|
755
|
-
getLatestAuditsForSite: (
|
|
756
|
-
siteId: string,
|
|
757
|
-
) => Promise<Audit[]>;
|
|
758
|
-
addAudit: (
|
|
759
|
-
auditData: object,
|
|
760
|
-
) => Promise<Audit>;
|
|
761
|
-
removeAuditsForSite: (
|
|
762
|
-
siteId: string,
|
|
763
|
-
) => Promise<void>;
|
|
764
|
-
getSites: () => Promise<Site[]>;
|
|
765
|
-
getSitesByDeliveryType: (
|
|
766
|
-
deliveryType: string,
|
|
767
|
-
) => Promise<Site[]>;
|
|
768
|
-
getSitesToAudit: () => Promise<string[]>;
|
|
769
|
-
getSitesWithLatestAudit: (
|
|
770
|
-
auditType: string,
|
|
771
|
-
sortAuditsAscending?: boolean,
|
|
772
|
-
deliveryType?: string,
|
|
773
|
-
) => Promise<Site[]>;
|
|
774
|
-
getSitesByOrganizationID: (
|
|
775
|
-
organizationId: string,
|
|
776
|
-
) => Promise<Organization[]>
|
|
777
|
-
getSiteByBaseURL: (
|
|
778
|
-
baseUrl: string,
|
|
779
|
-
) => Promise<Site | null>;
|
|
780
|
-
getSiteByBaseURLWithAuditInfo: (
|
|
781
|
-
baseUrl: string,
|
|
782
|
-
auditType: string,
|
|
783
|
-
latestOnly?: boolean,
|
|
784
|
-
) => Promise<Site | null>;
|
|
785
|
-
getSiteByBaseURLWithAudits: (
|
|
786
|
-
baseUrl: string,
|
|
787
|
-
auditType: string,
|
|
788
|
-
) => Promise<Site | null>;
|
|
789
|
-
getSiteByBaseURLWithLatestAudit: (
|
|
790
|
-
baseUrl: string,
|
|
791
|
-
auditType: string,
|
|
792
|
-
) => Promise<Site | null>;
|
|
793
|
-
getSiteByID: (
|
|
794
|
-
siteId: string,
|
|
795
|
-
) => Promise<Site | null>;
|
|
796
|
-
addSite: (
|
|
797
|
-
siteData: object,
|
|
798
|
-
) => Promise<Site>;
|
|
799
|
-
updateSite: (
|
|
800
|
-
site: Site,
|
|
801
|
-
) => Promise<Site>;
|
|
802
|
-
removeSite: (
|
|
803
|
-
siteId: string,
|
|
804
|
-
) => Promise<void>;
|
|
805
|
-
removeSitesForOrganization: (
|
|
806
|
-
organizationId: string,
|
|
807
|
-
) => Promise<void>;
|
|
808
|
-
getOrganizations:
|
|
809
|
-
() => Promise<Organization[]>;
|
|
810
|
-
getOrganizationByID: (
|
|
811
|
-
organizationID: string,
|
|
812
|
-
) => Promise<Organization | null>;
|
|
813
|
-
getOrganizationByImsOrgID: (
|
|
814
|
-
imsOrgID: string,
|
|
815
|
-
) => Promise<Organization | null>;
|
|
816
|
-
addOrganization: (
|
|
817
|
-
organizationData: object,
|
|
818
|
-
) => Promise<Organization>;
|
|
819
|
-
updateOrganization: (
|
|
820
|
-
organization: Organization,
|
|
821
|
-
) => Promise<Organization>;
|
|
822
|
-
removeOrganization: (
|
|
823
|
-
organizationId: string,
|
|
824
|
-
) => Promise<void>;
|
|
825
|
-
getImportJobsByDateRange: (
|
|
826
|
-
startDate: string,
|
|
827
|
-
endDate: string,
|
|
828
|
-
) => Promise<ImportJob[]>;
|
|
829
|
-
getImportJobByID: (
|
|
830
|
-
id: string,
|
|
831
|
-
) => Promise<ImportJob | null>;
|
|
832
|
-
getImportJobsByStatus: (
|
|
833
|
-
status: string,
|
|
834
|
-
) => Promise<ImportJob[]>;
|
|
835
|
-
createNewImportJob: (
|
|
836
|
-
importJobData: object,
|
|
837
|
-
) => Promise<ImportJob>;
|
|
838
|
-
updateImportJob: (
|
|
839
|
-
importJob: ImportJob,
|
|
840
|
-
) => Promise<ImportJob>;
|
|
841
|
-
getImportUrlByID: (
|
|
842
|
-
id: string,
|
|
843
|
-
) => Promise<ImportUrl | null>;
|
|
844
|
-
createNewImportUrl: (
|
|
845
|
-
importUrlData: object,
|
|
846
|
-
) => Promise<ImportUrl>;
|
|
847
|
-
updateImportUrl: (
|
|
848
|
-
importUrl: ImportUrl,
|
|
849
|
-
) => Promise<ImportUrl>;
|
|
850
|
-
getImportUrlsByJobIdAndStatus: (
|
|
851
|
-
jobId: string,
|
|
852
|
-
status: string,
|
|
853
|
-
) => Promise<ImportUrl[]>;
|
|
854
|
-
getImportUrlsByJobId: (
|
|
855
|
-
jobId: string,
|
|
856
|
-
) => Promise<ImportUrl[]>;
|
|
857
|
-
getApiKeyByHashedApiKey: (
|
|
858
|
-
hashedApiKey: string,
|
|
859
|
-
) => Promise<ApiKey | null>;
|
|
860
|
-
createNewApiKey: (
|
|
861
|
-
apiKeyData: object,
|
|
862
|
-
) => Promise<ApiKey>;
|
|
863
|
-
updateApiKey: (
|
|
864
|
-
apiKey: ApiKey,
|
|
865
|
-
) => Promise<ApiKey>;
|
|
866
|
-
getApiKeysByImsUserIdAndImsOrgId: (
|
|
867
|
-
imsUserId: string,
|
|
868
|
-
imsOrgId: string,
|
|
869
|
-
) => Promise<ApiKey[] | null>;
|
|
870
|
-
getApiKeyById: (
|
|
871
|
-
id: string,
|
|
872
|
-
) => Promise<ApiKey | null>;
|
|
873
|
-
|
|
874
|
-
// site candidate functions
|
|
875
|
-
getSiteCandidates: () => Promise<SiteCandidate[]>;
|
|
876
|
-
getSiteCandidateByBaseURL: (baseURL: string) => Promise<SiteCandidate>;
|
|
877
|
-
upsertSiteCandidate: (siteCandidateDate: object) => Promise<SiteCandidate>;
|
|
878
|
-
siteCandidateExists: (baseURL: string) => Promise<boolean>;
|
|
879
|
-
updateSiteCandidate: (siteCandidate: SiteCandidate) => Promise<SiteCandidate>;
|
|
880
|
-
|
|
881
|
-
// site top pages functions
|
|
882
|
-
getTopPagesForSite: (siteId: string, source: string, geo: string)
|
|
883
|
-
=> Promise<Readonly<SiteTopPage>[]>;
|
|
884
|
-
addSiteTopPage: (siteTopPageData: object) => Promise<SiteTopPage>;
|
|
885
|
-
removeSiteTopPages: (siteId: string, source: string, geo: string) => Promise<void>;
|
|
886
|
-
|
|
887
|
-
// configuration functions
|
|
888
|
-
getConfiguration: () => Promise<Readonly<Configuration>>
|
|
889
|
-
getConfigurations: () => Promise<Readonly<Configuration>[]>
|
|
890
|
-
getConfigurationByVersion: (version: number) => Promise<Readonly<Configuration>>
|
|
891
|
-
updateConfiguration: (configurationData: object) => Promise<Readonly<Configuration>>
|
|
892
|
-
|
|
893
|
-
// key events functions
|
|
894
|
-
createKeyEvent: (keyEventData: object) => Promise<KeyEvent>;
|
|
895
|
-
getKeyEventsForSite: (siteId: string) => Promise<KeyEvent[]>
|
|
896
|
-
removeKeyEvent: (keyEventId: string) => Promise<void>;
|
|
897
|
-
|
|
898
|
-
// experiment functions
|
|
899
|
-
getExperiments: (siteId: string, experimentId?: string) => Promise<Experiment[]>;
|
|
900
|
-
getExperiment: (siteId: string, experimentId: string, url: string) => Promise<Experiment | null>;
|
|
901
|
-
upsertExperiment: (experimentData: object) => Promise<Experiment>;
|
|
902
|
-
|
|
903
|
-
// electro-based entities
|
|
904
|
-
Opportunity: object,
|
|
905
|
-
Suggestion: object,
|
|
906
|
-
}
|
|
907
|
-
|
|
908
|
-
interface DataAccessConfig {
|
|
909
|
-
tableNameAudits: string;
|
|
910
|
-
tableNameKeyEvents: string;
|
|
911
|
-
tableNameLatestAudits: string;
|
|
912
|
-
tableNameOrganizations: string,
|
|
913
|
-
tableNameSites: string;
|
|
914
|
-
tableNameSiteCandidates: string;
|
|
915
|
-
tableNameConfigurations: string;
|
|
916
|
-
tableNameSiteTopPages: string;
|
|
917
|
-
tableNameImportJobs: string;
|
|
918
|
-
tableNameImportUrls: string;
|
|
919
|
-
tableNameExperiments: string;
|
|
920
|
-
tableNameApiKeys: string;
|
|
921
|
-
indexNameAllKeyEventsBySiteId: string,
|
|
922
|
-
indexNameAllSites: string;
|
|
923
|
-
indexNameAllSitesOrganizations: string,
|
|
924
|
-
indexNameAllSitesByDeliveryType: string;
|
|
925
|
-
indexNameAllLatestAuditScores: string;
|
|
926
|
-
indexNameAllOrganizations: string,
|
|
927
|
-
indexNameAllOrganizationsByImsOrgId: string,
|
|
928
|
-
indexNameAllImportJobsByStatus: string,
|
|
929
|
-
indexNameAllImportJobsByDateRange: string,
|
|
930
|
-
indexNameImportUrlsByJobIdAndStatus: string,
|
|
931
|
-
indexNameApiKeyByHashedApiKey: string,
|
|
932
|
-
indexNameApiKeyByImsUserIdAndImsOrgId: string,
|
|
933
|
-
pkAllSites: string;
|
|
934
|
-
pkAllLatestAudits: string;
|
|
935
|
-
pkAllOrganizations: string;
|
|
936
|
-
pkAllConfigurations: string;
|
|
937
|
-
pkAllImportJobs: string;
|
|
938
|
-
}
|
|
939
|
-
|
|
940
|
-
export function createDataAccess(
|
|
941
|
-
config: DataAccessConfig,
|
|
942
|
-
logger: object,
|
|
943
|
-
): DataAccess;
|
|
944
|
-
|
|
945
|
-
export type * from './v2/index.d.ts';
|
|
13
|
+
export type * from './errors';
|
|
14
|
+
export type * from './models';
|
|
15
|
+
export type * from './util';
|