@nuxtseo/protocol 0.1.3 → 0.1.5

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.
@@ -1,5 +1,5 @@
1
1
  import { z as schema } from 'zod';
2
- import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1ErrorEnvelope, publicV1MetaClientSchema, publicV1MetaProducerSchema, publicV1StandardRatePolicy, } from './core.js';
2
+ import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, PUBLIC_V1_ROLES, PUBLIC_V1_SCOPES, publicV1ErrorEnvelope, publicV1MetaClientSchema, publicV1MetaProducerSchema, publicV1StandardRatePolicy, } from './core.js';
3
3
  export const usageMeterGroupSchema = schema.enum(['integrations', 'compute', 'capacity']);
4
4
  export const usageUpgradeTierSchema = schema.enum(['free', 'pro', 'lifetime']);
5
5
  export const usagePlanSchema = usageUpgradeTierSchema;
@@ -115,9 +115,128 @@ export const accountUsageOperation = defineOperation({
115
115
  }],
116
116
  },
117
117
  });
118
+ export const accountTokenCredentialSchema = schema.enum(['api_token', 'session']);
119
+ const accountTokenTeamProducerSchema = schema.strictObject({
120
+ id: schema.string().min(1),
121
+ name: schema.string().nullable(),
122
+ plan: usagePlanSchema,
123
+ });
124
+ const accountTokenTeamClientSchema = schema.looseObject({
125
+ id: schema.string().min(1),
126
+ name: schema.string().nullable(),
127
+ plan: usagePlanSchema,
128
+ });
129
+ const accountTokenDetailProducerSchema = schema.strictObject({
130
+ id: schema.string().min(1),
131
+ label: schema.string().nullable(),
132
+ client: schema.string().nullable(),
133
+ createdAt: schema.iso.datetime().nullable(),
134
+ lastUsedAt: schema.iso.datetime().nullable(),
135
+ expiresAt: schema.iso.datetime().nullable(),
136
+ });
137
+ const accountTokenDetailClientSchema = schema.looseObject({
138
+ id: schema.string().min(1),
139
+ label: schema.string().nullable(),
140
+ client: schema.string().nullable(),
141
+ createdAt: schema.iso.datetime().nullable(),
142
+ lastUsedAt: schema.iso.datetime().nullable(),
143
+ expiresAt: schema.iso.datetime().nullable(),
144
+ });
145
+ const accountTokenUserProducerSchema = schema.strictObject({
146
+ id: schema.string().min(1),
147
+ email: schema.string().nullable(),
148
+ });
149
+ const accountTokenUserClientSchema = schema.looseObject({
150
+ id: schema.string().min(1),
151
+ email: schema.string().nullable(),
152
+ });
153
+ export const accountTokenDataSchema = defineResponseObject({
154
+ credential: accountTokenCredentialSchema,
155
+ role: schema.enum(PUBLIC_V1_ROLES),
156
+ scopes: schema.array(schema.enum(PUBLIC_V1_SCOPES)),
157
+ team: accountTokenTeamProducerSchema,
158
+ token: accountTokenDetailProducerSchema.nullable(),
159
+ user: accountTokenUserProducerSchema,
160
+ }, {
161
+ credential: accountTokenCredentialSchema,
162
+ role: schema.enum(PUBLIC_V1_ROLES),
163
+ scopes: schema.array(schema.enum(PUBLIC_V1_SCOPES)),
164
+ team: accountTokenTeamClientSchema,
165
+ token: accountTokenDetailClientSchema.nullable(),
166
+ user: accountTokenUserClientSchema,
167
+ });
168
+ export const accountTokenResponseSchema = defineSuccessEnvelope(accountTokenDataSchema);
169
+ export const accountTokenOperation = defineOperation({
170
+ id: 'account.token',
171
+ method: 'GET',
172
+ path: '/api/v1/account/token',
173
+ visibility: 'public',
174
+ semantics: {
175
+ kind: 'query',
176
+ sideEffects: 'none',
177
+ retry: 'idempotent',
178
+ readConsistency: 'primary',
179
+ },
180
+ auth: {
181
+ credentials: ['session', 'api_token'],
182
+ scopes: ['account:read'],
183
+ minimumRole: 'viewer',
184
+ ownership: 'team',
185
+ },
186
+ request: {
187
+ params: null,
188
+ query: null,
189
+ headers: null,
190
+ body: null,
191
+ },
192
+ responses: { 200: accountTokenResponseSchema },
193
+ errors: ['unauthorized', 'auth_expired', 'forbidden', 'rate_limited', 'contract_violation', 'internal_error'],
194
+ errorResponse: publicV1ErrorEnvelope,
195
+ resources: {
196
+ reads: [{ type: 'account.usage', idFrom: 'team.id' }],
197
+ changes: [],
198
+ },
199
+ policy: {
200
+ rate: publicV1StandardRatePolicy,
201
+ idempotency: { _tag: 'none' },
202
+ entitlement: null,
203
+ meter: null,
204
+ },
205
+ lifecycle: { introduced: '1.0.0' },
206
+ docs: {
207
+ summary: 'Describe the presented credential',
208
+ description: 'Returns the Team, role, granted scopes, and expiry of the credential on this request. It spends no quota and reads no Site.',
209
+ tags: ['Account'],
210
+ examples: [{
211
+ request: {},
212
+ response: {
213
+ status: 200,
214
+ body: {
215
+ data: {
216
+ credential: 'api_token',
217
+ role: 'admin',
218
+ scopes: ['account:read', 'sites:read'],
219
+ team: { id: 'team_01JXYZ', name: 'Example', plan: 'pro' },
220
+ token: {
221
+ id: 'token_01JXYZ',
222
+ label: 'CLI on laptop',
223
+ client: null,
224
+ createdAt: '2026-08-01T00:00:00.000Z',
225
+ lastUsedAt: '2026-08-20T00:00:00.000Z',
226
+ expiresAt: null,
227
+ },
228
+ user: { id: 'user_01JXYZ', email: 'agent@example.com' },
229
+ },
230
+ meta: { requestId: 'req_01JXYZ', version: '1.0' },
231
+ },
232
+ },
233
+ }],
234
+ },
235
+ });
118
236
  export const accountV1Registry = defineRegistry({
119
237
  feature: 'account',
120
238
  operations: {
121
239
  usage: accountUsageOperation,
240
+ token: accountTokenOperation,
122
241
  },
123
242
  });
