@automate.ax/integration-contracts 0.139.2 → 0.142.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/dist/clickup/api.d.ts +76 -0
- package/dist/clickup/api.js +195 -0
- package/dist/clickup/index.d.ts +1921 -0
- package/dist/clickup/index.js +91 -0
- package/dist/clickup/schemas.d.ts +477 -0
- package/dist/clickup/schemas.js +286 -0
- package/dist/closebot/api.d.ts +39 -0
- package/dist/closebot/api.js +117 -0
- package/dist/closebot/index.d.ts +2 -0
- package/dist/closebot/index.js +2 -0
- package/dist/closebot/schemas.d.ts +775 -0
- package/dist/closebot/schemas.js +469 -0
- package/dist/google-ads/api.d.ts +40 -0
- package/dist/google-ads/api.js +109 -0
- package/dist/google-ads/events.d.ts +1155 -0
- package/dist/google-ads/events.js +96 -0
- package/dist/google-ads/index.d.ts +3 -0
- package/dist/google-ads/index.js +3 -0
- package/dist/google-ads/schemas.d.ts +756 -0
- package/dist/google-ads/schemas.js +249 -0
- package/dist/google-drive/index.d.ts +6 -6
- package/dist/linear/schemas.d.ts +3 -3
- package/dist/meta-ads/api.d.ts +90 -0
- package/dist/meta-ads/api.js +260 -0
- package/dist/meta-ads/events.d.ts +391 -0
- package/dist/meta-ads/events.js +193 -0
- package/dist/meta-ads/index.d.ts +3 -0
- package/dist/meta-ads/index.js +3 -0
- package/dist/meta-ads/schemas.d.ts +184 -0
- package/dist/meta-ads/schemas.js +181 -0
- package/dist/notion/schemas.d.ts +84 -84
- package/dist/teams/index.d.ts +20 -20
- package/dist/teams/schemas.d.ts +5 -5
- package/dist/triggers.d.ts +4 -1
- package/package.json +27 -3
- package/src/clickup/api.ts +270 -0
- package/src/clickup/index.ts +108 -0
- package/src/clickup/schemas.ts +324 -0
- package/src/closebot/api.ts +157 -0
- package/src/closebot/index.ts +2 -0
- package/src/closebot/schemas.ts +521 -0
- package/src/google-ads/api.ts +151 -0
- package/src/google-ads/events.ts +131 -0
- package/src/google-ads/index.ts +3 -0
- package/src/google-ads/schemas.ts +270 -0
- package/src/meta-ads/api.ts +327 -0
- package/src/meta-ads/events.ts +218 -0
- package/src/meta-ads/index.ts +3 -0
- package/src/meta-ads/schemas.ts +206 -0
- package/src/triggers.ts +6 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const META_ADS_ID_SCHEMA: z.ZodString;
|
|
3
|
+
export declare const META_ADS_STATUS_SCHEMA: z.ZodEnum<{
|
|
4
|
+
ACTIVE: "ACTIVE";
|
|
5
|
+
ARCHIVED: "ARCHIVED";
|
|
6
|
+
DELETED: "DELETED";
|
|
7
|
+
PAUSED: "PAUSED";
|
|
8
|
+
}>;
|
|
9
|
+
export declare const META_ADS_BUSINESS_SCHEMA: z.ZodObject<{
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
name: z.ZodString;
|
|
12
|
+
verificationStatus: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
14
|
+
export declare const META_ADS_ACCOUNT_SCHEMA: z.ZodObject<{
|
|
15
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
16
|
+
amountSpent: z.ZodOptional<z.ZodString>;
|
|
17
|
+
balance: z.ZodOptional<z.ZodString>;
|
|
18
|
+
business: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
name: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>>;
|
|
22
|
+
currency: z.ZodOptional<z.ZodString>;
|
|
23
|
+
id: z.ZodString;
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
timezoneId: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
timezoneName: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
28
|
+
export declare const META_ADS_CAMPAIGN_SCHEMA: z.ZodObject<{
|
|
29
|
+
buyingType: z.ZodOptional<z.ZodString>;
|
|
30
|
+
configuredStatus: z.ZodOptional<z.ZodString>;
|
|
31
|
+
effectiveStatus: z.ZodOptional<z.ZodString>;
|
|
32
|
+
id: z.ZodString;
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
objective: z.ZodOptional<z.ZodString>;
|
|
35
|
+
specialAdCategories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
36
|
+
status: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
38
|
+
export declare const META_ADS_AD_SET_SCHEMA: z.ZodObject<{
|
|
39
|
+
bidAmount: z.ZodOptional<z.ZodNumber>;
|
|
40
|
+
billingEvent: z.ZodOptional<z.ZodString>;
|
|
41
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
42
|
+
configuredStatus: z.ZodOptional<z.ZodString>;
|
|
43
|
+
dailyBudget: z.ZodOptional<z.ZodString>;
|
|
44
|
+
effectiveStatus: z.ZodOptional<z.ZodString>;
|
|
45
|
+
endTime: z.ZodOptional<z.ZodString>;
|
|
46
|
+
id: z.ZodString;
|
|
47
|
+
lifetimeBudget: z.ZodOptional<z.ZodString>;
|
|
48
|
+
name: z.ZodString;
|
|
49
|
+
optimizationGoal: z.ZodOptional<z.ZodString>;
|
|
50
|
+
startTime: z.ZodOptional<z.ZodString>;
|
|
51
|
+
status: z.ZodOptional<z.ZodString>;
|
|
52
|
+
targeting: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
53
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
54
|
+
export declare const META_ADS_AD_SCHEMA: z.ZodObject<{
|
|
55
|
+
adsetId: z.ZodOptional<z.ZodString>;
|
|
56
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
57
|
+
configuredStatus: z.ZodOptional<z.ZodString>;
|
|
58
|
+
creative: z.ZodOptional<z.ZodObject<{
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>>;
|
|
61
|
+
effectiveStatus: z.ZodOptional<z.ZodString>;
|
|
62
|
+
id: z.ZodString;
|
|
63
|
+
name: z.ZodString;
|
|
64
|
+
status: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
66
|
+
export declare const META_ADS_CREATIVE_SCHEMA: z.ZodObject<{
|
|
67
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
68
|
+
body: z.ZodOptional<z.ZodString>;
|
|
69
|
+
effectiveObjectStoryId: z.ZodOptional<z.ZodString>;
|
|
70
|
+
id: z.ZodString;
|
|
71
|
+
name: z.ZodOptional<z.ZodString>;
|
|
72
|
+
objectStoryId: z.ZodOptional<z.ZodString>;
|
|
73
|
+
status: z.ZodOptional<z.ZodString>;
|
|
74
|
+
title: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
76
|
+
export declare const META_ADS_AUDIENCE_SCHEMA: z.ZodObject<{
|
|
77
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
78
|
+
approximateCountLowerBound: z.ZodOptional<z.ZodNumber>;
|
|
79
|
+
approximateCountUpperBound: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
description: z.ZodOptional<z.ZodString>;
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
name: z.ZodString;
|
|
83
|
+
subtype: z.ZodOptional<z.ZodString>;
|
|
84
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
85
|
+
export declare const META_ADS_LEAD_FORM_SCHEMA: z.ZodObject<{
|
|
86
|
+
id: z.ZodString;
|
|
87
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
88
|
+
name: z.ZodString;
|
|
89
|
+
status: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
91
|
+
export declare const META_ADS_LEAD_SCHEMA: z.ZodObject<{
|
|
92
|
+
adId: z.ZodOptional<z.ZodString>;
|
|
93
|
+
adName: z.ZodOptional<z.ZodString>;
|
|
94
|
+
adsetId: z.ZodOptional<z.ZodString>;
|
|
95
|
+
adsetName: z.ZodOptional<z.ZodString>;
|
|
96
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
97
|
+
campaignName: z.ZodOptional<z.ZodString>;
|
|
98
|
+
createdTime: z.ZodOptional<z.ZodString>;
|
|
99
|
+
fieldData: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
100
|
+
name: z.ZodString;
|
|
101
|
+
values: z.ZodArray<z.ZodString>;
|
|
102
|
+
}, z.core.$strip>>>;
|
|
103
|
+
formId: z.ZodOptional<z.ZodString>;
|
|
104
|
+
id: z.ZodString;
|
|
105
|
+
isOrganic: z.ZodOptional<z.ZodBoolean>;
|
|
106
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
107
|
+
export declare const META_ADS_PIXEL_SCHEMA: z.ZodObject<{
|
|
108
|
+
code: z.ZodOptional<z.ZodString>;
|
|
109
|
+
id: z.ZodString;
|
|
110
|
+
isUnavailable: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
lastFiredTime: z.ZodOptional<z.ZodString>;
|
|
112
|
+
name: z.ZodString;
|
|
113
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
114
|
+
export declare const META_ADS_INSIGHT_SCHEMA: z.ZodObject<{
|
|
115
|
+
accountId: z.ZodOptional<z.ZodString>;
|
|
116
|
+
accountName: z.ZodOptional<z.ZodString>;
|
|
117
|
+
adId: z.ZodOptional<z.ZodString>;
|
|
118
|
+
adName: z.ZodOptional<z.ZodString>;
|
|
119
|
+
adsetId: z.ZodOptional<z.ZodString>;
|
|
120
|
+
adsetName: z.ZodOptional<z.ZodString>;
|
|
121
|
+
campaignId: z.ZodOptional<z.ZodString>;
|
|
122
|
+
campaignName: z.ZodOptional<z.ZodString>;
|
|
123
|
+
clicks: z.ZodOptional<z.ZodString>;
|
|
124
|
+
cpc: z.ZodOptional<z.ZodString>;
|
|
125
|
+
cpm: z.ZodOptional<z.ZodString>;
|
|
126
|
+
ctr: z.ZodOptional<z.ZodString>;
|
|
127
|
+
dateStart: z.ZodOptional<z.ZodString>;
|
|
128
|
+
dateStop: z.ZodOptional<z.ZodString>;
|
|
129
|
+
impressions: z.ZodOptional<z.ZodString>;
|
|
130
|
+
reach: z.ZodOptional<z.ZodString>;
|
|
131
|
+
spend: z.ZodOptional<z.ZodString>;
|
|
132
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
133
|
+
export declare const META_ADS_SUBSCRIPTION_SCHEMA: z.ZodObject<{
|
|
134
|
+
eventType: z.ZodEnum<{
|
|
135
|
+
INSIGHTS_MILESTONE_REACHED: "INSIGHTS_MILESTONE_REACHED";
|
|
136
|
+
INSIGHTS_UPDATED: "INSIGHTS_UPDATED";
|
|
137
|
+
OBJECT_CREATED: "OBJECT_CREATED";
|
|
138
|
+
OBJECT_UPDATED: "OBJECT_UPDATED";
|
|
139
|
+
}>;
|
|
140
|
+
field: z.ZodOptional<z.ZodString>;
|
|
141
|
+
filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
142
|
+
field: z.ZodString;
|
|
143
|
+
operator: z.ZodString;
|
|
144
|
+
value: z.ZodString;
|
|
145
|
+
}, z.core.$strip>>>;
|
|
146
|
+
operator: z.ZodOptional<z.ZodString>;
|
|
147
|
+
status: z.ZodOptional<z.ZodString>;
|
|
148
|
+
subscriptionId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
149
|
+
value: z.ZodOptional<z.ZodString>;
|
|
150
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
151
|
+
export declare const META_ADS_SUBSCRIPTION_CREATE_RESULT_SCHEMA: z.ZodObject<{
|
|
152
|
+
subscriptionId: z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>, z.ZodTransform<string, string | number>>;
|
|
153
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
154
|
+
export declare const META_ADS_MUTATION_RESULT_SCHEMA: z.ZodObject<{
|
|
155
|
+
id: z.ZodOptional<z.ZodString>;
|
|
156
|
+
success: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
158
|
+
export declare const META_ADS_CONVERSION_RESULT_SCHEMA: z.ZodObject<{
|
|
159
|
+
eventsReceived: z.ZodNumber;
|
|
160
|
+
fbtraceId: z.ZodOptional<z.ZodString>;
|
|
161
|
+
messages: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
162
|
+
}, z.core.$catchall<z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>>>;
|
|
163
|
+
export declare const META_ADS_PAGE_INFO_SCHEMA: z.ZodObject<{
|
|
164
|
+
after: z.ZodOptional<z.ZodString>;
|
|
165
|
+
before: z.ZodOptional<z.ZodString>;
|
|
166
|
+
next: z.ZodOptional<z.ZodString>;
|
|
167
|
+
previous: z.ZodOptional<z.ZodString>;
|
|
168
|
+
}, z.core.$strip>;
|
|
169
|
+
export declare const META_ADS_WEBHOOK_CHANGE_SCHEMA: z.ZodObject<{
|
|
170
|
+
field: z.ZodString;
|
|
171
|
+
value: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
172
|
+
}, z.core.$strip>;
|
|
173
|
+
export declare const META_ADS_WEBHOOK_ENVELOPE_SCHEMA: z.ZodObject<{
|
|
174
|
+
entry: z.ZodArray<z.ZodObject<{
|
|
175
|
+
changes: z.ZodArray<z.ZodObject<{
|
|
176
|
+
field: z.ZodString;
|
|
177
|
+
value: z.ZodOptional<z.ZodCustom<import("@automate.ax/codec").Encodable, import("@automate.ax/codec").Encodable>>;
|
|
178
|
+
}, z.core.$strip>>;
|
|
179
|
+
id: z.ZodString;
|
|
180
|
+
time: z.ZodNumber;
|
|
181
|
+
}, z.core.$strip>>;
|
|
182
|
+
object: z.ZodString;
|
|
183
|
+
}, z.core.$strip>;
|
|
184
|
+
export type MetaAdsWebhookEnvelope = z.output<typeof META_ADS_WEBHOOK_ENVELOPE_SCHEMA>;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { encodableSchema } from "@automate.ax/codec";
|
|
3
|
+
const metaObject = (shape) => z.object(shape).catchall(encodableSchema);
|
|
4
|
+
export const META_ADS_ID_SCHEMA = z.string().trim().min(1);
|
|
5
|
+
export const META_ADS_STATUS_SCHEMA = z.enum([
|
|
6
|
+
"ACTIVE",
|
|
7
|
+
"ARCHIVED",
|
|
8
|
+
"DELETED",
|
|
9
|
+
"PAUSED",
|
|
10
|
+
]);
|
|
11
|
+
export const META_ADS_BUSINESS_SCHEMA = metaObject({
|
|
12
|
+
id: META_ADS_ID_SCHEMA,
|
|
13
|
+
name: z.string(),
|
|
14
|
+
verificationStatus: z.string().optional(),
|
|
15
|
+
});
|
|
16
|
+
export const META_ADS_ACCOUNT_SCHEMA = metaObject({
|
|
17
|
+
accountId: z.string().optional(),
|
|
18
|
+
amountSpent: z.string().optional(),
|
|
19
|
+
balance: z.string().optional(),
|
|
20
|
+
business: metaObject({
|
|
21
|
+
id: z.string(),
|
|
22
|
+
name: z.string().optional(),
|
|
23
|
+
}).optional(),
|
|
24
|
+
currency: z.string().optional(),
|
|
25
|
+
id: META_ADS_ID_SCHEMA,
|
|
26
|
+
name: z.string(),
|
|
27
|
+
timezoneId: z.number().optional(),
|
|
28
|
+
timezoneName: z.string().optional(),
|
|
29
|
+
});
|
|
30
|
+
export const META_ADS_CAMPAIGN_SCHEMA = metaObject({
|
|
31
|
+
buyingType: z.string().optional(),
|
|
32
|
+
configuredStatus: z.string().optional(),
|
|
33
|
+
effectiveStatus: z.string().optional(),
|
|
34
|
+
id: META_ADS_ID_SCHEMA,
|
|
35
|
+
name: z.string(),
|
|
36
|
+
objective: z.string().optional(),
|
|
37
|
+
specialAdCategories: z.string().array().optional(),
|
|
38
|
+
status: z.string().optional(),
|
|
39
|
+
});
|
|
40
|
+
export const META_ADS_AD_SET_SCHEMA = metaObject({
|
|
41
|
+
bidAmount: z.number().optional(),
|
|
42
|
+
billingEvent: z.string().optional(),
|
|
43
|
+
campaignId: META_ADS_ID_SCHEMA.optional(),
|
|
44
|
+
configuredStatus: z.string().optional(),
|
|
45
|
+
dailyBudget: z.string().optional(),
|
|
46
|
+
effectiveStatus: z.string().optional(),
|
|
47
|
+
endTime: z.string().optional(),
|
|
48
|
+
id: META_ADS_ID_SCHEMA,
|
|
49
|
+
lifetimeBudget: z.string().optional(),
|
|
50
|
+
name: z.string(),
|
|
51
|
+
optimizationGoal: z.string().optional(),
|
|
52
|
+
startTime: z.string().optional(),
|
|
53
|
+
status: z.string().optional(),
|
|
54
|
+
targeting: z.record(z.string(), encodableSchema).optional(),
|
|
55
|
+
});
|
|
56
|
+
export const META_ADS_AD_SCHEMA = metaObject({
|
|
57
|
+
adsetId: META_ADS_ID_SCHEMA.optional(),
|
|
58
|
+
campaignId: META_ADS_ID_SCHEMA.optional(),
|
|
59
|
+
configuredStatus: z.string().optional(),
|
|
60
|
+
creative: metaObject({ id: z.string() }).optional(),
|
|
61
|
+
effectiveStatus: z.string().optional(),
|
|
62
|
+
id: META_ADS_ID_SCHEMA,
|
|
63
|
+
name: z.string(),
|
|
64
|
+
status: z.string().optional(),
|
|
65
|
+
});
|
|
66
|
+
export const META_ADS_CREATIVE_SCHEMA = metaObject({
|
|
67
|
+
accountId: z.string().optional(),
|
|
68
|
+
body: z.string().optional(),
|
|
69
|
+
effectiveObjectStoryId: z.string().optional(),
|
|
70
|
+
id: META_ADS_ID_SCHEMA,
|
|
71
|
+
name: z.string().optional(),
|
|
72
|
+
objectStoryId: z.string().optional(),
|
|
73
|
+
status: z.string().optional(),
|
|
74
|
+
title: z.string().optional(),
|
|
75
|
+
});
|
|
76
|
+
export const META_ADS_AUDIENCE_SCHEMA = metaObject({
|
|
77
|
+
accountId: z.string().optional(),
|
|
78
|
+
approximateCountLowerBound: z.number().optional(),
|
|
79
|
+
approximateCountUpperBound: z.number().optional(),
|
|
80
|
+
description: z.string().optional(),
|
|
81
|
+
id: META_ADS_ID_SCHEMA,
|
|
82
|
+
name: z.string(),
|
|
83
|
+
subtype: z.string().optional(),
|
|
84
|
+
});
|
|
85
|
+
export const META_ADS_LEAD_FORM_SCHEMA = metaObject({
|
|
86
|
+
id: META_ADS_ID_SCHEMA,
|
|
87
|
+
locale: z.string().optional(),
|
|
88
|
+
name: z.string(),
|
|
89
|
+
status: z.string().optional(),
|
|
90
|
+
});
|
|
91
|
+
export const META_ADS_LEAD_SCHEMA = metaObject({
|
|
92
|
+
adId: z.string().optional(),
|
|
93
|
+
adName: z.string().optional(),
|
|
94
|
+
adsetId: z.string().optional(),
|
|
95
|
+
adsetName: z.string().optional(),
|
|
96
|
+
campaignId: z.string().optional(),
|
|
97
|
+
campaignName: z.string().optional(),
|
|
98
|
+
createdTime: z.string().optional(),
|
|
99
|
+
fieldData: z
|
|
100
|
+
.object({ name: z.string(), values: z.string().array() })
|
|
101
|
+
.array()
|
|
102
|
+
.optional(),
|
|
103
|
+
formId: z.string().optional(),
|
|
104
|
+
id: META_ADS_ID_SCHEMA,
|
|
105
|
+
isOrganic: z.boolean().optional(),
|
|
106
|
+
});
|
|
107
|
+
export const META_ADS_PIXEL_SCHEMA = metaObject({
|
|
108
|
+
code: z.string().optional(),
|
|
109
|
+
id: META_ADS_ID_SCHEMA,
|
|
110
|
+
isUnavailable: z.boolean().optional(),
|
|
111
|
+
lastFiredTime: z.string().optional(),
|
|
112
|
+
name: z.string(),
|
|
113
|
+
});
|
|
114
|
+
export const META_ADS_INSIGHT_SCHEMA = metaObject({
|
|
115
|
+
accountId: z.string().optional(),
|
|
116
|
+
accountName: z.string().optional(),
|
|
117
|
+
adId: z.string().optional(),
|
|
118
|
+
adName: z.string().optional(),
|
|
119
|
+
adsetId: z.string().optional(),
|
|
120
|
+
adsetName: z.string().optional(),
|
|
121
|
+
campaignId: z.string().optional(),
|
|
122
|
+
campaignName: z.string().optional(),
|
|
123
|
+
clicks: z.string().optional(),
|
|
124
|
+
cpc: z.string().optional(),
|
|
125
|
+
cpm: z.string().optional(),
|
|
126
|
+
ctr: z.string().optional(),
|
|
127
|
+
dateStart: z.string().optional(),
|
|
128
|
+
dateStop: z.string().optional(),
|
|
129
|
+
impressions: z.string().optional(),
|
|
130
|
+
reach: z.string().optional(),
|
|
131
|
+
spend: z.string().optional(),
|
|
132
|
+
});
|
|
133
|
+
export const META_ADS_SUBSCRIPTION_SCHEMA = metaObject({
|
|
134
|
+
eventType: z.enum([
|
|
135
|
+
"INSIGHTS_MILESTONE_REACHED",
|
|
136
|
+
"INSIGHTS_UPDATED",
|
|
137
|
+
"OBJECT_CREATED",
|
|
138
|
+
"OBJECT_UPDATED",
|
|
139
|
+
]),
|
|
140
|
+
field: z.string().optional(),
|
|
141
|
+
filters: z
|
|
142
|
+
.object({ field: z.string(), operator: z.string(), value: z.string() })
|
|
143
|
+
.array()
|
|
144
|
+
.optional(),
|
|
145
|
+
operator: z.string().optional(),
|
|
146
|
+
status: z.string().optional(),
|
|
147
|
+
subscriptionId: z.union([META_ADS_ID_SCHEMA, z.number()]).transform(String),
|
|
148
|
+
value: z.string().optional(),
|
|
149
|
+
});
|
|
150
|
+
export const META_ADS_SUBSCRIPTION_CREATE_RESULT_SCHEMA = metaObject({
|
|
151
|
+
subscriptionId: z.union([META_ADS_ID_SCHEMA, z.number()]).transform(String),
|
|
152
|
+
});
|
|
153
|
+
export const META_ADS_MUTATION_RESULT_SCHEMA = metaObject({
|
|
154
|
+
id: z.string().optional(),
|
|
155
|
+
success: z.boolean().optional(),
|
|
156
|
+
});
|
|
157
|
+
export const META_ADS_CONVERSION_RESULT_SCHEMA = metaObject({
|
|
158
|
+
eventsReceived: z.number().int().nonnegative(),
|
|
159
|
+
fbtraceId: z.string().optional(),
|
|
160
|
+
messages: z.string().array().optional(),
|
|
161
|
+
});
|
|
162
|
+
export const META_ADS_PAGE_INFO_SCHEMA = z.object({
|
|
163
|
+
after: z.string().optional(),
|
|
164
|
+
before: z.string().optional(),
|
|
165
|
+
next: z.string().url().optional(),
|
|
166
|
+
previous: z.string().url().optional(),
|
|
167
|
+
});
|
|
168
|
+
export const META_ADS_WEBHOOK_CHANGE_SCHEMA = z.object({
|
|
169
|
+
field: z.string(),
|
|
170
|
+
value: encodableSchema,
|
|
171
|
+
});
|
|
172
|
+
export const META_ADS_WEBHOOK_ENVELOPE_SCHEMA = z.object({
|
|
173
|
+
entry: z
|
|
174
|
+
.object({
|
|
175
|
+
changes: META_ADS_WEBHOOK_CHANGE_SCHEMA.array(),
|
|
176
|
+
id: z.string(),
|
|
177
|
+
time: z.number(),
|
|
178
|
+
})
|
|
179
|
+
.array(),
|
|
180
|
+
object: z.string(),
|
|
181
|
+
});
|