@ainyc/canonry 4.186.7 → 4.186.9
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/assets/assets/{AuditHistoryPanel-9q5v4zHj.js → AuditHistoryPanel-aXPOAK7n.js} +1 -1
- package/assets/assets/{BacklinksPage-C2QVWfQf.js → BacklinksPage-Bim-7fNk.js} +1 -1
- package/assets/assets/{HistoryPage-oLCQA7-T.js → HistoryPage-B8RyIjRC.js} +1 -1
- package/assets/assets/{MeasurementPropertyPage-DUYt5ceA.js → MeasurementPropertyPage-BlxY3qHW.js} +1 -1
- package/assets/assets/ProjectPage-BMZrEjBE.js +9 -0
- package/assets/assets/{RunRow-kaFXI_VP.js → RunRow-B28gp-6g.js} +1 -1
- package/assets/assets/{RunsPage-CQizRJxf.js → RunsPage-BXm6DVdt.js} +1 -1
- package/assets/assets/{SettingsPage-BHh4Y7Qg.js → SettingsPage-CJX7c5HH.js} +1 -1
- package/assets/assets/{SiteHealthSection-DjmPK0Tg.js → SiteHealthSection-Ys8sVumO.js} +3 -3
- package/assets/assets/{TrafficPage-B3N0r5gW.js → TrafficPage-wPdIYn8H.js} +1 -1
- package/assets/assets/{TrafficSourceDetailPage-C27GkPF4.js → TrafficSourceDetailPage-C813qZsA.js} +1 -1
- package/assets/assets/{extract-error-message-DlmIEdy_.js → extract-error-message-C3RpUAm_.js} +1 -1
- package/assets/assets/{index-DVa1lkiE.js → index-Dr_-IUJz.js} +23 -23
- package/assets/assets/{react-sigma_core.esm.min-BBOzBU_n.js → react-sigma_core.esm.min-LmiGNvR6.js} +1 -1
- package/assets/index.html +1 -1
- package/dist/{chunk-7CG3QE4N.js → chunk-EMSDPSQM.js} +130 -68
- package/dist/{chunk-CFJHRXZ3.js → chunk-LNBX7RTN.js} +556 -536
- package/dist/{chunk-FGEHMYIW.js → chunk-O26JKJXV.js} +41 -6
- package/dist/{chunk-42P3CXIH.js → chunk-U3M2VALC.js} +20 -3
- package/dist/{chunk-7TYSFZEG.js → chunk-XD2ZD2BP.js} +2 -2
- package/dist/cli.js +5 -5
- package/dist/index.d.ts +8 -0
- package/dist/index.js +4 -4
- package/dist/{intelligence-service-KBHLNDGO.js → intelligence-service-UZGA24EF.js} +2 -2
- package/dist/mcp.js +3 -3
- package/package.json +11 -11
- package/assets/assets/ProjectPage-Dsao_AiN.js +0 -9
|
@@ -50,6 +50,14 @@ function forbidden(message = "Forbidden", details) {
|
|
|
50
50
|
function quotaExceeded(metric, details) {
|
|
51
51
|
return new AppError("QUOTA_EXCEEDED", `Quota exceeded for ${metric}`, 429, details);
|
|
52
52
|
}
|
|
53
|
+
function researchDailyLimitExceeded(projectName, limit, date) {
|
|
54
|
+
return new AppError(
|
|
55
|
+
"RESEARCH_DAILY_LIMIT_EXCEEDED",
|
|
56
|
+
`The viewer research run limit for this project has been reached today (${limit}). Try again tomorrow or ask an administrator.`,
|
|
57
|
+
429,
|
|
58
|
+
{ projectName, limit, date }
|
|
59
|
+
);
|
|
60
|
+
}
|
|
53
61
|
function providerError(message, details) {
|
|
54
62
|
return new AppError("PROVIDER_ERROR", message, 502, details);
|
|
55
63
|
}
|
|
@@ -16068,225 +16076,282 @@ function sumInfraHits(segments) {
|
|
|
16068
16076
|
}
|
|
16069
16077
|
|
|
16070
16078
|
// ../contracts/src/research.ts
|
|
16079
|
+
import { z as z56 } from "zod";
|
|
16080
|
+
|
|
16081
|
+
// ../contracts/src/users.ts
|
|
16071
16082
|
import { z as z55 } from "zod";
|
|
16072
|
-
var
|
|
16083
|
+
var UserRoles = {
|
|
16084
|
+
admin: "admin",
|
|
16085
|
+
viewer: "viewer"
|
|
16086
|
+
};
|
|
16087
|
+
var userRoleSchema = z55.enum(["admin", "viewer"]);
|
|
16088
|
+
var USER_NAME_PATTERN = /^[a-z\d][\w.-]{0,63}$/i;
|
|
16089
|
+
var userNameSchema = z55.string().regex(
|
|
16090
|
+
USER_NAME_PATTERN,
|
|
16091
|
+
"A name may use letters, digits, dots, dashes and underscores, and must start with a letter or digit."
|
|
16092
|
+
);
|
|
16093
|
+
var USER_PASSWORD_MIN_LENGTH = 12;
|
|
16094
|
+
var userPasswordSchema = z55.string().min(
|
|
16095
|
+
USER_PASSWORD_MIN_LENGTH,
|
|
16096
|
+
`A password must be at least ${USER_PASSWORD_MIN_LENGTH} characters.`
|
|
16097
|
+
);
|
|
16098
|
+
function normalizeUserName(name) {
|
|
16099
|
+
return name.trim().toLowerCase();
|
|
16100
|
+
}
|
|
16101
|
+
var userDtoSchema = z55.object({
|
|
16102
|
+
id: z55.string(),
|
|
16103
|
+
name: z55.string(),
|
|
16104
|
+
role: userRoleSchema,
|
|
16105
|
+
createdAt: z55.string(),
|
|
16106
|
+
lastLoginAt: z55.string().nullable()
|
|
16107
|
+
});
|
|
16108
|
+
var userListDtoSchema = z55.object({
|
|
16109
|
+
users: z55.array(userDtoSchema)
|
|
16110
|
+
});
|
|
16111
|
+
var createUserRequestSchema = z55.object({
|
|
16112
|
+
name: userNameSchema,
|
|
16113
|
+
password: userPasswordSchema,
|
|
16114
|
+
role: userRoleSchema
|
|
16115
|
+
});
|
|
16116
|
+
var loginRequestSchema = z55.object({
|
|
16117
|
+
name: z55.string().min(1),
|
|
16118
|
+
password: z55.string().min(1)
|
|
16119
|
+
});
|
|
16120
|
+
var authSessionDtoSchema = z55.object({
|
|
16121
|
+
/** True once at least one account exists, so the dashboard must sign in. */
|
|
16122
|
+
authRequired: z55.boolean(),
|
|
16123
|
+
/** The signed-in person, or null when nobody is signed in. */
|
|
16124
|
+
user: userDtoSchema.pick({ name: true, role: true }).nullable()
|
|
16125
|
+
});
|
|
16126
|
+
var LOGIN_FAILED_MESSAGE = "Incorrect name or password.";
|
|
16127
|
+
|
|
16128
|
+
// ../contracts/src/research.ts
|
|
16129
|
+
var researchRunStatusSchema = z56.enum(["queued", "running", "completed", "partial", "failed"]);
|
|
16073
16130
|
var ResearchRunStatuses = researchRunStatusSchema.enum;
|
|
16074
|
-
var researchQueryStatusSchema =
|
|
16131
|
+
var researchQueryStatusSchema = z56.enum(["queued", "running", "completed", "failed"]);
|
|
16075
16132
|
var ResearchQueryStatuses = researchQueryStatusSchema.enum;
|
|
16076
|
-
var
|
|
16077
|
-
|
|
16078
|
-
|
|
16079
|
-
|
|
16133
|
+
var DEFAULT_VIEWER_RESEARCH_DAILY_RUN_LIMIT = 20;
|
|
16134
|
+
var researchRunCreateSchema = z56.object({
|
|
16135
|
+
queries: z56.array(z56.string().trim().min(1).max(4e3)).min(1).max(50),
|
|
16136
|
+
provider: z56.string().trim().min(1).optional(),
|
|
16137
|
+
model: z56.string().trim().min(1).max(200).optional(),
|
|
16080
16138
|
location: locationContextSchema.nullable().optional(),
|
|
16081
|
-
idempotencyKey:
|
|
16139
|
+
idempotencyKey: z56.string().trim().min(1).max(128).optional()
|
|
16082
16140
|
}).superRefine((value, ctx) => {
|
|
16083
|
-
if (value.model && !value.provider) ctx.addIssue({ code:
|
|
16141
|
+
if (value.model && !value.provider) ctx.addIssue({ code: z56.ZodIssueCode.custom, path: ["provider"], message: "provider is required when model is supplied" });
|
|
16084
16142
|
});
|
|
16085
|
-
var
|
|
16086
|
-
|
|
16087
|
-
|
|
16143
|
+
var researchRunPrincipalSchema = z56.object({
|
|
16144
|
+
kind: z56.enum(["api-key", "user"]),
|
|
16145
|
+
id: z56.string(),
|
|
16146
|
+
name: z56.string(),
|
|
16147
|
+
role: userRoleSchema.nullable()
|
|
16148
|
+
});
|
|
16149
|
+
var researchRunSummarySchema = z56.object({
|
|
16150
|
+
id: z56.string(),
|
|
16151
|
+
projectId: z56.string(),
|
|
16088
16152
|
status: researchRunStatusSchema,
|
|
16089
|
-
provider:
|
|
16090
|
-
requestedModel:
|
|
16091
|
-
resolvedModel:
|
|
16153
|
+
provider: z56.string(),
|
|
16154
|
+
requestedModel: z56.string().nullable(),
|
|
16155
|
+
resolvedModel: z56.string(),
|
|
16092
16156
|
location: locationContextSchema.nullable(),
|
|
16093
|
-
totalQueries:
|
|
16094
|
-
completedQueries:
|
|
16095
|
-
failedQueries:
|
|
16096
|
-
error:
|
|
16097
|
-
|
|
16098
|
-
|
|
16099
|
-
|
|
16100
|
-
|
|
16101
|
-
|
|
16102
|
-
|
|
16103
|
-
|
|
16104
|
-
|
|
16157
|
+
totalQueries: z56.number().int(),
|
|
16158
|
+
completedQueries: z56.number().int(),
|
|
16159
|
+
failedQueries: z56.number().int(),
|
|
16160
|
+
error: z56.string().nullable(),
|
|
16161
|
+
initiatedBy: researchRunPrincipalSchema.nullable(),
|
|
16162
|
+
startedAt: z56.string().nullable(),
|
|
16163
|
+
finishedAt: z56.string().nullable(),
|
|
16164
|
+
createdAt: z56.string()
|
|
16165
|
+
});
|
|
16166
|
+
var researchRunQuerySchema = z56.object({
|
|
16167
|
+
id: z56.string(),
|
|
16168
|
+
position: z56.number().int(),
|
|
16169
|
+
query: z56.string(),
|
|
16105
16170
|
status: researchQueryStatusSchema,
|
|
16106
|
-
requestedModel:
|
|
16107
|
-
resolvedModel:
|
|
16108
|
-
servedModel:
|
|
16109
|
-
answerText:
|
|
16110
|
-
groundingSources:
|
|
16111
|
-
citedDomains:
|
|
16112
|
-
searchQueries:
|
|
16113
|
-
namedCompetitors:
|
|
16114
|
-
citedCompetitorDomains:
|
|
16115
|
-
answerMentioned:
|
|
16171
|
+
requestedModel: z56.string().nullable(),
|
|
16172
|
+
resolvedModel: z56.string(),
|
|
16173
|
+
servedModel: z56.string().nullable(),
|
|
16174
|
+
answerText: z56.string().nullable(),
|
|
16175
|
+
groundingSources: z56.array(groundingSourceSchema),
|
|
16176
|
+
citedDomains: z56.array(z56.string()),
|
|
16177
|
+
searchQueries: z56.array(z56.string()),
|
|
16178
|
+
namedCompetitors: z56.array(z56.string()).default([]),
|
|
16179
|
+
citedCompetitorDomains: z56.array(z56.string()).default([]),
|
|
16180
|
+
answerMentioned: z56.boolean().nullable(),
|
|
16116
16181
|
citationState: citationStateSchema.nullable(),
|
|
16117
|
-
error:
|
|
16118
|
-
startedAt:
|
|
16119
|
-
finishedAt:
|
|
16120
|
-
createdAt:
|
|
16182
|
+
error: z56.string().nullable(),
|
|
16183
|
+
startedAt: z56.string().nullable(),
|
|
16184
|
+
finishedAt: z56.string().nullable(),
|
|
16185
|
+
createdAt: z56.string()
|
|
16121
16186
|
});
|
|
16122
|
-
var researchRunDetailSchema = researchRunSummarySchema.extend({ queries:
|
|
16123
|
-
var researchRunListSchema =
|
|
16187
|
+
var researchRunDetailSchema = researchRunSummarySchema.extend({ queries: z56.array(researchRunQuerySchema) });
|
|
16188
|
+
var researchRunListSchema = z56.object({ runs: z56.array(researchRunSummarySchema) });
|
|
16124
16189
|
|
|
16125
16190
|
// ../contracts/src/ads.ts
|
|
16126
|
-
import { z as
|
|
16191
|
+
import { z as z57 } from "zod";
|
|
16127
16192
|
var AdsReviewStatuses = {
|
|
16128
16193
|
approved: "approved"
|
|
16129
16194
|
};
|
|
16130
16195
|
var AdsIntegrityDecisions = {
|
|
16131
16196
|
allowed: "allowed"
|
|
16132
16197
|
};
|
|
16133
|
-
var adsConnectRequestSchema =
|
|
16198
|
+
var adsConnectRequestSchema = z57.object({
|
|
16134
16199
|
/** Ads Manager "SDK key" scoped to one ad account. Stored in config.yaml, never the DB. */
|
|
16135
|
-
apiKey:
|
|
16200
|
+
apiKey: z57.string().min(1)
|
|
16136
16201
|
});
|
|
16137
|
-
var adsAccountDtoSchema =
|
|
16138
|
-
id:
|
|
16139
|
-
name:
|
|
16140
|
-
status:
|
|
16141
|
-
currencyCode:
|
|
16142
|
-
timezone:
|
|
16143
|
-
url:
|
|
16144
|
-
reviewStatus:
|
|
16145
|
-
integrityReviewStatus:
|
|
16146
|
-
integrityDecision:
|
|
16147
|
-
});
|
|
16148
|
-
var adsGeoSearchQuerySchema =
|
|
16149
|
-
q:
|
|
16150
|
-
limit:
|
|
16151
|
-
});
|
|
16152
|
-
var adsGeoLocationDtoSchema =
|
|
16153
|
-
id:
|
|
16154
|
-
type:
|
|
16155
|
-
canonicalName:
|
|
16156
|
-
countryCode:
|
|
16157
|
-
name:
|
|
16158
|
-
regionCode:
|
|
16202
|
+
var adsAccountDtoSchema = z57.object({
|
|
16203
|
+
id: z57.string(),
|
|
16204
|
+
name: z57.string(),
|
|
16205
|
+
status: z57.string(),
|
|
16206
|
+
currencyCode: z57.string().nullable(),
|
|
16207
|
+
timezone: z57.string().nullable(),
|
|
16208
|
+
url: z57.string().nullable(),
|
|
16209
|
+
reviewStatus: z57.string().nullable(),
|
|
16210
|
+
integrityReviewStatus: z57.string().nullable(),
|
|
16211
|
+
integrityDecision: z57.string().nullable()
|
|
16212
|
+
});
|
|
16213
|
+
var adsGeoSearchQuerySchema = z57.object({
|
|
16214
|
+
q: z57.string().trim().min(1).max(200),
|
|
16215
|
+
limit: z57.number().int().min(1).max(100).default(20)
|
|
16216
|
+
});
|
|
16217
|
+
var adsGeoLocationDtoSchema = z57.object({
|
|
16218
|
+
id: z57.string(),
|
|
16219
|
+
type: z57.string(),
|
|
16220
|
+
canonicalName: z57.string(),
|
|
16221
|
+
countryCode: z57.string(),
|
|
16222
|
+
name: z57.string(),
|
|
16223
|
+
regionCode: z57.string().nullable()
|
|
16159
16224
|
});
|
|
16160
|
-
var adsGeoSearchResponseSchema =
|
|
16161
|
-
count:
|
|
16162
|
-
query:
|
|
16163
|
-
results:
|
|
16225
|
+
var adsGeoSearchResponseSchema = z57.object({
|
|
16226
|
+
count: z57.number().int().nonnegative(),
|
|
16227
|
+
query: z57.string(),
|
|
16228
|
+
results: z57.array(adsGeoLocationDtoSchema)
|
|
16164
16229
|
});
|
|
16165
|
-
var adsConversionPixelDtoSchema =
|
|
16166
|
-
id:
|
|
16167
|
-
clientType:
|
|
16168
|
-
name:
|
|
16169
|
-
pixelId:
|
|
16230
|
+
var adsConversionPixelDtoSchema = z57.object({
|
|
16231
|
+
id: z57.string(),
|
|
16232
|
+
clientType: z57.string().optional(),
|
|
16233
|
+
name: z57.string().optional(),
|
|
16234
|
+
pixelId: z57.string().optional()
|
|
16170
16235
|
});
|
|
16171
|
-
var adsConversionPixelListResponseSchema =
|
|
16172
|
-
pixels:
|
|
16236
|
+
var adsConversionPixelListResponseSchema = z57.object({
|
|
16237
|
+
pixels: z57.array(adsConversionPixelDtoSchema)
|
|
16173
16238
|
});
|
|
16174
|
-
var adsConversionEventSettingSourceDtoSchema =
|
|
16175
|
-
id:
|
|
16176
|
-
name:
|
|
16239
|
+
var adsConversionEventSettingSourceDtoSchema = z57.object({
|
|
16240
|
+
id: z57.string(),
|
|
16241
|
+
name: z57.string().optional()
|
|
16177
16242
|
});
|
|
16178
|
-
var adsConversionEventSettingDtoSchema =
|
|
16179
|
-
id:
|
|
16180
|
-
name:
|
|
16181
|
-
eventType:
|
|
16182
|
-
customEventName:
|
|
16183
|
-
attributionWindowDays:
|
|
16184
|
-
adAccountId:
|
|
16185
|
-
sourceIds:
|
|
16186
|
-
sources:
|
|
16187
|
-
archived:
|
|
16188
|
-
version:
|
|
16189
|
-
});
|
|
16190
|
-
var adsConversionEventSettingListResponseSchema =
|
|
16191
|
-
eventSettings:
|
|
16192
|
-
});
|
|
16193
|
-
var adsConnectionStatusDtoSchema =
|
|
16194
|
-
connected:
|
|
16195
|
-
adAccountId:
|
|
16196
|
-
displayName:
|
|
16197
|
-
currencyCode:
|
|
16198
|
-
timezone:
|
|
16199
|
-
status:
|
|
16200
|
-
reviewStatus:
|
|
16201
|
-
integrityReviewStatus:
|
|
16202
|
-
integrityDecision:
|
|
16203
|
-
lastSyncedAt:
|
|
16243
|
+
var adsConversionEventSettingDtoSchema = z57.object({
|
|
16244
|
+
id: z57.string(),
|
|
16245
|
+
name: z57.string().optional(),
|
|
16246
|
+
eventType: z57.string().optional(),
|
|
16247
|
+
customEventName: z57.string().nullable().optional(),
|
|
16248
|
+
attributionWindowDays: z57.number().int().positive().optional(),
|
|
16249
|
+
adAccountId: z57.string().optional(),
|
|
16250
|
+
sourceIds: z57.array(z57.string()).optional(),
|
|
16251
|
+
sources: z57.array(adsConversionEventSettingSourceDtoSchema).optional(),
|
|
16252
|
+
archived: z57.boolean().optional(),
|
|
16253
|
+
version: z57.number().int().nonnegative().optional()
|
|
16254
|
+
});
|
|
16255
|
+
var adsConversionEventSettingListResponseSchema = z57.object({
|
|
16256
|
+
eventSettings: z57.array(adsConversionEventSettingDtoSchema)
|
|
16257
|
+
});
|
|
16258
|
+
var adsConnectionStatusDtoSchema = z57.object({
|
|
16259
|
+
connected: z57.boolean(),
|
|
16260
|
+
adAccountId: z57.string().nullable().optional(),
|
|
16261
|
+
displayName: z57.string().nullable().optional(),
|
|
16262
|
+
currencyCode: z57.string().nullable().optional(),
|
|
16263
|
+
timezone: z57.string().nullable().optional(),
|
|
16264
|
+
status: z57.string().nullable().optional(),
|
|
16265
|
+
reviewStatus: z57.string().nullable().optional(),
|
|
16266
|
+
integrityReviewStatus: z57.string().nullable().optional(),
|
|
16267
|
+
integrityDecision: z57.string().nullable().optional(),
|
|
16268
|
+
lastSyncedAt: z57.string().nullable().optional(),
|
|
16204
16269
|
/** Whether the ad account has OpenAI conversion tracking (pixel or CAPI) configured,
|
|
16205
16270
|
* detected from synced campaigns carrying conversion_event_setting_ids. Optional:
|
|
16206
16271
|
* only present when connected. */
|
|
16207
|
-
conversionTrackingConfigured:
|
|
16272
|
+
conversionTrackingConfigured: z57.boolean().optional()
|
|
16208
16273
|
});
|
|
16209
|
-
var adsDisconnectResponseSchema =
|
|
16210
|
-
disconnected:
|
|
16274
|
+
var adsDisconnectResponseSchema = z57.object({
|
|
16275
|
+
disconnected: z57.boolean()
|
|
16211
16276
|
});
|
|
16212
|
-
var adsSyncResponseSchema =
|
|
16213
|
-
runId:
|
|
16214
|
-
status:
|
|
16277
|
+
var adsSyncResponseSchema = z57.object({
|
|
16278
|
+
runId: z57.string(),
|
|
16279
|
+
status: z57.string()
|
|
16215
16280
|
});
|
|
16216
|
-
var adsCreativeDtoSchema =
|
|
16217
|
-
type:
|
|
16218
|
-
title:
|
|
16219
|
-
body:
|
|
16220
|
-
targetUrl:
|
|
16221
|
-
fileId:
|
|
16281
|
+
var adsCreativeDtoSchema = z57.object({
|
|
16282
|
+
type: z57.string().nullable().optional(),
|
|
16283
|
+
title: z57.string().nullable().optional(),
|
|
16284
|
+
body: z57.string().nullable().optional(),
|
|
16285
|
+
targetUrl: z57.string().nullable().optional(),
|
|
16286
|
+
fileId: z57.string().nullable().optional()
|
|
16222
16287
|
});
|
|
16223
|
-
var adsCampaignBiddingTypeSchema =
|
|
16288
|
+
var adsCampaignBiddingTypeSchema = z57.enum(["impressions", "clicks"]);
|
|
16224
16289
|
var AdsCampaignBiddingTypes = adsCampaignBiddingTypeSchema.enum;
|
|
16225
|
-
var adsAdGroupBillingEventTypeSchema =
|
|
16290
|
+
var adsAdGroupBillingEventTypeSchema = z57.enum(["impression", "click"]);
|
|
16226
16291
|
var AdsAdGroupBillingEventTypes = adsAdGroupBillingEventTypeSchema.enum;
|
|
16227
|
-
var adsAdDtoSchema =
|
|
16228
|
-
id:
|
|
16229
|
-
adGroupId:
|
|
16230
|
-
name:
|
|
16231
|
-
status:
|
|
16232
|
-
reviewStatus:
|
|
16292
|
+
var adsAdDtoSchema = z57.object({
|
|
16293
|
+
id: z57.string(),
|
|
16294
|
+
adGroupId: z57.string(),
|
|
16295
|
+
name: z57.string(),
|
|
16296
|
+
status: z57.string(),
|
|
16297
|
+
reviewStatus: z57.string().nullable().optional(),
|
|
16233
16298
|
creative: adsCreativeDtoSchema.nullable().optional(),
|
|
16234
|
-
upstreamUpdatedAt:
|
|
16235
|
-
syncedAt:
|
|
16299
|
+
upstreamUpdatedAt: z57.number().int().nullable().optional(),
|
|
16300
|
+
syncedAt: z57.string().optional()
|
|
16236
16301
|
});
|
|
16237
|
-
var adsAdGroupDtoSchema =
|
|
16238
|
-
id:
|
|
16239
|
-
campaignId:
|
|
16240
|
-
name:
|
|
16241
|
-
description:
|
|
16242
|
-
status:
|
|
16243
|
-
billingEventType:
|
|
16244
|
-
maxBidMicros:
|
|
16302
|
+
var adsAdGroupDtoSchema = z57.object({
|
|
16303
|
+
id: z57.string(),
|
|
16304
|
+
campaignId: z57.string(),
|
|
16305
|
+
name: z57.string(),
|
|
16306
|
+
description: z57.string().nullable().optional(),
|
|
16307
|
+
status: z57.string(),
|
|
16308
|
+
billingEventType: z57.union([adsAdGroupBillingEventTypeSchema, z57.null()]).optional(),
|
|
16309
|
+
maxBidMicros: z57.number().int().nullable().optional(),
|
|
16245
16310
|
/**
|
|
16246
16311
|
* The targeting primitive: entries are multi-line strings of
|
|
16247
16312
|
* newline-separated example queries (the live Ads Manager format).
|
|
16248
16313
|
*/
|
|
16249
|
-
contextHints:
|
|
16250
|
-
ads:
|
|
16251
|
-
upstreamUpdatedAt:
|
|
16252
|
-
syncedAt:
|
|
16314
|
+
contextHints: z57.array(z57.string()).default([]),
|
|
16315
|
+
ads: z57.array(adsAdDtoSchema).default([]),
|
|
16316
|
+
upstreamUpdatedAt: z57.number().int().nullable().optional(),
|
|
16317
|
+
syncedAt: z57.string().optional()
|
|
16253
16318
|
});
|
|
16254
|
-
var adsCampaignDtoSchema =
|
|
16255
|
-
id:
|
|
16256
|
-
name:
|
|
16257
|
-
description:
|
|
16258
|
-
status:
|
|
16259
|
-
startTime:
|
|
16260
|
-
endTime:
|
|
16261
|
-
biddingType:
|
|
16262
|
-
dailySpendLimitMicros:
|
|
16263
|
-
lifetimeSpendLimitMicros:
|
|
16264
|
-
conversionEventSettingIds:
|
|
16265
|
-
locationIds:
|
|
16266
|
-
adGroups:
|
|
16267
|
-
upstreamUpdatedAt:
|
|
16268
|
-
syncedAt:
|
|
16269
|
-
});
|
|
16270
|
-
var adsCampaignListResponseSchema =
|
|
16271
|
-
campaigns:
|
|
16272
|
-
});
|
|
16273
|
-
var adsInsightLevelSchema =
|
|
16319
|
+
var adsCampaignDtoSchema = z57.object({
|
|
16320
|
+
id: z57.string(),
|
|
16321
|
+
name: z57.string(),
|
|
16322
|
+
description: z57.string().nullable().optional(),
|
|
16323
|
+
status: z57.string(),
|
|
16324
|
+
startTime: z57.number().int().nullable().optional(),
|
|
16325
|
+
endTime: z57.number().int().nullable().optional(),
|
|
16326
|
+
biddingType: z57.union([adsCampaignBiddingTypeSchema, z57.null()]).optional(),
|
|
16327
|
+
dailySpendLimitMicros: z57.number().int().nullable().optional(),
|
|
16328
|
+
lifetimeSpendLimitMicros: z57.number().int().nullable().optional(),
|
|
16329
|
+
conversionEventSettingIds: z57.array(z57.string()).default([]),
|
|
16330
|
+
locationIds: z57.array(z57.string()).optional(),
|
|
16331
|
+
adGroups: z57.array(adsAdGroupDtoSchema).default([]),
|
|
16332
|
+
upstreamUpdatedAt: z57.number().int().nullable().optional(),
|
|
16333
|
+
syncedAt: z57.string().optional()
|
|
16334
|
+
});
|
|
16335
|
+
var adsCampaignListResponseSchema = z57.object({
|
|
16336
|
+
campaigns: z57.array(adsCampaignDtoSchema)
|
|
16337
|
+
});
|
|
16338
|
+
var adsInsightLevelSchema = z57.enum(["campaign", "ad_group"]);
|
|
16274
16339
|
var AdsInsightLevels = adsInsightLevelSchema.enum;
|
|
16275
|
-
var adsInsightRowDtoSchema =
|
|
16340
|
+
var adsInsightRowDtoSchema = z57.object({
|
|
16276
16341
|
level: adsInsightLevelSchema,
|
|
16277
|
-
entityId:
|
|
16278
|
-
date:
|
|
16279
|
-
impressions:
|
|
16280
|
-
clicks:
|
|
16281
|
-
spendMicros:
|
|
16342
|
+
entityId: z57.string(),
|
|
16343
|
+
date: z57.string(),
|
|
16344
|
+
impressions: z57.number().int(),
|
|
16345
|
+
clicks: z57.number().int(),
|
|
16346
|
+
spendMicros: z57.number().int(),
|
|
16282
16347
|
/** Conversion count for the row. 0 when conversion tracking is not configured.
|
|
16283
16348
|
* Conversion VALUE (for ROAS) is a deliberate follow-up: the upstream value
|
|
16284
16349
|
* field is not yet captured against a live conversion-tracking account. */
|
|
16285
|
-
conversions:
|
|
16350
|
+
conversions: z57.number().int(),
|
|
16286
16351
|
/** clicks / impressions; null when impressions is 0. */
|
|
16287
|
-
ctr:
|
|
16352
|
+
ctr: z57.number().nullable(),
|
|
16288
16353
|
/** spendMicros / clicks, rounded to integer micros; null when clicks is 0. */
|
|
16289
|
-
cpcMicros:
|
|
16354
|
+
cpcMicros: z57.number().int().nullable(),
|
|
16290
16355
|
/**
|
|
16291
16356
|
* True when `date` is the ad account's CURRENT local calendar date, so this
|
|
16292
16357
|
* row is a running figure rather than a closed day. The sync re-reads the
|
|
@@ -16299,42 +16364,42 @@ var adsInsightRowDtoSchema = z56.object({
|
|
|
16299
16364
|
* conversion metrics, so the count stays at 0 until the day closes and the
|
|
16300
16365
|
* next sync reads the real figure. Treat it as not yet reported.
|
|
16301
16366
|
*/
|
|
16302
|
-
inProgress:
|
|
16367
|
+
inProgress: z57.boolean()
|
|
16303
16368
|
});
|
|
16304
|
-
var adsInsightsResponseSchema =
|
|
16305
|
-
rows:
|
|
16369
|
+
var adsInsightsResponseSchema = z57.object({
|
|
16370
|
+
rows: z57.array(adsInsightRowDtoSchema),
|
|
16306
16371
|
/** Account currency for rendering spend/cpc; null before the first sync. */
|
|
16307
|
-
currencyCode:
|
|
16308
|
-
});
|
|
16309
|
-
var adsRollupWindowDtoSchema =
|
|
16310
|
-
from:
|
|
16311
|
-
to:
|
|
16312
|
-
inProgressDate:
|
|
16313
|
-
});
|
|
16314
|
-
var adsTotalsDtoSchema =
|
|
16315
|
-
impressions:
|
|
16316
|
-
clicks:
|
|
16317
|
-
spendMicros:
|
|
16318
|
-
conversions:
|
|
16319
|
-
ctr:
|
|
16320
|
-
cpcMicros:
|
|
16321
|
-
});
|
|
16322
|
-
var adsSummaryDtoSchema =
|
|
16323
|
-
connected:
|
|
16324
|
-
displayName:
|
|
16325
|
-
currencyCode:
|
|
16326
|
-
lastSyncedAt:
|
|
16327
|
-
campaignCount:
|
|
16328
|
-
adGroupCount:
|
|
16329
|
-
adCount:
|
|
16372
|
+
currencyCode: z57.string().nullable().optional()
|
|
16373
|
+
});
|
|
16374
|
+
var adsRollupWindowDtoSchema = z57.object({
|
|
16375
|
+
from: z57.string().nullable(),
|
|
16376
|
+
to: z57.string().nullable(),
|
|
16377
|
+
inProgressDate: z57.string().nullable()
|
|
16378
|
+
});
|
|
16379
|
+
var adsTotalsDtoSchema = z57.object({
|
|
16380
|
+
impressions: z57.number().int(),
|
|
16381
|
+
clicks: z57.number().int(),
|
|
16382
|
+
spendMicros: z57.number().int(),
|
|
16383
|
+
conversions: z57.number().int(),
|
|
16384
|
+
ctr: z57.number().nullable(),
|
|
16385
|
+
cpcMicros: z57.number().int().nullable()
|
|
16386
|
+
});
|
|
16387
|
+
var adsSummaryDtoSchema = z57.object({
|
|
16388
|
+
connected: z57.boolean(),
|
|
16389
|
+
displayName: z57.string().nullable().optional(),
|
|
16390
|
+
currencyCode: z57.string().nullable().optional(),
|
|
16391
|
+
lastSyncedAt: z57.string().nullable().optional(),
|
|
16392
|
+
campaignCount: z57.number().int(),
|
|
16393
|
+
adGroupCount: z57.number().int(),
|
|
16394
|
+
adCount: z57.number().int(),
|
|
16330
16395
|
/** Date range the totals cover (oldest/newest rollup date), null when empty. */
|
|
16331
16396
|
window: adsRollupWindowDtoSchema,
|
|
16332
16397
|
/** Campaign-level rollup totals over the window (levels are not summed across). */
|
|
16333
16398
|
totals: adsTotalsDtoSchema
|
|
16334
16399
|
});
|
|
16335
|
-
var adsDeliverySnapshotStatusSchema =
|
|
16400
|
+
var adsDeliverySnapshotStatusSchema = z57.enum(["unavailable", "partial", "complete"]);
|
|
16336
16401
|
var AdsDeliverySnapshotStatuses = adsDeliverySnapshotStatusSchema.enum;
|
|
16337
|
-
var adsDeliverySnapshotIssueSchema =
|
|
16402
|
+
var adsDeliverySnapshotIssueSchema = z57.enum([
|
|
16338
16403
|
"no_ads_connection",
|
|
16339
16404
|
"connection_not_synced",
|
|
16340
16405
|
"no_ads_sync",
|
|
@@ -16345,12 +16410,12 @@ var adsDeliverySnapshotIssueSchema = z56.enum([
|
|
|
16345
16410
|
"source_sync_not_completed"
|
|
16346
16411
|
]);
|
|
16347
16412
|
var AdsDeliverySnapshotIssues = adsDeliverySnapshotIssueSchema.enum;
|
|
16348
|
-
var adsHistoricalCampaignRollupStatusSchema =
|
|
16413
|
+
var adsHistoricalCampaignRollupStatusSchema = z57.enum(["unavailable", "reported"]);
|
|
16349
16414
|
var AdsHistoricalCampaignRollupStatuses = adsHistoricalCampaignRollupStatusSchema.enum;
|
|
16350
16415
|
var AdsDeliveryConfigurationBases = {
|
|
16351
16416
|
storedSnapshot: "stored_ads_snapshot"
|
|
16352
16417
|
};
|
|
16353
|
-
var adsActivityAssessmentStateSchema =
|
|
16418
|
+
var adsActivityAssessmentStateSchema = z57.enum([
|
|
16354
16419
|
"unavailable",
|
|
16355
16420
|
"partial_snapshot",
|
|
16356
16421
|
"metrics_unavailable",
|
|
@@ -16358,76 +16423,76 @@ var adsActivityAssessmentStateSchema = z56.enum([
|
|
|
16358
16423
|
"no_observed_activity"
|
|
16359
16424
|
]);
|
|
16360
16425
|
var AdsActivityAssessmentStates = adsActivityAssessmentStateSchema.enum;
|
|
16361
|
-
var adsDeliveryDiagnosticsAdSchema =
|
|
16362
|
-
id:
|
|
16363
|
-
name:
|
|
16364
|
-
status:
|
|
16365
|
-
reviewStatus:
|
|
16426
|
+
var adsDeliveryDiagnosticsAdSchema = z57.object({
|
|
16427
|
+
id: z57.string(),
|
|
16428
|
+
name: z57.string(),
|
|
16429
|
+
status: z57.string(),
|
|
16430
|
+
reviewStatus: z57.string().nullable()
|
|
16366
16431
|
});
|
|
16367
|
-
var adsDeliveryDiagnosticsAdGroupSchema =
|
|
16368
|
-
id:
|
|
16369
|
-
name:
|
|
16370
|
-
status:
|
|
16371
|
-
billingEventType:
|
|
16372
|
-
maxBidMicros:
|
|
16373
|
-
contextHints:
|
|
16374
|
-
ads:
|
|
16432
|
+
var adsDeliveryDiagnosticsAdGroupSchema = z57.object({
|
|
16433
|
+
id: z57.string(),
|
|
16434
|
+
name: z57.string(),
|
|
16435
|
+
status: z57.string(),
|
|
16436
|
+
billingEventType: z57.union([adsAdGroupBillingEventTypeSchema, z57.null()]),
|
|
16437
|
+
maxBidMicros: z57.number().int().nullable(),
|
|
16438
|
+
contextHints: z57.array(z57.string()),
|
|
16439
|
+
ads: z57.array(adsDeliveryDiagnosticsAdSchema)
|
|
16375
16440
|
});
|
|
16376
|
-
var adsDeliveryDiagnosticsCampaignSchema =
|
|
16377
|
-
id:
|
|
16378
|
-
name:
|
|
16379
|
-
status:
|
|
16380
|
-
biddingType:
|
|
16381
|
-
dailySpendLimitMicros:
|
|
16382
|
-
lifetimeSpendLimitMicros:
|
|
16383
|
-
conversionEventSettingIds:
|
|
16384
|
-
adGroups:
|
|
16385
|
-
});
|
|
16386
|
-
var adsDeliveryDiagnosticsDtoSchema =
|
|
16387
|
-
snapshot:
|
|
16441
|
+
var adsDeliveryDiagnosticsCampaignSchema = z57.object({
|
|
16442
|
+
id: z57.string(),
|
|
16443
|
+
name: z57.string(),
|
|
16444
|
+
status: z57.string(),
|
|
16445
|
+
biddingType: z57.union([adsCampaignBiddingTypeSchema, z57.null()]),
|
|
16446
|
+
dailySpendLimitMicros: z57.number().int().nullable(),
|
|
16447
|
+
lifetimeSpendLimitMicros: z57.number().int().nullable(),
|
|
16448
|
+
conversionEventSettingIds: z57.array(z57.string()),
|
|
16449
|
+
adGroups: z57.array(adsDeliveryDiagnosticsAdGroupSchema)
|
|
16450
|
+
});
|
|
16451
|
+
var adsDeliveryDiagnosticsDtoSchema = z57.object({
|
|
16452
|
+
snapshot: z57.object({
|
|
16388
16453
|
status: adsDeliverySnapshotStatusSchema,
|
|
16389
16454
|
// A union keeps the OpenAPI form explicit enough for the generated SDK to
|
|
16390
16455
|
// retain the complete-snapshot `null` value (rather than narrowing it to
|
|
16391
16456
|
// the issue enum alone).
|
|
16392
|
-
issue:
|
|
16393
|
-
lastSyncedAt:
|
|
16394
|
-
campaignCount:
|
|
16395
|
-
adGroupCount:
|
|
16396
|
-
adCount:
|
|
16397
|
-
sourceSync:
|
|
16398
|
-
runId:
|
|
16457
|
+
issue: z57.union([adsDeliverySnapshotIssueSchema, z57.null()]),
|
|
16458
|
+
lastSyncedAt: z57.string().nullable(),
|
|
16459
|
+
campaignCount: z57.number().int().nonnegative(),
|
|
16460
|
+
adGroupCount: z57.number().int().nonnegative(),
|
|
16461
|
+
adCount: z57.number().int().nonnegative(),
|
|
16462
|
+
sourceSync: z57.object({
|
|
16463
|
+
runId: z57.string(),
|
|
16399
16464
|
status: runStatusSchema
|
|
16400
16465
|
}).nullable()
|
|
16401
16466
|
}),
|
|
16402
|
-
historicalCampaignRollups:
|
|
16467
|
+
historicalCampaignRollups: z57.object({
|
|
16403
16468
|
status: adsHistoricalCampaignRollupStatusSchema,
|
|
16404
16469
|
window: adsRollupWindowDtoSchema,
|
|
16405
16470
|
totals: adsTotalsDtoSchema.nullable()
|
|
16406
16471
|
}),
|
|
16407
|
-
storedConfiguration:
|
|
16408
|
-
basis:
|
|
16409
|
-
connection:
|
|
16410
|
-
status:
|
|
16411
|
-
reviewStatus:
|
|
16412
|
-
integrityReviewStatus:
|
|
16413
|
-
integrityDecision:
|
|
16414
|
-
conversionTrackingConfigured:
|
|
16472
|
+
storedConfiguration: z57.object({
|
|
16473
|
+
basis: z57.literal(AdsDeliveryConfigurationBases.storedSnapshot),
|
|
16474
|
+
connection: z57.object({
|
|
16475
|
+
status: z57.string().nullable(),
|
|
16476
|
+
reviewStatus: z57.string().nullable(),
|
|
16477
|
+
integrityReviewStatus: z57.string().nullable(),
|
|
16478
|
+
integrityDecision: z57.string().nullable(),
|
|
16479
|
+
conversionTrackingConfigured: z57.boolean()
|
|
16415
16480
|
}).nullable(),
|
|
16416
|
-
campaigns:
|
|
16481
|
+
campaigns: z57.array(adsDeliveryDiagnosticsCampaignSchema)
|
|
16417
16482
|
}),
|
|
16418
|
-
assessment:
|
|
16419
|
-
});
|
|
16420
|
-
var adsOperationKeySchema =
|
|
16421
|
-
var adsEntityIdSchema =
|
|
16422
|
-
var adsNameSchema =
|
|
16423
|
-
var adsTimestampSchema =
|
|
16424
|
-
var adsMicrosSchema =
|
|
16425
|
-
var adsSha256Schema =
|
|
16426
|
-
var adsConversionEventSettingIdsSchema =
|
|
16427
|
-
var adsHttpsUrlSchema =
|
|
16483
|
+
assessment: z57.object({ state: adsActivityAssessmentStateSchema })
|
|
16484
|
+
});
|
|
16485
|
+
var adsOperationKeySchema = z57.string().min(8).max(128).regex(/^[\w.:-]+$/, "operationKey may contain letters, numbers, dot, underscore, colon, and hyphen");
|
|
16486
|
+
var adsEntityIdSchema = z57.string().min(1).max(200);
|
|
16487
|
+
var adsNameSchema = z57.string().min(3).max(1e3).refine((value) => value.trim().length > 0);
|
|
16488
|
+
var adsTimestampSchema = z57.number().int().min(946684800).max(4102444800);
|
|
16489
|
+
var adsMicrosSchema = z57.number().int().positive().max(Number.MAX_SAFE_INTEGER);
|
|
16490
|
+
var adsSha256Schema = z57.string().regex(/^[a-f0-9]{64}$/);
|
|
16491
|
+
var adsConversionEventSettingIdsSchema = z57.array(adsEntityIdSchema).max(100).refine((ids) => new Set(ids).size === ids.length, "conversionEventSettingIds must be unique");
|
|
16492
|
+
var adsHttpsUrlSchema = z57.string().url().refine((value) => new URL(value).protocol === "https:", {
|
|
16428
16493
|
message: "URL must use https"
|
|
16429
16494
|
});
|
|
16430
|
-
var adsOperationKindSchema =
|
|
16495
|
+
var adsOperationKindSchema = z57.enum([
|
|
16431
16496
|
"image_upload",
|
|
16432
16497
|
"campaign_create",
|
|
16433
16498
|
"campaign_update",
|
|
@@ -16444,25 +16509,25 @@ var adsOperationKindSchema = z56.enum([
|
|
|
16444
16509
|
"ad_archive"
|
|
16445
16510
|
]);
|
|
16446
16511
|
var AdsOperationKinds = adsOperationKindSchema.enum;
|
|
16447
|
-
var adsOperationStateSchema =
|
|
16512
|
+
var adsOperationStateSchema = z57.enum(["pending", "reconciling", "succeeded", "failed", "unknown"]);
|
|
16448
16513
|
var AdsOperationStates = adsOperationStateSchema.enum;
|
|
16449
|
-
var adsReconcileStrategySchema =
|
|
16514
|
+
var adsReconcileStrategySchema = z57.enum(["known_entity", "create_fingerprint", "manual_only"]);
|
|
16450
16515
|
var AdsReconcileStrategies = adsReconcileStrategySchema.enum;
|
|
16451
|
-
var adsUnresolvedOperationStateSchema =
|
|
16516
|
+
var adsUnresolvedOperationStateSchema = z57.enum([
|
|
16452
16517
|
AdsOperationStates.pending,
|
|
16453
16518
|
AdsOperationStates.unknown,
|
|
16454
16519
|
AdsOperationStates.reconciling
|
|
16455
16520
|
]);
|
|
16456
16521
|
var AdsUnresolvedOperationStates = adsUnresolvedOperationStateSchema.enum;
|
|
16457
|
-
var adsEntityStatusSchema =
|
|
16522
|
+
var adsEntityStatusSchema = z57.enum(["active", "paused", "archived"]);
|
|
16458
16523
|
var AdsEntityStatuses = adsEntityStatusSchema.enum;
|
|
16459
|
-
var adsEntityTypeSchema =
|
|
16524
|
+
var adsEntityTypeSchema = z57.enum(["file", "campaign", "ad_group", "ad"]);
|
|
16460
16525
|
var AdsEntityTypes = adsEntityTypeSchema.enum;
|
|
16461
|
-
var adsActivationEntityTypeSchema =
|
|
16526
|
+
var adsActivationEntityTypeSchema = z57.enum(["campaign", "ad_group", "ad"]);
|
|
16462
16527
|
var AdsActivationEntityTypes = adsActivationEntityTypeSchema.enum;
|
|
16463
|
-
var adsActivationEntityRefSchema =
|
|
16528
|
+
var adsActivationEntityRefSchema = z57.object({
|
|
16464
16529
|
id: adsEntityIdSchema,
|
|
16465
|
-
expectedUpdatedAt:
|
|
16530
|
+
expectedUpdatedAt: z57.number().int().nonnegative()
|
|
16466
16531
|
}).strict();
|
|
16467
16532
|
var adsActivationAdSchema = adsActivationEntityRefSchema;
|
|
16468
16533
|
var ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES = 1e3;
|
|
@@ -16474,10 +16539,10 @@ function countAdsActivationManifestEntities(manifest) {
|
|
|
16474
16539
|
);
|
|
16475
16540
|
}
|
|
16476
16541
|
var adsActivationAdGroupSchema = adsActivationEntityRefSchema.extend({
|
|
16477
|
-
ads:
|
|
16542
|
+
ads: z57.array(adsActivationAdSchema).min(1).max(ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES - 1)
|
|
16478
16543
|
}).strict();
|
|
16479
16544
|
var adsActivationCampaignSchema = adsActivationEntityRefSchema.extend({
|
|
16480
|
-
adGroups:
|
|
16545
|
+
adGroups: z57.array(adsActivationAdGroupSchema).min(1).max(ADS_ACTIVATION_ABSOLUTE_MAX_ENTITIES - 1)
|
|
16481
16546
|
}).strict();
|
|
16482
16547
|
function compareAdsActivationEntityIds(left, right) {
|
|
16483
16548
|
if (left < right) return -1;
|
|
@@ -16496,7 +16561,7 @@ function addCanonicalEntityOrderIssue(items, path, ctx) {
|
|
|
16496
16561
|
}
|
|
16497
16562
|
}
|
|
16498
16563
|
}
|
|
16499
|
-
var adsActivationManifestSchema =
|
|
16564
|
+
var adsActivationManifestSchema = z57.object({
|
|
16500
16565
|
campaign: adsActivationCampaignSchema
|
|
16501
16566
|
}).strict().superRefine((manifest, ctx) => {
|
|
16502
16567
|
const entityCount = countAdsActivationManifestEntities(manifest);
|
|
@@ -16539,7 +16604,7 @@ function canonicalizeAdsActivationManifest(manifest) {
|
|
|
16539
16604
|
};
|
|
16540
16605
|
}
|
|
16541
16606
|
var adsActivationManifestHashSchema = adsSha256Schema;
|
|
16542
|
-
var adsActivationGrantStateSchema =
|
|
16607
|
+
var adsActivationGrantStateSchema = z57.enum([
|
|
16543
16608
|
"approved",
|
|
16544
16609
|
"executing",
|
|
16545
16610
|
"consumed",
|
|
@@ -16548,7 +16613,7 @@ var adsActivationGrantStateSchema = z56.enum([
|
|
|
16548
16613
|
"unknown"
|
|
16549
16614
|
]);
|
|
16550
16615
|
var AdsActivationGrantStates = adsActivationGrantStateSchema.enum;
|
|
16551
|
-
var adsOperationStepStateSchema =
|
|
16616
|
+
var adsOperationStepStateSchema = z57.enum([
|
|
16552
16617
|
"pending",
|
|
16553
16618
|
"executing",
|
|
16554
16619
|
"active",
|
|
@@ -16559,35 +16624,35 @@ var adsOperationStepStateSchema = z56.enum([
|
|
|
16559
16624
|
"unknown"
|
|
16560
16625
|
]);
|
|
16561
16626
|
var AdsOperationStepStates = adsOperationStepStateSchema.enum;
|
|
16562
|
-
var adsReconcileFieldsSchema =
|
|
16627
|
+
var adsReconcileFieldsSchema = z57.object({
|
|
16563
16628
|
name: adsNameSchema.optional(),
|
|
16564
|
-
description:
|
|
16629
|
+
description: z57.string().max(4e3).nullable().optional(),
|
|
16565
16630
|
status: adsEntityStatusSchema.optional(),
|
|
16566
16631
|
startTime: adsTimestampSchema.nullable().optional(),
|
|
16567
16632
|
endTime: adsTimestampSchema.nullable().optional(),
|
|
16568
16633
|
lifetimeSpendLimitMicros: adsMicrosSchema.min(1e6).optional(),
|
|
16569
|
-
locationIds:
|
|
16634
|
+
locationIds: z57.array(adsEntityIdSchema).max(100).optional(),
|
|
16570
16635
|
biddingType: adsCampaignBiddingTypeSchema.optional(),
|
|
16571
16636
|
conversionEventSettingIds: adsConversionEventSettingIdsSchema.optional(),
|
|
16572
16637
|
campaignId: adsEntityIdSchema.optional(),
|
|
16573
|
-
contextHints:
|
|
16638
|
+
contextHints: z57.array(z57.string().min(1).max(1e3)).max(100).optional(),
|
|
16574
16639
|
maxBidMicros: adsMicrosSchema.max(1e8).optional(),
|
|
16575
16640
|
billingEventType: adsAdGroupBillingEventTypeSchema.optional(),
|
|
16576
16641
|
adGroupId: adsEntityIdSchema.optional(),
|
|
16577
16642
|
creativeFingerprint: adsSha256Schema.optional()
|
|
16578
16643
|
}).strict();
|
|
16579
|
-
var adsImageUploadRequestSchema =
|
|
16644
|
+
var adsImageUploadRequestSchema = z57.object({
|
|
16580
16645
|
operationKey: adsOperationKeySchema,
|
|
16581
16646
|
imageUrl: adsHttpsUrlSchema
|
|
16582
16647
|
});
|
|
16583
|
-
var adsCampaignCreateRequestSchema =
|
|
16648
|
+
var adsCampaignCreateRequestSchema = z57.object({
|
|
16584
16649
|
operationKey: adsOperationKeySchema,
|
|
16585
16650
|
name: adsNameSchema,
|
|
16586
|
-
description:
|
|
16651
|
+
description: z57.string().max(4e3).optional(),
|
|
16587
16652
|
startTime: adsTimestampSchema.optional(),
|
|
16588
16653
|
endTime: adsTimestampSchema.optional(),
|
|
16589
16654
|
lifetimeSpendLimitMicros: adsMicrosSchema.min(1e6),
|
|
16590
|
-
locationIds:
|
|
16655
|
+
locationIds: z57.array(adsEntityIdSchema).min(1).max(100),
|
|
16591
16656
|
// biddingType is BILLING (what the account pays for) and is immutable once
|
|
16592
16657
|
// the provider creates the campaign. conversionEventSettingIds is
|
|
16593
16658
|
// OPTIMIZATION (what delivery is steered toward). The two are independent,
|
|
@@ -16600,22 +16665,22 @@ var adsCampaignCreateRequestSchema = z56.object({
|
|
|
16600
16665
|
ctx.addIssue({ code: "custom", path: ["endTime"], message: "endTime must be after startTime" });
|
|
16601
16666
|
}
|
|
16602
16667
|
});
|
|
16603
|
-
var adsAdGroupCreateRequestSchema =
|
|
16668
|
+
var adsAdGroupCreateRequestSchema = z57.object({
|
|
16604
16669
|
operationKey: adsOperationKeySchema,
|
|
16605
16670
|
campaignId: adsEntityIdSchema,
|
|
16606
16671
|
name: adsNameSchema,
|
|
16607
|
-
description:
|
|
16608
|
-
contextHints:
|
|
16672
|
+
description: z57.string().max(4e3).optional(),
|
|
16673
|
+
contextHints: z57.array(z57.string().min(1).max(1e3)).min(1).max(100),
|
|
16609
16674
|
maxBidMicros: adsMicrosSchema.max(1e8),
|
|
16610
16675
|
billingEventType: adsAdGroupBillingEventTypeSchema.optional()
|
|
16611
16676
|
});
|
|
16612
|
-
var adsChatCardCreativeRequestSchema =
|
|
16613
|
-
title:
|
|
16614
|
-
body:
|
|
16677
|
+
var adsChatCardCreativeRequestSchema = z57.object({
|
|
16678
|
+
title: z57.string().min(3).max(50),
|
|
16679
|
+
body: z57.string().min(1).max(100),
|
|
16615
16680
|
targetUrl: adsHttpsUrlSchema,
|
|
16616
16681
|
fileId: adsEntityIdSchema
|
|
16617
16682
|
});
|
|
16618
|
-
var adsAdCreateRequestSchema =
|
|
16683
|
+
var adsAdCreateRequestSchema = z57.object({
|
|
16619
16684
|
operationKey: adsOperationKeySchema,
|
|
16620
16685
|
adGroupId: adsEntityIdSchema,
|
|
16621
16686
|
name: adsNameSchema,
|
|
@@ -16624,62 +16689,62 @@ var adsAdCreateRequestSchema = z56.object({
|
|
|
16624
16689
|
function hasMutationField(value) {
|
|
16625
16690
|
return Object.keys(value).some((key) => key !== "operationKey" && key !== "expectedUpdatedAt");
|
|
16626
16691
|
}
|
|
16627
|
-
var adsCampaignUpdateRequestSchema =
|
|
16692
|
+
var adsCampaignUpdateRequestSchema = z57.object({
|
|
16628
16693
|
operationKey: adsOperationKeySchema,
|
|
16629
|
-
expectedUpdatedAt:
|
|
16694
|
+
expectedUpdatedAt: z57.number().int().nonnegative(),
|
|
16630
16695
|
name: adsNameSchema.optional(),
|
|
16631
|
-
description:
|
|
16696
|
+
description: z57.string().max(4e3).nullable().optional(),
|
|
16632
16697
|
startTime: adsTimestampSchema.nullable().optional(),
|
|
16633
16698
|
endTime: adsTimestampSchema.nullable().optional(),
|
|
16634
16699
|
lifetimeSpendLimitMicros: adsMicrosSchema.min(1e6).optional(),
|
|
16635
|
-
locationIds:
|
|
16700
|
+
locationIds: z57.array(adsEntityIdSchema).min(1).max(100).optional()
|
|
16636
16701
|
}).refine(hasMutationField, { message: "At least one campaign field must be updated" });
|
|
16637
|
-
var adsAdGroupUpdateRequestSchema =
|
|
16702
|
+
var adsAdGroupUpdateRequestSchema = z57.object({
|
|
16638
16703
|
operationKey: adsOperationKeySchema,
|
|
16639
|
-
expectedUpdatedAt:
|
|
16704
|
+
expectedUpdatedAt: z57.number().int().nonnegative(),
|
|
16640
16705
|
name: adsNameSchema.optional(),
|
|
16641
|
-
description:
|
|
16642
|
-
contextHints:
|
|
16706
|
+
description: z57.string().max(4e3).nullable().optional(),
|
|
16707
|
+
contextHints: z57.array(z57.string().min(1).max(1e3)).min(1).max(100).optional(),
|
|
16643
16708
|
maxBidMicros: adsMicrosSchema.max(1e8).optional()
|
|
16644
16709
|
}).refine(hasMutationField, { message: "At least one ad group field must be updated" });
|
|
16645
|
-
var adsAdUpdateRequestSchema =
|
|
16710
|
+
var adsAdUpdateRequestSchema = z57.object({
|
|
16646
16711
|
operationKey: adsOperationKeySchema,
|
|
16647
|
-
expectedUpdatedAt:
|
|
16712
|
+
expectedUpdatedAt: z57.number().int().nonnegative(),
|
|
16648
16713
|
name: adsNameSchema.optional(),
|
|
16649
16714
|
creative: adsChatCardCreativeRequestSchema.optional()
|
|
16650
16715
|
}).refine(hasMutationField, { message: "At least one ad field must be updated" });
|
|
16651
|
-
var adsPauseRequestSchema =
|
|
16716
|
+
var adsPauseRequestSchema = z57.object({
|
|
16652
16717
|
operationKey: adsOperationKeySchema
|
|
16653
16718
|
});
|
|
16654
|
-
var adsArchiveRequestSchema =
|
|
16719
|
+
var adsArchiveRequestSchema = z57.object({
|
|
16655
16720
|
operationKey: adsOperationKeySchema,
|
|
16656
|
-
expectedUpdatedAt:
|
|
16721
|
+
expectedUpdatedAt: z57.number().int().nonnegative()
|
|
16657
16722
|
});
|
|
16658
|
-
var adsOperationDtoSchema =
|
|
16659
|
-
id:
|
|
16660
|
-
adAccountId:
|
|
16661
|
-
operationKey:
|
|
16723
|
+
var adsOperationDtoSchema = z57.object({
|
|
16724
|
+
id: z57.string(),
|
|
16725
|
+
adAccountId: z57.string().nullable(),
|
|
16726
|
+
operationKey: z57.string(),
|
|
16662
16727
|
kind: adsOperationKindSchema,
|
|
16663
16728
|
state: adsOperationStateSchema,
|
|
16664
|
-
entityType:
|
|
16665
|
-
entityId:
|
|
16666
|
-
upstreamUpdatedAt:
|
|
16667
|
-
errorCode:
|
|
16668
|
-
errorMessage:
|
|
16669
|
-
reconcileStrategy:
|
|
16729
|
+
entityType: z57.union([adsEntityTypeSchema, z57.null()]),
|
|
16730
|
+
entityId: z57.string().nullable(),
|
|
16731
|
+
upstreamUpdatedAt: z57.number().int().nullable(),
|
|
16732
|
+
errorCode: z57.string().nullable(),
|
|
16733
|
+
errorMessage: z57.string().nullable(),
|
|
16734
|
+
reconcileStrategy: z57.union([adsReconcileStrategySchema, z57.null()]),
|
|
16670
16735
|
reconcileParentId: adsEntityIdSchema.nullable(),
|
|
16671
16736
|
reconcileFingerprint: adsSha256Schema.nullable(),
|
|
16672
16737
|
reconcileFields: adsReconcileFieldsSchema.nullable(),
|
|
16673
|
-
reconcileAttempts:
|
|
16674
|
-
lastReconciledAt:
|
|
16675
|
-
createdAt:
|
|
16676
|
-
updatedAt:
|
|
16738
|
+
reconcileAttempts: z57.number().int().nonnegative(),
|
|
16739
|
+
lastReconciledAt: z57.string().nullable(),
|
|
16740
|
+
createdAt: z57.string(),
|
|
16741
|
+
updatedAt: z57.string()
|
|
16677
16742
|
});
|
|
16678
|
-
var adsOperationResponseSchema =
|
|
16743
|
+
var adsOperationResponseSchema = z57.object({
|
|
16679
16744
|
operation: adsOperationDtoSchema,
|
|
16680
|
-
replayed:
|
|
16745
|
+
replayed: z57.boolean()
|
|
16681
16746
|
});
|
|
16682
|
-
var adsActivationIsoTimestampSchema =
|
|
16747
|
+
var adsActivationIsoTimestampSchema = z57.iso.datetime({ offset: true });
|
|
16683
16748
|
var adsActivationGrantBaseShape = {
|
|
16684
16749
|
id: adsEntityIdSchema,
|
|
16685
16750
|
projectId: adsEntityIdSchema,
|
|
@@ -16694,61 +16759,61 @@ var adsActivationGrantBaseShape = {
|
|
|
16694
16759
|
updatedAt: adsActivationIsoTimestampSchema,
|
|
16695
16760
|
revocationRequestedAt: adsActivationIsoTimestampSchema.nullable()
|
|
16696
16761
|
};
|
|
16697
|
-
var adsActivationGrantApprovedDtoSchema =
|
|
16762
|
+
var adsActivationGrantApprovedDtoSchema = z57.object({
|
|
16698
16763
|
...adsActivationGrantBaseShape,
|
|
16699
|
-
state:
|
|
16700
|
-
operationId:
|
|
16701
|
-
executionStartedAt:
|
|
16702
|
-
consumedAt:
|
|
16703
|
-
revokedAt:
|
|
16704
|
-
expiredAt:
|
|
16764
|
+
state: z57.literal(AdsActivationGrantStates.approved),
|
|
16765
|
+
operationId: z57.null(),
|
|
16766
|
+
executionStartedAt: z57.null(),
|
|
16767
|
+
consumedAt: z57.null(),
|
|
16768
|
+
revokedAt: z57.null(),
|
|
16769
|
+
expiredAt: z57.null()
|
|
16705
16770
|
}).strict();
|
|
16706
|
-
var adsActivationGrantExecutingDtoSchema =
|
|
16771
|
+
var adsActivationGrantExecutingDtoSchema = z57.object({
|
|
16707
16772
|
...adsActivationGrantBaseShape,
|
|
16708
|
-
state:
|
|
16773
|
+
state: z57.literal(AdsActivationGrantStates.executing),
|
|
16709
16774
|
operationId: adsEntityIdSchema,
|
|
16710
16775
|
executionStartedAt: adsActivationIsoTimestampSchema,
|
|
16711
|
-
consumedAt:
|
|
16712
|
-
revokedAt:
|
|
16713
|
-
expiredAt:
|
|
16776
|
+
consumedAt: z57.null(),
|
|
16777
|
+
revokedAt: z57.null(),
|
|
16778
|
+
expiredAt: z57.null()
|
|
16714
16779
|
}).strict();
|
|
16715
|
-
var adsActivationGrantConsumedDtoSchema =
|
|
16780
|
+
var adsActivationGrantConsumedDtoSchema = z57.object({
|
|
16716
16781
|
...adsActivationGrantBaseShape,
|
|
16717
|
-
state:
|
|
16782
|
+
state: z57.literal(AdsActivationGrantStates.consumed),
|
|
16718
16783
|
operationId: adsEntityIdSchema,
|
|
16719
16784
|
executionStartedAt: adsActivationIsoTimestampSchema,
|
|
16720
16785
|
consumedAt: adsActivationIsoTimestampSchema,
|
|
16721
|
-
revokedAt:
|
|
16722
|
-
expiredAt:
|
|
16786
|
+
revokedAt: z57.null(),
|
|
16787
|
+
expiredAt: z57.null()
|
|
16723
16788
|
}).strict();
|
|
16724
|
-
var adsActivationGrantRevokedDtoSchema =
|
|
16789
|
+
var adsActivationGrantRevokedDtoSchema = z57.object({
|
|
16725
16790
|
...adsActivationGrantBaseShape,
|
|
16726
|
-
state:
|
|
16727
|
-
operationId:
|
|
16728
|
-
executionStartedAt:
|
|
16729
|
-
consumedAt:
|
|
16791
|
+
state: z57.literal(AdsActivationGrantStates.revoked),
|
|
16792
|
+
operationId: z57.null(),
|
|
16793
|
+
executionStartedAt: z57.null(),
|
|
16794
|
+
consumedAt: z57.null(),
|
|
16730
16795
|
revokedAt: adsActivationIsoTimestampSchema,
|
|
16731
|
-
expiredAt:
|
|
16796
|
+
expiredAt: z57.null()
|
|
16732
16797
|
}).strict();
|
|
16733
|
-
var adsActivationGrantExpiredDtoSchema =
|
|
16798
|
+
var adsActivationGrantExpiredDtoSchema = z57.object({
|
|
16734
16799
|
...adsActivationGrantBaseShape,
|
|
16735
|
-
state:
|
|
16736
|
-
operationId:
|
|
16737
|
-
executionStartedAt:
|
|
16738
|
-
consumedAt:
|
|
16739
|
-
revokedAt:
|
|
16800
|
+
state: z57.literal(AdsActivationGrantStates.expired),
|
|
16801
|
+
operationId: z57.null(),
|
|
16802
|
+
executionStartedAt: z57.null(),
|
|
16803
|
+
consumedAt: z57.null(),
|
|
16804
|
+
revokedAt: z57.null(),
|
|
16740
16805
|
expiredAt: adsActivationIsoTimestampSchema
|
|
16741
16806
|
}).strict();
|
|
16742
|
-
var adsActivationGrantUnknownDtoSchema =
|
|
16807
|
+
var adsActivationGrantUnknownDtoSchema = z57.object({
|
|
16743
16808
|
...adsActivationGrantBaseShape,
|
|
16744
|
-
state:
|
|
16809
|
+
state: z57.literal(AdsActivationGrantStates.unknown),
|
|
16745
16810
|
operationId: adsEntityIdSchema,
|
|
16746
16811
|
executionStartedAt: adsActivationIsoTimestampSchema,
|
|
16747
|
-
consumedAt:
|
|
16748
|
-
revokedAt:
|
|
16749
|
-
expiredAt:
|
|
16812
|
+
consumedAt: z57.null(),
|
|
16813
|
+
revokedAt: z57.null(),
|
|
16814
|
+
expiredAt: z57.null()
|
|
16750
16815
|
}).strict();
|
|
16751
|
-
var adsActivationGrantDtoSchema =
|
|
16816
|
+
var adsActivationGrantDtoSchema = z57.discriminatedUnion("state", [
|
|
16752
16817
|
adsActivationGrantApprovedDtoSchema,
|
|
16753
16818
|
adsActivationGrantExecutingDtoSchema,
|
|
16754
16819
|
adsActivationGrantConsumedDtoSchema,
|
|
@@ -16774,92 +16839,92 @@ var adsActivationGrantDtoSchema = z56.discriminatedUnion("state", [
|
|
|
16774
16839
|
var adsOperationStepBaseShape = {
|
|
16775
16840
|
id: adsEntityIdSchema,
|
|
16776
16841
|
operationId: adsEntityIdSchema,
|
|
16777
|
-
ordinal:
|
|
16842
|
+
ordinal: z57.number().int().nonnegative(),
|
|
16778
16843
|
entityType: adsActivationEntityTypeSchema,
|
|
16779
16844
|
entityId: adsEntityIdSchema,
|
|
16780
|
-
expectedUpdatedAt:
|
|
16845
|
+
expectedUpdatedAt: z57.number().int().nonnegative(),
|
|
16781
16846
|
createdAt: adsActivationIsoTimestampSchema,
|
|
16782
16847
|
updatedAt: adsActivationIsoTimestampSchema
|
|
16783
16848
|
};
|
|
16784
16849
|
var adsOperationStepNoErrorShape = {
|
|
16785
|
-
errorCode:
|
|
16786
|
-
errorMessage:
|
|
16850
|
+
errorCode: z57.null(),
|
|
16851
|
+
errorMessage: z57.null()
|
|
16787
16852
|
};
|
|
16788
16853
|
var adsOperationStepErrorShape = {
|
|
16789
|
-
errorCode:
|
|
16790
|
-
errorMessage:
|
|
16791
|
-
remediation:
|
|
16854
|
+
errorCode: z57.string().min(1).max(100),
|
|
16855
|
+
errorMessage: z57.string().min(1).max(500),
|
|
16856
|
+
remediation: z57.string().min(1).max(500)
|
|
16792
16857
|
};
|
|
16793
|
-
var adsOperationStepPendingDtoSchema =
|
|
16858
|
+
var adsOperationStepPendingDtoSchema = z57.object({
|
|
16794
16859
|
...adsOperationStepBaseShape,
|
|
16795
16860
|
...adsOperationStepNoErrorShape,
|
|
16796
|
-
state:
|
|
16797
|
-
providerUpdatedAt:
|
|
16798
|
-
remediation:
|
|
16799
|
-
startedAt:
|
|
16800
|
-
finishedAt:
|
|
16861
|
+
state: z57.literal(AdsOperationStepStates.pending),
|
|
16862
|
+
providerUpdatedAt: z57.null(),
|
|
16863
|
+
remediation: z57.null(),
|
|
16864
|
+
startedAt: z57.null(),
|
|
16865
|
+
finishedAt: z57.null()
|
|
16801
16866
|
}).strict();
|
|
16802
|
-
var adsOperationStepExecutingDtoSchema =
|
|
16867
|
+
var adsOperationStepExecutingDtoSchema = z57.object({
|
|
16803
16868
|
...adsOperationStepBaseShape,
|
|
16804
16869
|
...adsOperationStepNoErrorShape,
|
|
16805
|
-
state:
|
|
16806
|
-
providerUpdatedAt:
|
|
16807
|
-
remediation:
|
|
16870
|
+
state: z57.literal(AdsOperationStepStates.executing),
|
|
16871
|
+
providerUpdatedAt: z57.null(),
|
|
16872
|
+
remediation: z57.null(),
|
|
16808
16873
|
startedAt: adsActivationIsoTimestampSchema,
|
|
16809
|
-
finishedAt:
|
|
16874
|
+
finishedAt: z57.null()
|
|
16810
16875
|
}).strict();
|
|
16811
|
-
var adsOperationStepActiveDtoSchema =
|
|
16876
|
+
var adsOperationStepActiveDtoSchema = z57.object({
|
|
16812
16877
|
...adsOperationStepBaseShape,
|
|
16813
16878
|
...adsOperationStepNoErrorShape,
|
|
16814
|
-
state:
|
|
16815
|
-
providerUpdatedAt:
|
|
16816
|
-
remediation:
|
|
16879
|
+
state: z57.literal(AdsOperationStepStates.active),
|
|
16880
|
+
providerUpdatedAt: z57.number().int().nonnegative(),
|
|
16881
|
+
remediation: z57.null(),
|
|
16817
16882
|
startedAt: adsActivationIsoTimestampSchema,
|
|
16818
16883
|
finishedAt: adsActivationIsoTimestampSchema
|
|
16819
16884
|
}).strict();
|
|
16820
|
-
var adsOperationStepFailedDtoSchema =
|
|
16885
|
+
var adsOperationStepFailedDtoSchema = z57.object({
|
|
16821
16886
|
...adsOperationStepBaseShape,
|
|
16822
16887
|
...adsOperationStepErrorShape,
|
|
16823
|
-
state:
|
|
16824
|
-
providerUpdatedAt:
|
|
16888
|
+
state: z57.literal(AdsOperationStepStates.failed),
|
|
16889
|
+
providerUpdatedAt: z57.union([z57.number().int().nonnegative(), z57.null()]),
|
|
16825
16890
|
startedAt: adsActivationIsoTimestampSchema,
|
|
16826
16891
|
finishedAt: adsActivationIsoTimestampSchema
|
|
16827
16892
|
}).strict();
|
|
16828
|
-
var adsOperationStepRollbackExecutingDtoSchema =
|
|
16893
|
+
var adsOperationStepRollbackExecutingDtoSchema = z57.object({
|
|
16829
16894
|
...adsOperationStepBaseShape,
|
|
16830
16895
|
...adsOperationStepNoErrorShape,
|
|
16831
|
-
state:
|
|
16832
|
-
providerUpdatedAt:
|
|
16833
|
-
remediation:
|
|
16896
|
+
state: z57.literal(AdsOperationStepStates.rollback_executing),
|
|
16897
|
+
providerUpdatedAt: z57.number().int().nonnegative(),
|
|
16898
|
+
remediation: z57.string().min(1).max(500),
|
|
16834
16899
|
startedAt: adsActivationIsoTimestampSchema,
|
|
16835
|
-
finishedAt:
|
|
16900
|
+
finishedAt: z57.null()
|
|
16836
16901
|
}).strict();
|
|
16837
|
-
var adsOperationStepRolledBackDtoSchema =
|
|
16902
|
+
var adsOperationStepRolledBackDtoSchema = z57.object({
|
|
16838
16903
|
...adsOperationStepBaseShape,
|
|
16839
16904
|
...adsOperationStepNoErrorShape,
|
|
16840
|
-
state:
|
|
16841
|
-
providerUpdatedAt:
|
|
16842
|
-
remediation:
|
|
16905
|
+
state: z57.literal(AdsOperationStepStates.rolled_back),
|
|
16906
|
+
providerUpdatedAt: z57.number().int().nonnegative(),
|
|
16907
|
+
remediation: z57.string().min(1).max(500),
|
|
16843
16908
|
startedAt: adsActivationIsoTimestampSchema,
|
|
16844
16909
|
finishedAt: adsActivationIsoTimestampSchema
|
|
16845
16910
|
}).strict();
|
|
16846
|
-
var adsOperationStepRollbackFailedDtoSchema =
|
|
16911
|
+
var adsOperationStepRollbackFailedDtoSchema = z57.object({
|
|
16847
16912
|
...adsOperationStepBaseShape,
|
|
16848
16913
|
...adsOperationStepErrorShape,
|
|
16849
|
-
state:
|
|
16850
|
-
providerUpdatedAt:
|
|
16914
|
+
state: z57.literal(AdsOperationStepStates.rollback_failed),
|
|
16915
|
+
providerUpdatedAt: z57.number().int().nonnegative(),
|
|
16851
16916
|
startedAt: adsActivationIsoTimestampSchema,
|
|
16852
16917
|
finishedAt: adsActivationIsoTimestampSchema
|
|
16853
16918
|
}).strict();
|
|
16854
|
-
var adsOperationStepUnknownDtoSchema =
|
|
16919
|
+
var adsOperationStepUnknownDtoSchema = z57.object({
|
|
16855
16920
|
...adsOperationStepBaseShape,
|
|
16856
16921
|
...adsOperationStepErrorShape,
|
|
16857
|
-
state:
|
|
16858
|
-
providerUpdatedAt:
|
|
16922
|
+
state: z57.literal(AdsOperationStepStates.unknown),
|
|
16923
|
+
providerUpdatedAt: z57.union([z57.number().int().nonnegative(), z57.null()]),
|
|
16859
16924
|
startedAt: adsActivationIsoTimestampSchema,
|
|
16860
16925
|
finishedAt: adsActivationIsoTimestampSchema
|
|
16861
16926
|
}).strict();
|
|
16862
|
-
var adsOperationStepDtoSchema =
|
|
16927
|
+
var adsOperationStepDtoSchema = z57.discriminatedUnion("state", [
|
|
16863
16928
|
adsOperationStepPendingDtoSchema,
|
|
16864
16929
|
adsOperationStepExecutingDtoSchema,
|
|
16865
16930
|
adsOperationStepActiveDtoSchema,
|
|
@@ -16873,29 +16938,29 @@ var AdsActivationVersionPolicies = {
|
|
|
16873
16938
|
exact: "exact",
|
|
16874
16939
|
refreshSemanticallyUnchanged: "refresh_semantically_unchanged"
|
|
16875
16940
|
};
|
|
16876
|
-
var adsActivationVersionPolicySchema =
|
|
16941
|
+
var adsActivationVersionPolicySchema = z57.enum([
|
|
16877
16942
|
AdsActivationVersionPolicies.exact,
|
|
16878
16943
|
AdsActivationVersionPolicies.refreshSemanticallyUnchanged
|
|
16879
16944
|
]);
|
|
16880
|
-
var adsActivationGrantCreateRequestSchema =
|
|
16945
|
+
var adsActivationGrantCreateRequestSchema = z57.object({
|
|
16881
16946
|
manifest: adsActivationManifestSchema,
|
|
16882
16947
|
executorApiKeyId: adsEntityIdSchema,
|
|
16883
16948
|
expiresAt: adsActivationIsoTimestampSchema,
|
|
16884
16949
|
versionPolicy: adsActivationVersionPolicySchema.default(AdsActivationVersionPolicies.exact)
|
|
16885
16950
|
}).strict();
|
|
16886
|
-
var adsActivationGrantResponseSchema =
|
|
16951
|
+
var adsActivationGrantResponseSchema = z57.object({
|
|
16887
16952
|
grant: adsActivationGrantDtoSchema
|
|
16888
16953
|
}).strict();
|
|
16889
|
-
var adsActivationGrantRevokeRequestSchema =
|
|
16890
|
-
var adsActivateTreeRequestSchema =
|
|
16954
|
+
var adsActivationGrantRevokeRequestSchema = z57.object({}).strict();
|
|
16955
|
+
var adsActivateTreeRequestSchema = z57.object({
|
|
16891
16956
|
operationKey: adsOperationKeySchema,
|
|
16892
16957
|
grantId: adsEntityIdSchema,
|
|
16893
16958
|
manifestHash: adsActivationManifestHashSchema
|
|
16894
16959
|
}).strict();
|
|
16895
|
-
var adsActivateTreeResponseSchema =
|
|
16960
|
+
var adsActivateTreeResponseSchema = z57.object({
|
|
16896
16961
|
grant: adsActivationGrantDtoSchema,
|
|
16897
16962
|
operation: adsOperationDtoSchema,
|
|
16898
|
-
steps:
|
|
16963
|
+
steps: z57.array(adsOperationStepDtoSchema)
|
|
16899
16964
|
}).strict();
|
|
16900
16965
|
var adsUnresolvedOperationStatesDefault = [
|
|
16901
16966
|
AdsOperationStates.pending,
|
|
@@ -16914,102 +16979,102 @@ function parseUnresolvedOperationStates(value) {
|
|
|
16914
16979
|
}
|
|
16915
16980
|
return typeof value === "string" ? value.split(",").filter(Boolean) : value;
|
|
16916
16981
|
}
|
|
16917
|
-
var adsUnresolvedOperationListQuerySchema =
|
|
16918
|
-
state:
|
|
16982
|
+
var adsUnresolvedOperationListQuerySchema = z57.object({
|
|
16983
|
+
state: z57.preprocess(
|
|
16919
16984
|
parseUnresolvedOperationStates,
|
|
16920
|
-
|
|
16985
|
+
z57.array(adsUnresolvedOperationStateSchema).min(1).max(3).refine((states) => new Set(states).size === states.length, "state values must be unique")
|
|
16921
16986
|
),
|
|
16922
|
-
limit:
|
|
16923
|
-
cursor:
|
|
16987
|
+
limit: z57.coerce.number().int().min(1).max(200).default(100),
|
|
16988
|
+
cursor: z57.string().min(1).max(1e3).optional()
|
|
16924
16989
|
});
|
|
16925
|
-
var adsUnresolvedOperationListResponseSchema =
|
|
16926
|
-
operations:
|
|
16927
|
-
count:
|
|
16928
|
-
nextCursor:
|
|
16990
|
+
var adsUnresolvedOperationListResponseSchema = z57.object({
|
|
16991
|
+
operations: z57.array(adsOperationDtoSchema),
|
|
16992
|
+
count: z57.number().int().nonnegative(),
|
|
16993
|
+
nextCursor: z57.string().nullable()
|
|
16929
16994
|
});
|
|
16930
|
-
var adsOperationReconcileRequestSchema =
|
|
16931
|
-
var adsOperationReconcileResponseSchema =
|
|
16995
|
+
var adsOperationReconcileRequestSchema = z57.object({}).strict();
|
|
16996
|
+
var adsOperationReconcileResponseSchema = z57.object({
|
|
16932
16997
|
operation: adsOperationDtoSchema,
|
|
16933
|
-
resolved:
|
|
16998
|
+
resolved: z57.boolean()
|
|
16934
16999
|
});
|
|
16935
|
-
var adsLiveDeliveryQuerySchema =
|
|
16936
|
-
campaignId:
|
|
16937
|
-
lookbackDays:
|
|
17000
|
+
var adsLiveDeliveryQuerySchema = z57.object({
|
|
17001
|
+
campaignId: z57.string().min(1).max(200).optional(),
|
|
17002
|
+
lookbackDays: z57.coerce.number().int().min(1).max(30).default(7)
|
|
16938
17003
|
});
|
|
16939
|
-
var adsLiveEntityTypeSchema =
|
|
17004
|
+
var adsLiveEntityTypeSchema = z57.enum(["campaign", "ad_group", "ad"]);
|
|
16940
17005
|
var AdsLiveEntityTypes = adsLiveEntityTypeSchema.enum;
|
|
16941
|
-
var adsLivePresenceSchema =
|
|
17006
|
+
var adsLivePresenceSchema = z57.enum(["both", "live-only", "stored-only"]);
|
|
16942
17007
|
var AdsLivePresences = adsLivePresenceSchema.enum;
|
|
16943
|
-
var adsLiveDeliveryBasisSchema =
|
|
17008
|
+
var adsLiveDeliveryBasisSchema = z57.literal("live-provider-read");
|
|
16944
17009
|
var AdsLiveDeliveryBases = { liveProviderRead: "live-provider-read" };
|
|
16945
|
-
var adsLiveMetricRowSchema =
|
|
16946
|
-
date:
|
|
16947
|
-
startTime:
|
|
16948
|
-
endTime:
|
|
16949
|
-
impressions:
|
|
16950
|
-
clicks:
|
|
16951
|
-
spend:
|
|
16952
|
-
conversions:
|
|
16953
|
-
ctr:
|
|
16954
|
-
cpc:
|
|
16955
|
-
cpm:
|
|
16956
|
-
});
|
|
16957
|
-
var adsLiveMetricValuesSchema =
|
|
16958
|
-
impressions:
|
|
16959
|
-
clicks:
|
|
16960
|
-
spendMicros:
|
|
16961
|
-
conversions:
|
|
16962
|
-
});
|
|
16963
|
-
var adsLiveMetricDeltaSchema =
|
|
16964
|
-
date:
|
|
17010
|
+
var adsLiveMetricRowSchema = z57.object({
|
|
17011
|
+
date: z57.string().nullable(),
|
|
17012
|
+
startTime: z57.number().nullable(),
|
|
17013
|
+
endTime: z57.number().nullable(),
|
|
17014
|
+
impressions: z57.number().nullable(),
|
|
17015
|
+
clicks: z57.number().nullable(),
|
|
17016
|
+
spend: z57.number().nullable(),
|
|
17017
|
+
conversions: z57.number().nullable(),
|
|
17018
|
+
ctr: z57.number().nullable(),
|
|
17019
|
+
cpc: z57.number().nullable(),
|
|
17020
|
+
cpm: z57.number().nullable()
|
|
17021
|
+
});
|
|
17022
|
+
var adsLiveMetricValuesSchema = z57.object({
|
|
17023
|
+
impressions: z57.number().int(),
|
|
17024
|
+
clicks: z57.number().int(),
|
|
17025
|
+
spendMicros: z57.number().int(),
|
|
17026
|
+
conversions: z57.number().int()
|
|
17027
|
+
});
|
|
17028
|
+
var adsLiveMetricDeltaSchema = z57.object({
|
|
17029
|
+
date: z57.string(),
|
|
16965
17030
|
live: adsLiveMetricValuesSchema.nullable(),
|
|
16966
17031
|
stored: adsLiveMetricValuesSchema.nullable(),
|
|
16967
|
-
drifted:
|
|
17032
|
+
drifted: z57.boolean()
|
|
16968
17033
|
});
|
|
16969
|
-
var adsLiveFieldDeltaSchema =
|
|
16970
|
-
field:
|
|
16971
|
-
live:
|
|
16972
|
-
stored:
|
|
17034
|
+
var adsLiveFieldDeltaSchema = z57.object({
|
|
17035
|
+
field: z57.string(),
|
|
17036
|
+
live: z57.string().nullable(),
|
|
17037
|
+
stored: z57.string().nullable()
|
|
16973
17038
|
});
|
|
16974
|
-
var adsLiveEntityStateSchema =
|
|
16975
|
-
name:
|
|
16976
|
-
status:
|
|
16977
|
-
reviewStatus:
|
|
16978
|
-
mode:
|
|
16979
|
-
updatedAt:
|
|
17039
|
+
var adsLiveEntityStateSchema = z57.object({
|
|
17040
|
+
name: z57.string().nullable(),
|
|
17041
|
+
status: z57.string(),
|
|
17042
|
+
reviewStatus: z57.string().nullable(),
|
|
17043
|
+
mode: z57.string().nullable(),
|
|
17044
|
+
updatedAt: z57.number().nullable()
|
|
16980
17045
|
});
|
|
16981
|
-
var adsStoredEntityStateSchema =
|
|
16982
|
-
name:
|
|
16983
|
-
status:
|
|
16984
|
-
reviewStatus:
|
|
16985
|
-
upstreamUpdatedAt:
|
|
16986
|
-
syncedAt:
|
|
17046
|
+
var adsStoredEntityStateSchema = z57.object({
|
|
17047
|
+
name: z57.string(),
|
|
17048
|
+
status: z57.string(),
|
|
17049
|
+
reviewStatus: z57.string().nullable(),
|
|
17050
|
+
upstreamUpdatedAt: z57.number().nullable(),
|
|
17051
|
+
syncedAt: z57.string()
|
|
16987
17052
|
});
|
|
16988
|
-
var adsLiveEntityComparisonSchema =
|
|
17053
|
+
var adsLiveEntityComparisonSchema = z57.object({
|
|
16989
17054
|
entityType: adsLiveEntityTypeSchema,
|
|
16990
|
-
id:
|
|
16991
|
-
parentId:
|
|
17055
|
+
id: z57.string(),
|
|
17056
|
+
parentId: z57.string().nullable(),
|
|
16992
17057
|
presence: adsLivePresenceSchema,
|
|
16993
17058
|
live: adsLiveEntityStateSchema.nullable(),
|
|
16994
17059
|
stored: adsStoredEntityStateSchema.nullable(),
|
|
16995
|
-
fieldDeltas:
|
|
17060
|
+
fieldDeltas: z57.array(adsLiveFieldDeltaSchema),
|
|
16996
17061
|
/** Provider rows, unaggregated. Null for ads (no per-ad insights surface). */
|
|
16997
|
-
liveMetrics:
|
|
16998
|
-
metricDeltas:
|
|
16999
|
-
drifted:
|
|
17062
|
+
liveMetrics: z57.array(adsLiveMetricRowSchema).nullable(),
|
|
17063
|
+
metricDeltas: z57.array(adsLiveMetricDeltaSchema).nullable(),
|
|
17064
|
+
drifted: z57.boolean()
|
|
17000
17065
|
});
|
|
17001
|
-
var adsLiveReadFailureSchema =
|
|
17002
|
-
surface:
|
|
17003
|
-
entityId:
|
|
17004
|
-
upstreamStatus:
|
|
17066
|
+
var adsLiveReadFailureSchema = z57.object({
|
|
17067
|
+
surface: z57.string(),
|
|
17068
|
+
entityId: z57.string().nullable(),
|
|
17069
|
+
upstreamStatus: z57.number().int().nullable()
|
|
17005
17070
|
});
|
|
17006
|
-
var adsLiveDeliveryDtoSchema =
|
|
17071
|
+
var adsLiveDeliveryDtoSchema = z57.object({
|
|
17007
17072
|
basis: adsLiveDeliveryBasisSchema,
|
|
17008
17073
|
/** Instant the live read was issued; the metrics window is measured back from it. */
|
|
17009
|
-
fetchedAt:
|
|
17010
|
-
adAccountId:
|
|
17011
|
-
storedSnapshotSyncedAt:
|
|
17012
|
-
metricsWindow:
|
|
17074
|
+
fetchedAt: z57.string(),
|
|
17075
|
+
adAccountId: z57.string(),
|
|
17076
|
+
storedSnapshotSyncedAt: z57.string().nullable(),
|
|
17077
|
+
metricsWindow: z57.object({ lookbackDays: z57.number().int().positive() }),
|
|
17013
17078
|
/**
|
|
17014
17079
|
* Two different units live here, and confusing them understates the cost of
|
|
17015
17080
|
* this endpoint by two orders of magnitude.
|
|
@@ -17025,28 +17090,28 @@ var adsLiveDeliveryDtoSchema = z56.object({
|
|
|
17025
17090
|
* no observed HTTP-request count: the pagination happens inside the provider
|
|
17026
17091
|
* client, below the injected reader seam, so the route cannot see it.
|
|
17027
17092
|
*/
|
|
17028
|
-
bounds:
|
|
17029
|
-
maxCampaigns:
|
|
17030
|
-
maxAdGroupsPerCampaign:
|
|
17031
|
-
maxAdsPerAdGroup:
|
|
17093
|
+
bounds: z57.object({
|
|
17094
|
+
maxCampaigns: z57.number().int().positive(),
|
|
17095
|
+
maxAdGroupsPerCampaign: z57.number().int().positive(),
|
|
17096
|
+
maxAdsPerAdGroup: z57.number().int().positive(),
|
|
17032
17097
|
/** Budget in logical reader calls, NOT in upstream HTTP requests. */
|
|
17033
|
-
maxReaderCalls:
|
|
17098
|
+
maxReaderCalls: z57.number().int().positive(),
|
|
17034
17099
|
/** Reader calls this read actually issued. Observed, not a bound. */
|
|
17035
|
-
readerCalls:
|
|
17100
|
+
readerCalls: z57.number().int().nonnegative(),
|
|
17036
17101
|
/** Pages one paginated reader call may fetch before the client gives up. */
|
|
17037
|
-
maxPagesPerReaderCall:
|
|
17102
|
+
maxPagesPerReaderCall: z57.number().int().positive(),
|
|
17038
17103
|
/** Worst-case upstream HTTP requests. A documented bound, not an observation. */
|
|
17039
|
-
maxUpstreamHttpRequests:
|
|
17040
|
-
truncated:
|
|
17104
|
+
maxUpstreamHttpRequests: z57.number().int().positive(),
|
|
17105
|
+
truncated: z57.boolean()
|
|
17041
17106
|
}),
|
|
17042
|
-
entities:
|
|
17043
|
-
drift:
|
|
17044
|
-
entitiesCompared:
|
|
17045
|
-
driftedEntities:
|
|
17046
|
-
statusDrifted:
|
|
17047
|
-
metricsDrifted:
|
|
17107
|
+
entities: z57.array(adsLiveEntityComparisonSchema),
|
|
17108
|
+
drift: z57.object({
|
|
17109
|
+
entitiesCompared: z57.number().int().nonnegative(),
|
|
17110
|
+
driftedEntities: z57.number().int().nonnegative(),
|
|
17111
|
+
statusDrifted: z57.number().int().nonnegative(),
|
|
17112
|
+
metricsDrifted: z57.number().int().nonnegative()
|
|
17048
17113
|
}),
|
|
17049
|
-
errors:
|
|
17114
|
+
errors: z57.array(adsLiveReadFailureSchema)
|
|
17050
17115
|
});
|
|
17051
17116
|
function adsCtr(clicks, impressions) {
|
|
17052
17117
|
return impressions > 0 ? clicks / impressions : null;
|
|
@@ -17078,53 +17143,6 @@ function escapeLikePattern(value) {
|
|
|
17078
17143
|
return value.replace(/[\\%_]/g, (match) => `\\${match}`);
|
|
17079
17144
|
}
|
|
17080
17145
|
|
|
17081
|
-
// ../contracts/src/users.ts
|
|
17082
|
-
import { z as z57 } from "zod";
|
|
17083
|
-
var UserRoles = {
|
|
17084
|
-
admin: "admin",
|
|
17085
|
-
viewer: "viewer"
|
|
17086
|
-
};
|
|
17087
|
-
var userRoleSchema = z57.enum(["admin", "viewer"]);
|
|
17088
|
-
var USER_NAME_PATTERN = /^[a-z\d][\w.-]{0,63}$/i;
|
|
17089
|
-
var userNameSchema = z57.string().regex(
|
|
17090
|
-
USER_NAME_PATTERN,
|
|
17091
|
-
"A name may use letters, digits, dots, dashes and underscores, and must start with a letter or digit."
|
|
17092
|
-
);
|
|
17093
|
-
var USER_PASSWORD_MIN_LENGTH = 12;
|
|
17094
|
-
var userPasswordSchema = z57.string().min(
|
|
17095
|
-
USER_PASSWORD_MIN_LENGTH,
|
|
17096
|
-
`A password must be at least ${USER_PASSWORD_MIN_LENGTH} characters.`
|
|
17097
|
-
);
|
|
17098
|
-
function normalizeUserName(name) {
|
|
17099
|
-
return name.trim().toLowerCase();
|
|
17100
|
-
}
|
|
17101
|
-
var userDtoSchema = z57.object({
|
|
17102
|
-
id: z57.string(),
|
|
17103
|
-
name: z57.string(),
|
|
17104
|
-
role: userRoleSchema,
|
|
17105
|
-
createdAt: z57.string(),
|
|
17106
|
-
lastLoginAt: z57.string().nullable()
|
|
17107
|
-
});
|
|
17108
|
-
var userListDtoSchema = z57.object({
|
|
17109
|
-
users: z57.array(userDtoSchema)
|
|
17110
|
-
});
|
|
17111
|
-
var createUserRequestSchema = z57.object({
|
|
17112
|
-
name: userNameSchema,
|
|
17113
|
-
password: userPasswordSchema,
|
|
17114
|
-
role: userRoleSchema
|
|
17115
|
-
});
|
|
17116
|
-
var loginRequestSchema = z57.object({
|
|
17117
|
-
name: z57.string().min(1),
|
|
17118
|
-
password: z57.string().min(1)
|
|
17119
|
-
});
|
|
17120
|
-
var authSessionDtoSchema = z57.object({
|
|
17121
|
-
/** True once at least one account exists, so the dashboard must sign in. */
|
|
17122
|
-
authRequired: z57.boolean(),
|
|
17123
|
-
/** The signed-in person, or null when nobody is signed in. */
|
|
17124
|
-
user: userDtoSchema.pick({ name: true, role: true }).nullable()
|
|
17125
|
-
});
|
|
17126
|
-
var LOGIN_FAILED_MESSAGE = "Incorrect name or password.";
|
|
17127
|
-
|
|
17128
17146
|
// ../contracts/src/embed.ts
|
|
17129
17147
|
var SELF_TOKEN = "'self'";
|
|
17130
17148
|
function normalizeFrameOrigin(raw) {
|
|
@@ -17419,6 +17437,7 @@ export {
|
|
|
17419
17437
|
authInvalid,
|
|
17420
17438
|
forbidden,
|
|
17421
17439
|
quotaExceeded,
|
|
17440
|
+
researchDailyLimitExceeded,
|
|
17422
17441
|
providerError,
|
|
17423
17442
|
providerAuthError,
|
|
17424
17443
|
noProvider,
|
|
@@ -18032,8 +18051,18 @@ export {
|
|
|
18032
18051
|
classifyTrafficPath,
|
|
18033
18052
|
segmentCrawlerHits,
|
|
18034
18053
|
sumInfraHits,
|
|
18054
|
+
UserRoles,
|
|
18055
|
+
USER_PASSWORD_MIN_LENGTH,
|
|
18056
|
+
normalizeUserName,
|
|
18057
|
+
userDtoSchema,
|
|
18058
|
+
userListDtoSchema,
|
|
18059
|
+
createUserRequestSchema,
|
|
18060
|
+
loginRequestSchema,
|
|
18061
|
+
authSessionDtoSchema,
|
|
18062
|
+
LOGIN_FAILED_MESSAGE,
|
|
18035
18063
|
ResearchRunStatuses,
|
|
18036
18064
|
ResearchQueryStatuses,
|
|
18065
|
+
DEFAULT_VIEWER_RESEARCH_DAILY_RUN_LIMIT,
|
|
18037
18066
|
researchRunCreateSchema,
|
|
18038
18067
|
researchRunDetailSchema,
|
|
18039
18068
|
researchRunListSchema,
|
|
@@ -18120,15 +18149,6 @@ export {
|
|
|
18120
18149
|
GOOGLE_MARKETING_LIVE_READ_SCOPE,
|
|
18121
18150
|
GOOGLE_MARKETING_WRITE_SCOPE,
|
|
18122
18151
|
isReadOnlyKey,
|
|
18123
|
-
UserRoles,
|
|
18124
|
-
USER_PASSWORD_MIN_LENGTH,
|
|
18125
|
-
normalizeUserName,
|
|
18126
|
-
userDtoSchema,
|
|
18127
|
-
userListDtoSchema,
|
|
18128
|
-
createUserRequestSchema,
|
|
18129
|
-
loginRequestSchema,
|
|
18130
|
-
authSessionDtoSchema,
|
|
18131
|
-
LOGIN_FAILED_MESSAGE,
|
|
18132
18152
|
splitList,
|
|
18133
18153
|
parseOriginList,
|
|
18134
18154
|
frameAncestorsHeaderValue,
|