@@ -47,7 +47,7 @@ export declare const actionSourceSchema: import("./core.js").CompatibleResponseS
47
47
  * Evidence age computed at read time, so a listing cannot present a stale
48
48
  * observation as current work. `verdict` is `aged` past 24 hours. `source`
49
49
  * names which clock answered: `producer` is the sealed collection clock,
50
- * `ticket-observation` is the ticket's own reasserted clock, `none` means no
50
+ * `action-observation` is the action's own reasserted clock, `none` means no
51
51
  * observation clock exists and the verdict is `unknown`.
52
52
  */
53
53
  export declare const actionEvidenceFreshnessSchema: z.ZodObject<{
@@ -59,9 +59,9 @@ export declare const actionEvidenceFreshnessSchema: z.ZodObject<{
59
59
  unknown: "unknown";
60
60
  }>;
61
61
  source: z.ZodEnum<{
62
+ "action-observation": "action-observation";
62
63
  none: "none";
63
64
  producer: "producer";
64
- "ticket-observation": "ticket-observation";
65
65
  }>;
66
66
  confidence: z.ZodEnum<{
67
67
  reasserted: "reasserted";
@@ -69,6 +69,26 @@ export declare const actionEvidenceFreshnessSchema: z.ZodObject<{
69
69
  unknown: "unknown";
70
70
  }>;
71
71
  }, z.core.$strict>;
72
+ export declare const actionEvidenceFreshnessClientSchema: z.ZodObject<{
73
+ observedAt: z.ZodNullable<z.ZodString>;
74
+ ageHours: z.ZodNullable<z.ZodNumber>;
75
+ verdict: z.ZodEnum<{
76
+ aged: "aged";
77
+ recent: "recent";
78
+ unknown: "unknown";
79
+ }>;
80
+ source: z.ZodEnum<{
81
+ "action-observation": "action-observation";
82
+ none: "none";
83
+ producer: "producer";
84
+ "ticket-observation": "ticket-observation";
85
+ }>;
86
+ confidence: z.ZodEnum<{
87
+ reasserted: "reasserted";
88
+ sealed: "sealed";
89
+ unknown: "unknown";
90
+ }>;
91
+ }, z.core.$loose>;
72
92
  export declare const actionEvidenceSummarySchema: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
73
93
  readonly artifactVersion: z.ZodNullable<z.ZodString>;
74
94
  readonly coverage: z.ZodEnum<{
@@ -93,9 +113,9 @@ export declare const actionEvidenceSummarySchema: import("./core.js").Compatible
93
113
  unknown: "unknown";
94
114
  }>;
95
115
  source: z.ZodEnum<{
116
+ "action-observation": "action-observation";
96
117
  none: "none";
97
118
  producer: "producer";
98
- "ticket-observation": "ticket-observation";
99
119
  }>;
100
120
  confidence: z.ZodEnum<{
101
121
  reasserted: "reasserted";
@@ -127,6 +147,7 @@ export declare const actionEvidenceSummarySchema: import("./core.js").Compatible
127
147
  unknown: "unknown";
128
148
  }>;
129
149
  source: z.ZodEnum<{
150
+ "action-observation": "action-observation";
130
151
  none: "none";
131
152
  producer: "producer";
132
153
  "ticket-observation": "ticket-observation";
@@ -136,7 +157,7 @@ export declare const actionEvidenceSummarySchema: import("./core.js").Compatible
136
157
  sealed: "sealed";
137
158
  unknown: "unknown";
138
159
  }>;
139
- }, z.core.$strict>;
160
+ }, z.core.$loose>;
140
161
  }, z.core.$strip>>;
141
162
  export declare const actionListItemSchema: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
142
163
  readonly id: z.ZodString;
@@ -192,9 +213,9 @@ export declare const actionListItemSchema: import("./core.js").CompatibleRespons
192
213
  unknown: "unknown";
193
214
  }>;
194
215
  source: z.ZodEnum<{
216
+ "action-observation": "action-observation";
195
217
  none: "none";
196
218
  producer: "producer";
197
- "ticket-observation": "ticket-observation";
198
219
  }>;
199
220
  confidence: z.ZodEnum<{
200
221
  reasserted: "reasserted";
@@ -268,6 +289,7 @@ export declare const actionListItemSchema: import("./core.js").CompatibleRespons
268
289
  unknown: "unknown";
269
290
  }>;
270
291
  source: z.ZodEnum<{
292
+ "action-observation": "action-observation";
271
293
  none: "none";
272
294
  producer: "producer";
273
295
  "ticket-observation": "ticket-observation";
@@ -277,7 +299,7 @@ export declare const actionListItemSchema: import("./core.js").CompatibleRespons
277
299
  sealed: "sealed";
278
300
  unknown: "unknown";
279
301
  }>;
280
- }, z.core.$strict>;
302
+ }, z.core.$loose>;
281
303
  }, z.core.$strip>;
282
304
  readonly firstSeenAt: z.ZodNullable<z.ZodString>;
283
305
  readonly relatedActionIds: z.ZodArray<z.ZodString>;
@@ -346,9 +368,9 @@ export declare const actionListDataSchema: import("./core.js").CompatibleRespons
346
368
  unknown: "unknown";
347
369
  }>;
348
370
  source: z.ZodEnum<{
371
+ "action-observation": "action-observation";
349
372
  none: "none";
350
373
  producer: "producer";
351
- "ticket-observation": "ticket-observation";
352
374
  }>;
353
375
  confidence: z.ZodEnum<{
354
376
  reasserted: "reasserted";
@@ -431,6 +453,7 @@ export declare const actionListDataSchema: import("./core.js").CompatibleRespons
431
453
  unknown: "unknown";
432
454
  }>;
433
455
  source: z.ZodEnum<{
456
+ "action-observation": "action-observation";
434
457
  none: "none";
435
458
  producer: "producer";
436
459
  "ticket-observation": "ticket-observation";
@@ -440,7 +463,7 @@ export declare const actionListDataSchema: import("./core.js").CompatibleRespons
440
463
  sealed: "sealed";
441
464
  unknown: "unknown";
442
465
  }>;
443
- }, z.core.$strict>;
466
+ }, z.core.$loose>;
444
467
  }, z.core.$strip>;
445
468
  readonly firstSeenAt: z.ZodNullable<z.ZodString>;
446
469
  readonly relatedActionIds: z.ZodArray<z.ZodString>;
@@ -518,9 +541,9 @@ export declare const actionListResponseSchema: import("./core.js").CompatibleRes
518
541
  unknown: "unknown";
519
542
  }>;
520
543
  source: z.ZodEnum<{
544
+ "action-observation": "action-observation";
521
545
  none: "none";
522
546
  producer: "producer";
523
- "ticket-observation": "ticket-observation";
524
547
  }>;
525
548
  confidence: z.ZodEnum<{
526
549
  reasserted: "reasserted";
@@ -609,6 +632,7 @@ export declare const actionListResponseSchema: import("./core.js").CompatibleRes
609
632
  unknown: "unknown";
610
633
  }>;
611
634
  source: z.ZodEnum<{
635
+ "action-observation": "action-observation";
612
636
  none: "none";
613
637
  producer: "producer";
614
638
  "ticket-observation": "ticket-observation";
@@ -618,7 +642,7 @@ export declare const actionListResponseSchema: import("./core.js").CompatibleRes
618
642
  sealed: "sealed";
619
643
  unknown: "unknown";
620
644
  }>;
621
- }, z.core.$strict>;
645
+ }, z.core.$loose>;
622
646
  }, z.core.$strip>;
623
647
  readonly firstSeenAt: z.ZodNullable<z.ZodString>;
624
648
  readonly relatedActionIds: z.ZodArray<z.ZodString>;
@@ -1361,9 +1385,9 @@ export declare const actionListOperation: {
1361
1385
  unknown: "unknown";
1362
1386
  }>;
1363
1387
  source: z.ZodEnum<{
1388
+ "action-observation": "action-observation";
1364
1389
  none: "none";
1365
1390
  producer: "producer";
1366
- "ticket-observation": "ticket-observation";
1367
1391
  }>;
1368
1392
  confidence: z.ZodEnum<{
1369
1393
  reasserted: "reasserted";
@@ -1452,6 +1476,7 @@ export declare const actionListOperation: {
1452
1476
  unknown: "unknown";
1453
1477
  }>;
1454
1478
  source: z.ZodEnum<{
1479
+ "action-observation": "action-observation";
1455
1480
  none: "none";
1456
1481
  producer: "producer";
1457
1482
  "ticket-observation": "ticket-observation";
@@ -1461,7 +1486,7 @@ export declare const actionListOperation: {
1461
1486
  sealed: "sealed";
1462
1487
  unknown: "unknown";
1463
1488
  }>;
1464
- }, z.core.$strict>;
1489
+ }, z.core.$loose>;
1465
1490
  }, z.core.$strip>;
1466
1491
  readonly firstSeenAt: z.ZodNullable<z.ZodString>;
1467
1492
  readonly relatedActionIds: z.ZodArray<z.ZodString>;
@@ -1888,7 +1913,7 @@ export declare const actionShowOperation: {
1888
1913
  readonly request: {
1889
1914
  readonly params: {
1890
1915
  readonly siteId: 'site_01JXYZ';
1891
- readonly actionId: 'ticket_01JXYZ';
1916
+ readonly actionId: 'action_01JXYZ';
1892
1917
  };
1893
1918
  readonly query: {
1894
1919
  readonly limit: 50;
@@ -1898,10 +1923,10 @@ export declare const actionShowOperation: {
1898
1923
  readonly status: 200;
1899
1924
  readonly body: {
1900
1925
  readonly data: {
1901
- readonly id: 'ticket_01JXYZ';
1926
+ readonly id: 'action_01JXYZ';
1902
1927
  readonly status: 'open';
1903
1928
  readonly findingType: 'broken-pages';
1904
- readonly artifactVersion: 'te2:ticket_01JXYZ:scope';
1929
+ readonly artifactVersion: 'te2:action_01JXYZ:scope';
1905
1930
  readonly assessmentId: 'assessment_01JXYZ';
1906
1931
  readonly asOf: '2026-08-10T01:30:00.000Z';
1907
1932
  readonly diagnosis: 'One page returns HTTP 404.';
@@ -2074,17 +2099,17 @@ export declare const actionResolveOperation: {
2074
2099
  readonly request: {
2075
2100
  readonly params: {
2076
2101
  readonly siteId: 'site_01JXYZ';
2077
- readonly actionId: 'ticket_01JXYZ';
2102
+ readonly actionId: 'action_01JXYZ';
2078
2103
  };
2079
2104
  readonly body: {
2080
- readonly artifactVersion: 'te2:ticket_01JXYZ:scope';
2105
+ readonly artifactVersion: 'te2:action_01JXYZ:scope';
2081
2106
  };
2082
2107
  };
2083
2108
  readonly response: {
2084
2109
  readonly status: 200;
2085
2110
  readonly body: {
2086
2111
  readonly data: {
2087
- readonly actionId: 'ticket_01JXYZ';
2112
+ readonly actionId: 'action_01JXYZ';
2088
2113
  readonly status: 'open';
2089
2114
  readonly verification: 'recheck-queued';
2090
2115
  };
@@ -2183,9 +2208,9 @@ export declare const actionsV1Registry: import("./core.js").PublicV1Registry<{
2183
2208
  unknown: "unknown";
2184
2209
  }>;
2185
2210
  source: z.ZodEnum<{
2211
+ "action-observation": "action-observation";
2186
2212
  none: "none";
2187
2213
  producer: "producer";
2188
- "ticket-observation": "ticket-observation";
2189
2214
  }>;
2190
2215
  confidence: z.ZodEnum<{
2191
2216
  reasserted: "reasserted";
@@ -2274,6 +2299,7 @@ export declare const actionsV1Registry: import("./core.js").PublicV1Registry<{
2274
2299
  unknown: "unknown";
2275
2300
  }>;
2276
2301
  source: z.ZodEnum<{
2302
+ "action-observation": "action-observation";
2277
2303
  none: "none";
2278
2304
  producer: "producer";
2279
2305
  "ticket-observation": "ticket-observation";
@@ -2283,7 +2309,7 @@ export declare const actionsV1Registry: import("./core.js").PublicV1Registry<{
2283
2309
  sealed: "sealed";
2284
2310
  unknown: "unknown";
2285
2311
  }>;
2286
- }, z.core.$strict>;
2312
+ }, z.core.$loose>;
2287
2313
  }, z.core.$strip>;
2288
2314
  readonly firstSeenAt: z.ZodNullable<z.ZodString>;
2289
2315
  readonly relatedActionIds: z.ZodArray<z.ZodString>;
@@ -2710,7 +2736,7 @@ export declare const actionsV1Registry: import("./core.js").PublicV1Registry<{
2710
2736
  readonly request: {
2711
2737
  readonly params: {
2712
2738
  readonly siteId: 'site_01JXYZ';
2713
- readonly actionId: 'ticket_01JXYZ';
2739
+ readonly actionId: 'action_01JXYZ';
2714
2740
  };
2715
2741
  readonly query: {
2716
2742
  readonly limit: 50;
@@ -2720,10 +2746,10 @@ export declare const actionsV1Registry: import("./core.js").PublicV1Registry<{
2720
2746
  readonly status: 200;
2721
2747
  readonly body: {
2722
2748
  readonly data: {
2723
- readonly id: 'ticket_01JXYZ';
2749
+ readonly id: 'action_01JXYZ';
2724
2750
  readonly status: 'open';
2725
2751
  readonly findingType: 'broken-pages';
2726
- readonly artifactVersion: 'te2:ticket_01JXYZ:scope';
2752
+ readonly artifactVersion: 'te2:action_01JXYZ:scope';
2727
2753
  readonly assessmentId: 'assessment_01JXYZ';
2728
2754
  readonly asOf: '2026-08-10T01:30:00.000Z';
2729
2755
  readonly diagnosis: 'One page returns HTTP 404.';
@@ -2896,17 +2922,17 @@ export declare const actionsV1Registry: import("./core.js").PublicV1Registry<{
2896
2922
  readonly request: {
2897
2923
  readonly params: {
2898
2924
  readonly siteId: 'site_01JXYZ';
2899
- readonly actionId: 'ticket_01JXYZ';
2925
+ readonly actionId: 'action_01JXYZ';
2900
2926
  };
2901
2927
  readonly body: {
2902
- readonly artifactVersion: 'te2:ticket_01JXYZ:scope';
2928
+ readonly artifactVersion: 'te2:action_01JXYZ:scope';
2903
2929
  };
2904
2930
  };
2905
2931
  readonly response: {
2906
2932
  readonly status: 200;
2907
2933
  readonly body: {
2908
2934
  readonly data: {
2909
- readonly actionId: 'ticket_01JXYZ';
2935
+ readonly actionId: 'action_01JXYZ';
2910
2936
  readonly status: 'open';
2911
2937
  readonly verification: 'recheck-queued';
2912
2938
  };
@@ -42,14 +42,21 @@ export const actionSourceSchema = defineResponseObject({ label: schema.string().
42
42
  * Evidence age computed at read time, so a listing cannot present a stale
43
43
  * observation as current work. `verdict` is `aged` past 24 hours. `source`
44
44
  * names which clock answered: `producer` is the sealed collection clock,
45
- * `ticket-observation` is the ticket's own reasserted clock, `none` means no
45
+ * `action-observation` is the action's own reasserted clock, `none` means no
46
46
  * observation clock exists and the verdict is `unknown`.
47
47
  */
48
48
  export const actionEvidenceFreshnessSchema = schema.strictObject({
49
49
  observedAt: schema.string().datetime().nullable(),
50
50
  ageHours: schema.number().int().nonnegative().nullable(),
51
51
  verdict: schema.enum(['recent', 'aged', 'unknown']),
52
- source: schema.enum(['producer', 'ticket-observation', 'none']),
52
+ source: schema.enum(['producer', 'action-observation', 'none']),
53
+ confidence: schema.enum(['sealed', 'reasserted', 'unknown']),
54
+ });
55
+ export const actionEvidenceFreshnessClientSchema = schema.looseObject({
56
+ observedAt: schema.string().datetime().nullable(),
57
+ ageHours: schema.number().int().nonnegative().nullable(),
58
+ verdict: schema.enum(['recent', 'aged', 'unknown']),
59
+ source: schema.enum(['producer', 'action-observation', 'ticket-observation', 'none']),
53
60
  confidence: schema.enum(['sealed', 'reasserted', 'unknown']),
54
61
  });
55
62
  export const actionEvidenceSummarySchema = defineResponseObject({
@@ -71,7 +78,7 @@ export const actionEvidenceSummarySchema = defineResponseObject({
71
78
  groupCount: schema.number().int().nonnegative(),
72
79
  observedAt: schema.string().datetime().nullable(),
73
80
  asOf: schema.string().datetime().nullable(),
74
- freshness: actionEvidenceFreshnessSchema,
81
+ freshness: actionEvidenceFreshnessClientSchema,
75
82
  });
76
83
  export const actionListItemSchema = defineResponseObject({
77
84
  id: schema.string().min(1),
@@ -396,15 +403,15 @@ export const actionShowOperation = defineOperation({
396
403
  description: 'Reads the versioned evidence reviewed before resolving an action. Evidence group cursors are bound to the artifact version.',
397
404
  tags: ['Actions'],
398
405
  examples: [{
399
- request: { params: { siteId: 'site_01JXYZ', actionId: 'ticket_01JXYZ' }, query: { limit: 50 } },
406
+ request: { params: { siteId: 'site_01JXYZ', actionId: 'action_01JXYZ' }, query: { limit: 50 } },
400
407
  response: {
401
408
  status: 200,
402
409
  body: {
403
410
  data: {
404
- id: 'ticket_01JXYZ',
411
+ id: 'action_01JXYZ',
405
412
  status: 'open',
406
413
  findingType: 'broken-pages',
407
- artifactVersion: 'te2:ticket_01JXYZ:scope',
414
+ artifactVersion: 'te2:action_01JXYZ:scope',
408
415
  assessmentId: 'assessment_01JXYZ',
409
416
  asOf: '2026-08-10T01:30:00.000Z',
410
417
  diagnosis: 'One page returns HTTP 404.',
@@ -465,13 +472,13 @@ export const actionResolveOperation = defineOperation({
465
472
  tags: ['Actions'],
466
473
  examples: [{
467
474
  request: {
468
- params: { siteId: 'site_01JXYZ', actionId: 'ticket_01JXYZ' },
469
- body: { artifactVersion: 'te2:ticket_01JXYZ:scope' },
475
+ params: { siteId: 'site_01JXYZ', actionId: 'action_01JXYZ' },
476
+ body: { artifactVersion: 'te2:action_01JXYZ:scope' },
470
477
  },
471
478
  response: {
472
479
  status: 200,
473
480
  body: {
474
- data: { actionId: 'ticket_01JXYZ', status: 'open', verification: 'recheck-queued' },
481
+ data: { actionId: 'action_01JXYZ', status: 'open', verification: 'recheck-queued' },
475
482
  meta: { requestId: 'req_01JXYZ', version: '1.0' },
476
483
  },
477
484
  },
@@ -505,10 +505,12 @@ export declare const backlinksV1Registry: import("./core.js").PublicV1Registry<{
505
505
  }>;
506
506
  export declare const mentionsQuerySchema: z.ZodObject<{
507
507
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
508
- includeFiltered: z.ZodDefault<z.ZodEnum<{
508
+ includeFiltered: z.ZodPipe<z.ZodDefault<z.ZodEnum<{
509
509
  0: "0";
510
510
  1: "1";
511
- }>>;
511
+ false: "false";
512
+ true: "true";
513
+ }>>, z.ZodTransform<boolean, "0" | "1" | "false" | "true">>;
512
514
  }, z.core.$strict>;
513
515
  export declare const mentionSchema: import("./core.js").CompatibleResponseSchema<z.ZodObject<{
514
516
  readonly id: z.ZodString;
@@ -639,10 +641,12 @@ export declare const mentionsListOperation: {
639
641
  }, z.core.$strict>;
640
642
  readonly query: z.ZodObject<{
641
643
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
642
- includeFiltered: z.ZodDefault<z.ZodEnum<{
644
+ includeFiltered: z.ZodPipe<z.ZodDefault<z.ZodEnum<{
643
645
  0: "0";
644
646
  1: "1";
645
- }>>;
647
+ false: "false";
648
+ true: "true";
649
+ }>>, z.ZodTransform<boolean, "0" | "1" | "false" | "true">>;
646
650
  }, z.core.$strict>;
647
651
  readonly headers: null;
648
652
  readonly body: null;
@@ -831,10 +835,12 @@ export declare const mentionsV1Registry: import("./core.js").PublicV1Registry<{
831
835
  }, z.core.$strict>;
832
836
  readonly query: z.ZodObject<{
833
837
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
834
- includeFiltered: z.ZodDefault<z.ZodEnum<{
838
+ includeFiltered: z.ZodPipe<z.ZodDefault<z.ZodEnum<{
835
839
  0: "0";
836
840
  1: "1";
837
- }>>;
841
+ false: "false";
842
+ true: "true";
843
+ }>>, z.ZodTransform<boolean, "0" | "1" | "false" | "true">>;
838
844
  }, z.core.$strict>;
839
845
  readonly headers: null;
840
846
  readonly body: null;
@@ -1,5 +1,5 @@
1
1
  import { z as schema } from 'zod';
2
- import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1ErrorEnvelope, publicV1StandardRatePolicy, } from './core.js';
2
+ import { defineOperation, defineRegistry, defineResponseObject, defineSuccessEnvelope, publicV1BooleanFlag, publicV1ErrorEnvelope, publicV1StandardRatePolicy, } from './core.js';
3
3
  export const backlinksSiteParamsSchema = schema.strictObject({
4
4
  siteId: schema.string().min(1),
5
5
  });
@@ -126,7 +126,7 @@ export const backlinksV1Registry = defineRegistry({
126
126
  });
127
127
  export const mentionsQuerySchema = schema.strictObject({
128
128
  limit: schema.coerce.number().int().min(1).max(200).default(100),
129
- includeFiltered: schema.enum(['0', '1']).default('0'),
129
+ includeFiltered: publicV1BooleanFlag(false),
130
130
  });
131
131
  export const mentionSchema = defineResponseObject({
132
132
  id: schema.string().min(1),
package/dist/v1/core.d.ts CHANGED
@@ -17,10 +17,10 @@ export declare const publicV1StandardRatePolicy: {
17
17
  readonly limit: 50;
18
18
  readonly windowSeconds: 60;
19
19
  };
20
- export declare const PUBLIC_V1_FEATURES: readonly ['account', 'actions', 'analytics', 'audit', 'backlinks', 'content', 'mentions', 'page', 'research', 'sites'];
20
+ export declare const PUBLIC_V1_FEATURES: readonly ['account', 'actions', 'analytics', 'audit', 'backlinks', 'content', 'mentions', 'page', 'research', 'sites', 'timeline'];
21
21
  export declare const PUBLIC_V1_METHODS: readonly ['DELETE', 'GET', 'PATCH', 'POST'];
22
22
  export declare const PUBLIC_V1_CREDENTIALS: readonly ['api_token', 'session'];
23
- export declare const PUBLIC_V1_SCOPES: readonly ['account:read', 'actions:read', 'actions:write', 'analytics:read', 'audit:read', 'content:read', 'content:write', 'page:read', 'page:write', 'research:read', 'research:write', 'sites:read', 'sites:write'];
23
+ export declare const PUBLIC_V1_SCOPES: readonly ['account:read', 'actions:read', 'actions:write', 'analytics:read', 'audit:read', 'content:read', 'content:write', 'page:read', 'page:write', 'research:read', 'research:write', 'sites:read', 'sites:write', 'timeline:read'];
24
24
  export declare const PUBLIC_V1_ROLES: readonly ['viewer', 'member', 'admin', 'owner'];
25
25
  export declare const PUBLIC_V1_ERROR_CODES: readonly ['invalid_request', 'unauthorized', 'forbidden', 'not_found', 'site_ambiguous', 'auth_expired', 'entitlement_required', 'quota_exhausted', 'provider_unavailable', 'stale_evidence', 'conflict', 'rate_limited', 'contract_violation', 'internal_error'];
26
26
  export declare const PUBLIC_V1_ERROR_STATUS: {
@@ -47,7 +47,7 @@ export type PublicV1Role = typeof PUBLIC_V1_ROLES[number];
47
47
  export type PublicV1ErrorCode = typeof PUBLIC_V1_ERROR_CODES[number];
48
48
  export type PublicV1Visibility = 'internal' | 'public';
49
49
  export type PublicV1OwnershipRule = 'principal' | 'site' | 'team';
50
- export type PublicV1ResourceType = 'account.usage' | 'site.actions' | 'site.analytics' | 'site.audit' | 'site.collection' | 'site.content' | 'site.identity' | 'site.page' | 'site.research' | 'site.sitemaps';
50
+ export type PublicV1ResourceType = 'account.usage' | 'site.actions' | 'site.analytics' | 'site.audit' | 'site.collection' | 'site.content' | 'site.identity' | 'site.page' | 'site.research' | 'site.sitemaps' | 'site.timeline';
51
51
  export interface PublicV1ExpectedFailure {
52
52
  _tag: 'ApiFailure';
53
53
  code: PublicV1ErrorCode;
@@ -172,6 +172,23 @@ export declare function defineProtocol<const TRegistries extends Readonly<Record
172
172
  export declare function listOperations<const TProtocol extends PublicV1ProtocolLike>(protocol: TProtocol): PublicV1OperationEntry<TProtocol>[];
173
173
  export declare function defineResponseObject<const TProducerShape extends ZodRawShape, const TClientShape extends ZodRawShape = TProducerShape>(producerShape: TProducerShape, clientShape?: TClientShape): CompatibleResponseSchema<z.ZodObject<TProducerShape>, z.ZodObject<TClientShape>>;
174
174
  export declare function buildOperationPath(operation: PublicV1OperationDefinition, params?: unknown): string;
175
+ /**
176
+ * One boolean query flag, parsed once at the public wire boundary.
177
+ *
178
+ * A query string carries text, so the flag arrives as text. Both spellings a
179
+ * caller is likely to send are accepted, and the schema hands the handler a
180
+ * boolean. Handlers never compare the raw string again: `includeFiltered` used
181
+ * to be declared as `'0' | '1'` and re-tested as `=== '1'` inside its route,
182
+ * which is the same value parsed twice under two types.
183
+ */
184
+ export declare function publicV1BooleanFlag(defaultValue: boolean): z.ZodPipe<z.ZodDefault<z.ZodEnum<{
185
+ 0: "0";
186
+ 1: "1";
187
+ false: "false";
188
+ true: "true";
189
+ }>>, z.ZodTransform<boolean, "0" | "1" | "false" | "true">>;
190
+ /** The canonical wire spelling a client sends for {@link publicV1BooleanFlag}. */
191
+ export declare function publicV1BooleanFlagValue(value: boolean): '0' | '1';
175
192
  export declare const publicV1ErrorDetailsSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
176
193
  export declare const publicV1ErrorProducerSchema: z.ZodObject<{
177
194
  code: z.ZodEnum<{
package/dist/v1/core.js CHANGED
@@ -30,6 +30,7 @@ export const PUBLIC_V1_FEATURES = [
30
30
  'page',
31
31
  'research',
32
32
  'sites',
33
+ 'timeline',
33
34
  ];
34
35
  export const PUBLIC_V1_METHODS = ['DELETE', 'GET', 'PATCH', 'POST'];
35
36
  export const PUBLIC_V1_CREDENTIALS = ['api_token', 'session'];
@@ -47,6 +48,7 @@ export const PUBLIC_V1_SCOPES = [
47
48
  'research:write',
48
49
  'sites:read',
49
50
  'sites:write',
51
+ 'timeline:read',
50
52
  ];
51
53
  export const PUBLIC_V1_ROLES = ['viewer', 'member', 'admin', 'owner'];
52
54
  export const PUBLIC_V1_ERROR_CODES = [
@@ -301,6 +303,24 @@ export function buildOperationPath(operation, params) {
301
303
  return encodeURIComponent(serialized);
302
304
  });
303
305
  }
306
+ /**
307
+ * One boolean query flag, parsed once at the public wire boundary.
308
+ *
309
+ * A query string carries text, so the flag arrives as text. Both spellings a
310
+ * caller is likely to send are accepted, and the schema hands the handler a
311
+ * boolean. Handlers never compare the raw string again: `includeFiltered` used
312
+ * to be declared as `'0' | '1'` and re-tested as `=== '1'` inside its route,
313
+ * which is the same value parsed twice under two types.
314
+ */
315
+ export function publicV1BooleanFlag(defaultValue) {
316
+ return z.enum(['0', '1', 'true', 'false'])
317
+ .default(defaultValue ? '1' : '0')
318
+ .transform(value => value === '1' || value === 'true');
319
+ }
320
+ /** The canonical wire spelling a client sends for {@link publicV1BooleanFlag}. */
321
+ export function publicV1BooleanFlagValue(value) {
322
+ return value ? '1' : '0';
323
+ }
304
324
  export const publicV1ErrorDetailsSchema = z.record(z.string(), z.unknown());
305
325
  export const publicV1ErrorProducerSchema = z.strictObject({
306
326
  code: z.enum(PUBLIC_V1_ERROR_CODES),