@gscdump/contracts 1.4.1 → 1.4.3

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,15 +1,15 @@
1
1
  import { z } from "zod";
2
2
  declare const GSCDUMP_REALTIME_PROTOCOL_VERSION: 1;
3
- declare const GSCDUMP_REALTIME_SUBPROTOCOL: 'gscdump.v1';
4
- declare const GSCDUMP_REALTIME_TICKET_PREFIX: 'gscdump.ticket.v1';
5
- declare const GSCDUMP_REALTIME_TICKET_ISSUER: 'https://gscdump.com';
6
- declare const GSCDUMP_REALTIME_TICKET_AUDIENCE: 'https://gscdump.com/ws/v1';
7
- declare const GSCDUMP_REALTIME_PING: 'ping';
8
- declare const GSCDUMP_REALTIME_PONG: 'pong';
3
+ declare const GSCDUMP_REALTIME_SUBPROTOCOL: "gscdump.v1";
4
+ declare const GSCDUMP_REALTIME_TICKET_PREFIX: "gscdump.ticket.v1";
5
+ declare const GSCDUMP_REALTIME_TICKET_ISSUER: "https://gscdump.com";
6
+ declare const GSCDUMP_REALTIME_TICKET_AUDIENCE: "https://gscdump.com/ws/v1";
7
+ declare const GSCDUMP_REALTIME_PING: "ping";
8
+ declare const GSCDUMP_REALTIME_PONG: "pong";
9
9
  declare const GSCDUMP_REALTIME_TICKET_TTL_SECONDS: 60;
10
10
  declare const GSCDUMP_REALTIME_MAX_CONNECTION_SECONDS: 900;
11
11
  declare const GSCDUMP_REALTIME_TICKET_POLICY: {
12
- readonly algorithm: 'HMAC-SHA-256';
12
+ readonly algorithm: "HMAC-SHA-256";
13
13
  readonly minimumSigningKeyBytes: 32;
14
14
  readonly jtiRandomBits: 128;
15
15
  readonly maxVerificationKeys: 2;
@@ -27,7 +27,7 @@ declare const GSCDUMP_REALTIME_CONNECTION_POLICY: {
27
27
  readonly staleAfterMs: 75000;
28
28
  readonly reconnectBaseDelayMs: 1000;
29
29
  readonly reconnectMaxDelayMs: 30000;
30
- readonly reconnectJitter: 'equal';
30
+ readonly reconnectJitter: "equal";
31
31
  };
32
32
  declare const GSCDUMP_REALTIME_REPLAY_POLICY: {
33
33
  readonly maxAgeMs: 86400000;
@@ -59,43 +59,43 @@ declare const GSCDUMP_REALTIME_CLOSE_CODES: {
59
59
  readonly overloadedOrAckLag: 1013;
60
60
  readonly maximumLifetime: 4001;
61
61
  };
62
- declare const REALTIME_V1_RESOURCE_TYPES: readonly ['partner.user', 'partner.team', 'user.sites', 'site.registration', 'site.lifecycle', 'site.analytics', 'site.sitemaps', 'site.indexing', 'site.auth'];
63
- declare const REALTIME_V1_EVENT_NAMES: readonly ['user.lifecycle.changed', 'site.lifecycle.changed', 'site.lifecycle.progress', 'site.analytics.ready', 'site.sitemaps.ready', 'site.indexing.ready', 'site.auth.failed', 'site.lifecycle.failed', 'site.registration.changed'];
62
+ declare const REALTIME_V1_RESOURCE_TYPES: readonly ["partner.user", "partner.team", "user.sites", "site.registration", "site.lifecycle", "site.analytics", "site.sitemaps", "site.indexing", "site.auth"];
63
+ declare const REALTIME_V1_EVENT_NAMES: readonly ["user.lifecycle.changed", "site.lifecycle.changed", "site.lifecycle.progress", "site.analytics.ready", "site.sitemaps.ready", "site.indexing.ready", "site.auth.failed", "site.lifecycle.failed", "site.registration.changed"];
64
64
  declare const REALTIME_V1_EVENT_SEMANTICS: {
65
65
  readonly 'user.lifecycle.changed': {
66
- readonly delivery: 'durable';
66
+ readonly delivery: "durable";
67
67
  readonly baseChanges: readonly ["partner.user", "user.sites"];
68
68
  };
69
69
  readonly 'site.lifecycle.changed': {
70
- readonly delivery: 'durable';
70
+ readonly delivery: "durable";
71
71
  readonly baseChanges: readonly ["site.lifecycle"];
72
72
  };
73
73
  readonly 'site.lifecycle.progress': {
74
- readonly delivery: 'ephemeral';
74
+ readonly delivery: "ephemeral";
75
75
  readonly baseChanges: readonly [];
76
76
  };
77
77
  readonly 'site.analytics.ready': {
78
- readonly delivery: 'durable';
78
+ readonly delivery: "durable";
79
79
  readonly baseChanges: readonly ["site.analytics", "site.lifecycle"];
80
80
  };
81
81
  readonly 'site.sitemaps.ready': {
82
- readonly delivery: 'durable';
82
+ readonly delivery: "durable";
83
83
  readonly baseChanges: readonly ["site.sitemaps", "site.lifecycle"];
84
84
  };
85
85
  readonly 'site.indexing.ready': {
86
- readonly delivery: 'durable';
86
+ readonly delivery: "durable";
87
87
  readonly baseChanges: readonly ["site.indexing", "site.lifecycle"];
88
88
  };
89
89
  readonly 'site.auth.failed': {
90
- readonly delivery: 'durable';
90
+ readonly delivery: "durable";
91
91
  readonly baseChanges: readonly ["site.auth", "site.lifecycle"];
92
92
  };
93
93
  readonly 'site.lifecycle.failed': {
94
- readonly delivery: 'durable';
94
+ readonly delivery: "durable";
95
95
  readonly baseChanges: readonly ["site.lifecycle"];
96
96
  };
97
97
  readonly 'site.registration.changed': {
98
- readonly delivery: 'durable';
98
+ readonly delivery: "durable";
99
99
  readonly baseChanges: readonly ["site.registration", "user.sites"];
100
100
  };
101
101
  };
@@ -121,6 +121,25 @@ declare function createRealtimeV1Schemas(): {
121
121
  streamId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
122
122
  sequence: z.ZodString;
123
123
  }, z.core.$strict>;
124
+ ticketResponseClient: z.ZodObject<{
125
+ data: z.ZodObject<{
126
+ socketUrl: z.ZodURL;
127
+ protocol: z.ZodLiteral<"gscdump.v1">;
128
+ protocolVersion: z.ZodLiteral<1>;
129
+ ticket: z.ZodString;
130
+ expiresAt: z.ZodISODateTime;
131
+ head: z.ZodObject<{
132
+ streamId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
133
+ sequence: z.ZodString;
134
+ }, z.core.$loose>;
135
+ maxConnectionSeconds: z.ZodLiteral<900>;
136
+ }, z.core.$loose>;
137
+ meta: z.ZodObject<{
138
+ requestId: z.ZodString;
139
+ surface: z.ZodLiteral<"realtime">;
140
+ version: z.ZodLiteral<"1.0">;
141
+ }, z.core.$loose>;
142
+ }, z.core.$loose>;
124
143
  ticketRequest: z.ZodObject<{
125
144
  origin: z.ZodOptional<z.ZodURL>;
126
145
  }, z.core.$strict>;
@@ -134,31 +153,31 @@ declare function createRealtimeV1Schemas(): {
134
153
  exp: z.ZodNumber;
135
154
  connectionExpiresAt: z.ZodNumber;
136
155
  principalClass: z.ZodEnum<{
137
- partner_key: "partner_key";
138
156
  user_key: "user_key";
157
+ partner_key: "partner_key";
139
158
  }>;
140
159
  principalPublicId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
141
160
  streamId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
142
161
  origin: z.ZodNullable<z.ZodURL>;
143
162
  }, z.core.$strict>;
144
163
  knownResourceType: z.ZodEnum<{
145
- "partner.team": "partner.team";
146
164
  "partner.user": "partner.user";
147
- "site.analytics": "site.analytics";
148
- "site.auth": "site.auth";
149
- "site.indexing": "site.indexing";
150
- "site.lifecycle": "site.lifecycle";
165
+ "partner.team": "partner.team";
166
+ "user.sites": "user.sites";
151
167
  "site.registration": "site.registration";
168
+ "site.lifecycle": "site.lifecycle";
169
+ "site.analytics": "site.analytics";
152
170
  "site.sitemaps": "site.sitemaps";
153
- "user.sites": "user.sites";
171
+ "site.indexing": "site.indexing";
172
+ "site.auth": "site.auth";
154
173
  }>;
155
174
  resourceChange: z.ZodObject<{
156
175
  type: z.ZodString;
157
176
  id: z.ZodString;
158
177
  kind: z.ZodEnum<{
159
178
  created: "created";
160
- deleted: "deleted";
161
179
  updated: "updated";
180
+ deleted: "deleted";
162
181
  }>;
163
182
  }, z.core.$strict>;
164
183
  subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
@@ -175,27 +194,6 @@ declare function createRealtimeV1Schemas(): {
175
194
  id: z.ZodString;
176
195
  }, z.core.$strict>], "type">;
177
196
  durableEvent: z.ZodObject<{
178
- type: z.ZodLiteral<"event">;
179
- protocolVersion: z.ZodLiteral<1>;
180
- eventVersion: z.ZodNumber;
181
- id: z.ZodString;
182
- name: z.ZodString;
183
- subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
184
- type: z.ZodLiteral<"partner">;
185
- id: z.ZodString;
186
- }, z.core.$strict>, z.ZodObject<{
187
- type: z.ZodLiteral<"team">;
188
- id: z.ZodString;
189
- }, z.core.$strict>, z.ZodObject<{
190
- type: z.ZodLiteral<"user">;
191
- id: z.ZodString;
192
- }, z.core.$strict>, z.ZodObject<{
193
- type: z.ZodLiteral<"site">;
194
- id: z.ZodString;
195
- }, z.core.$strict>], "type">;
196
- occurredAt: z.ZodISODateTime;
197
- correlationId: z.ZodNullable<z.ZodString>;
198
- data: z.ZodJSONSchema;
199
197
  cursor: z.ZodObject<{
200
198
  streamId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
201
199
  sequence: z.ZodString;
@@ -205,13 +203,11 @@ declare function createRealtimeV1Schemas(): {
205
203
  id: z.ZodString;
206
204
  kind: z.ZodEnum<{
207
205
  created: "created";
208
- deleted: "deleted";
209
206
  updated: "updated";
207
+ deleted: "deleted";
210
208
  }>;
211
209
  }, z.core.$strict>>;
212
210
  delivery: z.ZodLiteral<"durable">;
213
- }, z.core.$strict>;
214
- ephemeralEvent: z.ZodObject<{
215
211
  type: z.ZodLiteral<"event">;
216
212
  protocolVersion: z.ZodLiteral<1>;
217
213
  eventVersion: z.ZodNumber;
@@ -233,19 +229,19 @@ declare function createRealtimeV1Schemas(): {
233
229
  occurredAt: z.ZodISODateTime;
234
230
  correlationId: z.ZodNullable<z.ZodString>;
235
231
  data: z.ZodJSONSchema;
232
+ }, z.core.$strict>;
233
+ ephemeralEvent: z.ZodObject<{
236
234
  cursor: z.ZodNull;
237
235
  changes: z.ZodArray<z.ZodObject<{
238
236
  type: z.ZodString;
239
237
  id: z.ZodString;
240
238
  kind: z.ZodEnum<{
241
239
  created: "created";
242
- deleted: "deleted";
243
240
  updated: "updated";
241
+ deleted: "deleted";
244
242
  }>;
245
243
  }, z.core.$strict>>;
246
244
  delivery: z.ZodLiteral<"ephemeral">;
247
- }, z.core.$strict>;
248
- event: z.ZodUnion<readonly [z.ZodObject<{
249
245
  type: z.ZodLiteral<"event">;
250
246
  protocolVersion: z.ZodLiteral<1>;
251
247
  eventVersion: z.ZodNumber;
@@ -267,6 +263,8 @@ declare function createRealtimeV1Schemas(): {
267
263
  occurredAt: z.ZodISODateTime;
268
264
  correlationId: z.ZodNullable<z.ZodString>;
269
265
  data: z.ZodJSONSchema;
266
+ }, z.core.$strict>;
267
+ event: z.ZodUnion<readonly [z.ZodObject<{
270
268
  cursor: z.ZodObject<{
271
269
  streamId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
272
270
  sequence: z.ZodString;
@@ -276,12 +274,11 @@ declare function createRealtimeV1Schemas(): {
276
274
  id: z.ZodString;
277
275
  kind: z.ZodEnum<{
278
276
  created: "created";
279
- deleted: "deleted";
280
277
  updated: "updated";
278
+ deleted: "deleted";
281
279
  }>;
282
280
  }, z.core.$strict>>;
283
281
  delivery: z.ZodLiteral<"durable">;
284
- }, z.core.$strict>, z.ZodObject<{
285
282
  type: z.ZodLiteral<"event">;
286
283
  protocolVersion: z.ZodLiteral<1>;
287
284
  eventVersion: z.ZodNumber;
@@ -303,17 +300,39 @@ declare function createRealtimeV1Schemas(): {
303
300
  occurredAt: z.ZodISODateTime;
304
301
  correlationId: z.ZodNullable<z.ZodString>;
305
302
  data: z.ZodJSONSchema;
303
+ }, z.core.$strict>, z.ZodObject<{
306
304
  cursor: z.ZodNull;
307
305
  changes: z.ZodArray<z.ZodObject<{
308
306
  type: z.ZodString;
309
307
  id: z.ZodString;
310
308
  kind: z.ZodEnum<{
311
309
  created: "created";
312
- deleted: "deleted";
313
310
  updated: "updated";
311
+ deleted: "deleted";
314
312
  }>;
315
313
  }, z.core.$strict>>;
316
314
  delivery: z.ZodLiteral<"ephemeral">;
315
+ type: z.ZodLiteral<"event">;
316
+ protocolVersion: z.ZodLiteral<1>;
317
+ eventVersion: z.ZodNumber;
318
+ id: z.ZodString;
319
+ name: z.ZodString;
320
+ subject: z.ZodDiscriminatedUnion<[z.ZodObject<{
321
+ type: z.ZodLiteral<"partner">;
322
+ id: z.ZodString;
323
+ }, z.core.$strict>, z.ZodObject<{
324
+ type: z.ZodLiteral<"team">;
325
+ id: z.ZodString;
326
+ }, z.core.$strict>, z.ZodObject<{
327
+ type: z.ZodLiteral<"user">;
328
+ id: z.ZodString;
329
+ }, z.core.$strict>, z.ZodObject<{
330
+ type: z.ZodLiteral<"site">;
331
+ id: z.ZodString;
332
+ }, z.core.$strict>], "type">;
333
+ occurredAt: z.ZodISODateTime;
334
+ correlationId: z.ZodNullable<z.ZodString>;
335
+ data: z.ZodJSONSchema;
317
336
  }, z.core.$strict>]>;
318
337
  helloFrame: z.ZodObject<{
319
338
  type: z.ZodLiteral<"hello">;
@@ -375,6 +394,20 @@ declare function createRealtimeV1Schemas(): {
375
394
  batchFrame: z.ZodObject<{
376
395
  type: z.ZodLiteral<"batch">;
377
396
  events: z.ZodArray<z.ZodObject<{
397
+ cursor: z.ZodObject<{
398
+ streamId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
399
+ sequence: z.ZodString;
400
+ }, z.core.$strict>;
401
+ changes: z.ZodArray<z.ZodObject<{
402
+ type: z.ZodString;
403
+ id: z.ZodString;
404
+ kind: z.ZodEnum<{
405
+ created: "created";
406
+ updated: "updated";
407
+ deleted: "deleted";
408
+ }>;
409
+ }, z.core.$strict>>;
410
+ delivery: z.ZodLiteral<"durable">;
378
411
  type: z.ZodLiteral<"event">;
379
412
  protocolVersion: z.ZodLiteral<1>;
380
413
  eventVersion: z.ZodNumber;
@@ -396,20 +429,6 @@ declare function createRealtimeV1Schemas(): {
396
429
  occurredAt: z.ZodISODateTime;
397
430
  correlationId: z.ZodNullable<z.ZodString>;
398
431
  data: z.ZodJSONSchema;
399
- cursor: z.ZodObject<{
400
- streamId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
401
- sequence: z.ZodString;
402
- }, z.core.$strict>;
403
- changes: z.ZodArray<z.ZodObject<{
404
- type: z.ZodString;
405
- id: z.ZodString;
406
- kind: z.ZodEnum<{
407
- created: "created";
408
- deleted: "deleted";
409
- updated: "updated";
410
- }>;
411
- }, z.core.$strict>>;
412
- delivery: z.ZodLiteral<"durable">;
413
432
  }, z.core.$strict>>;
414
433
  }, z.core.$strict>;
415
434
  resyncRequiredFrame: z.ZodObject<{
@@ -433,11 +452,11 @@ declare function createRealtimeV1Schemas(): {
433
452
  type: z.ZodLiteral<"error">;
434
453
  error: z.ZodObject<{
435
454
  code: z.ZodEnum<{
436
- internal_error: "internal_error";
437
455
  invalid_frame: "invalid_frame";
438
- overloaded: "overloaded";
439
- policy_violation: "policy_violation";
440
456
  protocol_mismatch: "protocol_mismatch";
457
+ policy_violation: "policy_violation";
458
+ overloaded: "overloaded";
459
+ internal_error: "internal_error";
441
460
  }>;
442
461
  message: z.ZodString;
443
462
  retryable: z.ZodBoolean;
@@ -498,6 +517,20 @@ declare function createRealtimeV1Schemas(): {
498
517
  sequence: z.ZodString;
499
518
  }, z.core.$strict>;
500
519
  }, z.core.$strict>, z.ZodUnion<readonly [z.ZodObject<{
520
+ cursor: z.ZodObject<{
521
+ streamId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
522
+ sequence: z.ZodString;
523
+ }, z.core.$strict>;
524
+ changes: z.ZodArray<z.ZodObject<{
525
+ type: z.ZodString;
526
+ id: z.ZodString;
527
+ kind: z.ZodEnum<{
528
+ created: "created";
529
+ updated: "updated";
530
+ deleted: "deleted";
531
+ }>;
532
+ }, z.core.$strict>>;
533
+ delivery: z.ZodLiteral<"durable">;
501
534
  type: z.ZodLiteral<"event">;
502
535
  protocolVersion: z.ZodLiteral<1>;
503
536
  eventVersion: z.ZodNumber;
@@ -519,21 +552,18 @@ declare function createRealtimeV1Schemas(): {
519
552
  occurredAt: z.ZodISODateTime;
520
553
  correlationId: z.ZodNullable<z.ZodString>;
521
554
  data: z.ZodJSONSchema;
522
- cursor: z.ZodObject<{
523
- streamId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
524
- sequence: z.ZodString;
525
- }, z.core.$strict>;
555
+ }, z.core.$strict>, z.ZodObject<{
556
+ cursor: z.ZodNull;
526
557
  changes: z.ZodArray<z.ZodObject<{
527
558
  type: z.ZodString;
528
559
  id: z.ZodString;
529
560
  kind: z.ZodEnum<{
530
561
  created: "created";
531
- deleted: "deleted";
532
562
  updated: "updated";
563
+ deleted: "deleted";
533
564
  }>;
534
565
  }, z.core.$strict>>;
535
- delivery: z.ZodLiteral<"durable">;
536
- }, z.core.$strict>, z.ZodObject<{
566
+ delivery: z.ZodLiteral<"ephemeral">;
537
567
  type: z.ZodLiteral<"event">;
538
568
  protocolVersion: z.ZodLiteral<1>;
539
569
  eventVersion: z.ZodNumber;
@@ -555,20 +585,23 @@ declare function createRealtimeV1Schemas(): {
555
585
  occurredAt: z.ZodISODateTime;
556
586
  correlationId: z.ZodNullable<z.ZodString>;
557
587
  data: z.ZodJSONSchema;
558
- cursor: z.ZodNull;
559
- changes: z.ZodArray<z.ZodObject<{
560
- type: z.ZodString;
561
- id: z.ZodString;
562
- kind: z.ZodEnum<{
563
- created: "created";
564
- deleted: "deleted";
565
- updated: "updated";
566
- }>;
567
- }, z.core.$strict>>;
568
- delivery: z.ZodLiteral<"ephemeral">;
569
588
  }, z.core.$strict>]>, z.ZodObject<{
570
589
  type: z.ZodLiteral<"batch">;
571
590
  events: z.ZodArray<z.ZodObject<{
591
+ cursor: z.ZodObject<{
592
+ streamId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
593
+ sequence: z.ZodString;
594
+ }, z.core.$strict>;
595
+ changes: z.ZodArray<z.ZodObject<{
596
+ type: z.ZodString;
597
+ id: z.ZodString;
598
+ kind: z.ZodEnum<{
599
+ created: "created";
600
+ updated: "updated";
601
+ deleted: "deleted";
602
+ }>;
603
+ }, z.core.$strict>>;
604
+ delivery: z.ZodLiteral<"durable">;
572
605
  type: z.ZodLiteral<"event">;
573
606
  protocolVersion: z.ZodLiteral<1>;
574
607
  eventVersion: z.ZodNumber;
@@ -590,20 +623,6 @@ declare function createRealtimeV1Schemas(): {
590
623
  occurredAt: z.ZodISODateTime;
591
624
  correlationId: z.ZodNullable<z.ZodString>;
592
625
  data: z.ZodJSONSchema;
593
- cursor: z.ZodObject<{
594
- streamId: z.ZodUnion<readonly [z.ZodString, z.ZodString]>;
595
- sequence: z.ZodString;
596
- }, z.core.$strict>;
597
- changes: z.ZodArray<z.ZodObject<{
598
- type: z.ZodString;
599
- id: z.ZodString;
600
- kind: z.ZodEnum<{
601
- created: "created";
602
- deleted: "deleted";
603
- updated: "updated";
604
- }>;
605
- }, z.core.$strict>>;
606
- delivery: z.ZodLiteral<"durable">;
607
626
  }, z.core.$strict>>;
608
627
  }, z.core.$strict>, z.ZodObject<{
609
628
  type: z.ZodLiteral<"resync.required">;
@@ -625,11 +644,11 @@ declare function createRealtimeV1Schemas(): {
625
644
  type: z.ZodLiteral<"error">;
626
645
  error: z.ZodObject<{
627
646
  code: z.ZodEnum<{
628
- internal_error: "internal_error";
629
647
  invalid_frame: "invalid_frame";
630
- overloaded: "overloaded";
631
- policy_violation: "policy_violation";
632
648
  protocol_mismatch: "protocol_mismatch";
649
+ policy_violation: "policy_violation";
650
+ overloaded: "overloaded";
651
+ internal_error: "internal_error";
633
652
  }>;
634
653
  message: z.ZodString;
635
654
  retryable: z.ZodBoolean;
@@ -641,10 +660,11 @@ type RealtimeV1Schemas = ReturnType<typeof createRealtimeV1Schemas>;
641
660
  type RealtimeV1StreamId = z.infer<RealtimeV1Schemas['streamId']>;
642
661
  type RealtimeV1Cursor = z.infer<RealtimeV1Schemas['cursor']>;
643
662
  type RealtimeV1StreamHead = z.infer<RealtimeV1Schemas['streamHead']>;
663
+ type RealtimeTicketV1Response = z.infer<RealtimeV1Schemas['ticketResponseClient']>;
644
664
  type RealtimeV1TicketRequest = z.infer<RealtimeV1Schemas['ticketRequest']>;
645
665
  type RealtimeV1TicketClaims = z.infer<RealtimeV1Schemas['ticketClaims']>;
646
666
  type RealtimeV1ResourceChange = z.infer<RealtimeV1Schemas['resourceChange']>;
647
667
  type RealtimeV1Event = z.infer<RealtimeV1Schemas['event']>;
648
668
  type RealtimeV1ClientFrame = z.infer<RealtimeV1Schemas['clientFrame']>;
649
669
  type RealtimeV1ServerFrame = z.infer<RealtimeV1Schemas['serverFrame']>;
650
- export { GSCDUMP_REALTIME_ACK_POLICY, GSCDUMP_REALTIME_CLOSE_CODES, GSCDUMP_REALTIME_CONNECTION_POLICY, GSCDUMP_REALTIME_LIMITS, GSCDUMP_REALTIME_MAX_CONNECTION_SECONDS, GSCDUMP_REALTIME_PING, GSCDUMP_REALTIME_PONG, GSCDUMP_REALTIME_PROTOCOL_VERSION, GSCDUMP_REALTIME_REPLAY_POLICY, GSCDUMP_REALTIME_SUBPROTOCOL, GSCDUMP_REALTIME_TICKET_AUDIENCE, GSCDUMP_REALTIME_TICKET_ISSUER, GSCDUMP_REALTIME_TICKET_POLICY, GSCDUMP_REALTIME_TICKET_PREFIX, GSCDUMP_REALTIME_TICKET_TTL_SECONDS, REALTIME_V1_EVENT_NAMES, REALTIME_V1_EVENT_SEMANTICS, REALTIME_V1_RESOURCE_TYPES, RealtimeV1ClientFrame, RealtimeV1Cursor, RealtimeV1Event, RealtimeV1ResourceChange, RealtimeV1Schemas, RealtimeV1ServerFrame, RealtimeV1StreamHead, RealtimeV1StreamId, RealtimeV1TicketClaims, RealtimeV1TicketRequest, createRealtimeV1Schemas };
670
+ export { GSCDUMP_REALTIME_ACK_POLICY, GSCDUMP_REALTIME_CLOSE_CODES, GSCDUMP_REALTIME_CONNECTION_POLICY, GSCDUMP_REALTIME_LIMITS, GSCDUMP_REALTIME_MAX_CONNECTION_SECONDS, GSCDUMP_REALTIME_PING, GSCDUMP_REALTIME_PONG, GSCDUMP_REALTIME_PROTOCOL_VERSION, GSCDUMP_REALTIME_REPLAY_POLICY, GSCDUMP_REALTIME_SUBPROTOCOL, GSCDUMP_REALTIME_TICKET_AUDIENCE, GSCDUMP_REALTIME_TICKET_ISSUER, GSCDUMP_REALTIME_TICKET_POLICY, GSCDUMP_REALTIME_TICKET_PREFIX, GSCDUMP_REALTIME_TICKET_TTL_SECONDS, REALTIME_V1_EVENT_NAMES, REALTIME_V1_EVENT_SEMANTICS, REALTIME_V1_RESOURCE_TYPES, RealtimeTicketV1Response, RealtimeV1ClientFrame, RealtimeV1Cursor, RealtimeV1Event, RealtimeV1ResourceChange, RealtimeV1Schemas, RealtimeV1ServerFrame, RealtimeV1StreamHead, RealtimeV1StreamId, RealtimeV1TicketClaims, RealtimeV1TicketRequest, createRealtimeV1Schemas };
@@ -1,3 +1,4 @@
1
+ import "./version.mjs";
1
2
  import { z } from "zod";
2
3
  const GSCDUMP_REALTIME_PROTOCOL_VERSION = 1;
3
4
  const GSCDUMP_REALTIME_SUBPROTOCOL = "gscdump.v1";
@@ -150,6 +151,25 @@ function createRealtimeV1Schemas() {
150
151
  streamId,
151
152
  sequence
152
153
  });
154
+ const ticketResponseClient = z.looseObject({
155
+ data: z.looseObject({
156
+ socketUrl: z.url().refine((value) => value.startsWith("wss://"), "socketUrl must use wss."),
157
+ protocol: z.literal(GSCDUMP_REALTIME_SUBPROTOCOL),
158
+ protocolVersion: z.literal(1),
159
+ ticket: z.string().max(GSCDUMP_REALTIME_TICKET_POLICY.maxBytes).regex(/^gscdump\.ticket\.v1\.[\w-]+\.[\w-]+$/),
160
+ expiresAt: z.iso.datetime(),
161
+ head: z.looseObject({
162
+ streamId,
163
+ sequence
164
+ }),
165
+ maxConnectionSeconds: z.literal(900)
166
+ }),
167
+ meta: z.looseObject({
168
+ requestId: publicRequestId,
169
+ surface: z.literal("realtime"),
170
+ version: z.literal("1.0")
171
+ })
172
+ });
153
173
  const ticketRequest = z.strictObject({ origin: origin.optional() });
154
174
  const ticketClaims = z.strictObject({
155
175
  v: z.literal(1),
@@ -416,6 +436,7 @@ function createRealtimeV1Schemas() {
416
436
  streamId,
417
437
  cursor,
418
438
  streamHead,
439
+ ticketResponseClient,
419
440
  ticketRequest,
420
441
  ticketClaims,
421
442
  knownResourceType,
@@ -0,0 +1,6 @@
1
+ import { GSCDUMP_HTTP_V1_VERSION } from "./version.mjs";
2
+ import { CompatibleResponseSchema, HTTP_V1_CREDENTIALS, HTTP_V1_CREDENTIAL_SCOPES, HTTP_V1_ERROR_CODES, HTTP_V1_METHODS, HTTP_V1_SCOPES, HTTP_V1_SURFACES, HttpV1Credential, HttpV1ErrorCode, HttpV1Method, HttpV1OperationDefinition, HttpV1OwnershipRule, HttpV1RequestSchemas, HttpV1ResourceReference, HttpV1ResourceType, HttpV1Scope, HttpV1Semantics, HttpV1Surface, HttpV1SurfaceName, HttpV1Visibility, buildHttpOperationPath, defineHttpOperation, defineHttpSurface, defineResponseObject, defineSuccessResponse } from "./http-core.mjs";
3
+ import { GSCDUMP_REALTIME_ACK_POLICY, GSCDUMP_REALTIME_CLOSE_CODES, GSCDUMP_REALTIME_CONNECTION_POLICY, GSCDUMP_REALTIME_LIMITS, GSCDUMP_REALTIME_MAX_CONNECTION_SECONDS, GSCDUMP_REALTIME_PING, GSCDUMP_REALTIME_PONG, GSCDUMP_REALTIME_PROTOCOL_VERSION, GSCDUMP_REALTIME_REPLAY_POLICY, GSCDUMP_REALTIME_SUBPROTOCOL, GSCDUMP_REALTIME_TICKET_AUDIENCE, GSCDUMP_REALTIME_TICKET_ISSUER, GSCDUMP_REALTIME_TICKET_POLICY, GSCDUMP_REALTIME_TICKET_PREFIX, GSCDUMP_REALTIME_TICKET_TTL_SECONDS, REALTIME_V1_EVENT_NAMES, REALTIME_V1_EVENT_SEMANTICS, REALTIME_V1_RESOURCE_TYPES, RealtimeTicketV1Response, RealtimeV1ClientFrame, RealtimeV1Cursor, RealtimeV1Event, RealtimeV1ResourceChange, RealtimeV1Schemas, RealtimeV1ServerFrame, RealtimeV1StreamHead, RealtimeV1StreamId, RealtimeV1TicketClaims, RealtimeV1TicketRequest, createRealtimeV1Schemas } from "./realtime.mjs";
4
+ import { AnalyticsReportDetailV1Request, AnalyticsReportDetailV1Response, AnalyticsReportV1Request, AnalyticsReportV1Response, AnalyticsRowsV1Request, AnalyticsRowsV1Response, GscdumpV1ErrorEnvelope, GscdumpV1Protocol, GscdumpV1RequestMetadata, PartnerAnalysisBundleV1Response, PartnerAnalysisV1Response, PartnerAvailableSitesV1Response, PartnerIndexingDiagnosticsV1Response, PartnerIndexingUrlsV1Response, PartnerIndexingV1Response, PartnerSiteDeletionV1Response, PartnerSiteRegistrationV1Response, PartnerSitemapChangesV1Response, PartnerSitemapsV1Response, PartnerUserLifecycleV1Response, createGscdumpV1Protocol } from "./operations.mjs";
5
+ import "./http.mjs";
6
+ export { AnalyticsReportDetailV1Request, AnalyticsReportDetailV1Response, AnalyticsReportV1Request, AnalyticsReportV1Response, AnalyticsRowsV1Request, AnalyticsRowsV1Response, CompatibleResponseSchema, GSCDUMP_HTTP_V1_VERSION, GSCDUMP_REALTIME_ACK_POLICY, GSCDUMP_REALTIME_CLOSE_CODES, GSCDUMP_REALTIME_CONNECTION_POLICY, GSCDUMP_REALTIME_LIMITS, GSCDUMP_REALTIME_MAX_CONNECTION_SECONDS, GSCDUMP_REALTIME_PING, GSCDUMP_REALTIME_PONG, GSCDUMP_REALTIME_PROTOCOL_VERSION, GSCDUMP_REALTIME_REPLAY_POLICY, GSCDUMP_REALTIME_SUBPROTOCOL, GSCDUMP_REALTIME_TICKET_AUDIENCE, GSCDUMP_REALTIME_TICKET_ISSUER, GSCDUMP_REALTIME_TICKET_POLICY, GSCDUMP_REALTIME_TICKET_PREFIX, GSCDUMP_REALTIME_TICKET_TTL_SECONDS, GscdumpV1ErrorEnvelope, GscdumpV1Protocol, GscdumpV1RequestMetadata, HTTP_V1_CREDENTIALS, HTTP_V1_CREDENTIAL_SCOPES, HTTP_V1_ERROR_CODES, HTTP_V1_METHODS, HTTP_V1_SCOPES, HTTP_V1_SURFACES, HttpV1Credential, HttpV1ErrorCode, HttpV1Method, HttpV1OperationDefinition, HttpV1OwnershipRule, HttpV1RequestSchemas, HttpV1ResourceReference, HttpV1ResourceType, HttpV1Scope, HttpV1Semantics, HttpV1Surface, HttpV1SurfaceName, HttpV1Visibility, PartnerAnalysisBundleV1Response, PartnerAnalysisV1Response, PartnerAvailableSitesV1Response, PartnerIndexingDiagnosticsV1Response, PartnerIndexingUrlsV1Response, PartnerIndexingV1Response, PartnerSiteDeletionV1Response, PartnerSiteRegistrationV1Response, PartnerSitemapChangesV1Response, PartnerSitemapsV1Response, PartnerUserLifecycleV1Response, REALTIME_V1_EVENT_NAMES, REALTIME_V1_EVENT_SEMANTICS, REALTIME_V1_RESOURCE_TYPES, RealtimeTicketV1Response, RealtimeV1ClientFrame, RealtimeV1Cursor, RealtimeV1Event, RealtimeV1ResourceChange, RealtimeV1Schemas, RealtimeV1ServerFrame, RealtimeV1StreamHead, RealtimeV1StreamId, RealtimeV1TicketClaims, RealtimeV1TicketRequest, buildHttpOperationPath, createGscdumpV1Protocol, createRealtimeV1Schemas, defineHttpOperation, defineHttpSurface, defineResponseObject, defineSuccessResponse };
@@ -0,0 +1,6 @@
1
+ import { GSCDUMP_HTTP_V1_VERSION } from "./version.mjs";
2
+ import { HTTP_V1_CREDENTIALS, HTTP_V1_CREDENTIAL_SCOPES, HTTP_V1_ERROR_CODES, HTTP_V1_METHODS, HTTP_V1_SCOPES, HTTP_V1_SURFACES, buildHttpOperationPath, defineHttpOperation, defineHttpSurface, defineResponseObject, defineSuccessResponse } from "./http-core.mjs";
3
+ import { GSCDUMP_REALTIME_ACK_POLICY, GSCDUMP_REALTIME_CLOSE_CODES, GSCDUMP_REALTIME_CONNECTION_POLICY, GSCDUMP_REALTIME_LIMITS, GSCDUMP_REALTIME_MAX_CONNECTION_SECONDS, GSCDUMP_REALTIME_PING, GSCDUMP_REALTIME_PONG, GSCDUMP_REALTIME_PROTOCOL_VERSION, GSCDUMP_REALTIME_REPLAY_POLICY, GSCDUMP_REALTIME_SUBPROTOCOL, GSCDUMP_REALTIME_TICKET_AUDIENCE, GSCDUMP_REALTIME_TICKET_ISSUER, GSCDUMP_REALTIME_TICKET_POLICY, GSCDUMP_REALTIME_TICKET_PREFIX, GSCDUMP_REALTIME_TICKET_TTL_SECONDS, REALTIME_V1_EVENT_NAMES, REALTIME_V1_EVENT_SEMANTICS, REALTIME_V1_RESOURCE_TYPES, createRealtimeV1Schemas } from "./realtime.mjs";
4
+ import { createGscdumpV1Protocol } from "./operations.mjs";
5
+ import "./http.mjs";
6
+ export { GSCDUMP_HTTP_V1_VERSION, GSCDUMP_REALTIME_ACK_POLICY, GSCDUMP_REALTIME_CLOSE_CODES, GSCDUMP_REALTIME_CONNECTION_POLICY, GSCDUMP_REALTIME_LIMITS, GSCDUMP_REALTIME_MAX_CONNECTION_SECONDS, GSCDUMP_REALTIME_PING, GSCDUMP_REALTIME_PONG, GSCDUMP_REALTIME_PROTOCOL_VERSION, GSCDUMP_REALTIME_REPLAY_POLICY, GSCDUMP_REALTIME_SUBPROTOCOL, GSCDUMP_REALTIME_TICKET_AUDIENCE, GSCDUMP_REALTIME_TICKET_ISSUER, GSCDUMP_REALTIME_TICKET_POLICY, GSCDUMP_REALTIME_TICKET_PREFIX, GSCDUMP_REALTIME_TICKET_TTL_SECONDS, HTTP_V1_CREDENTIALS, HTTP_V1_CREDENTIAL_SCOPES, HTTP_V1_ERROR_CODES, HTTP_V1_METHODS, HTTP_V1_SCOPES, HTTP_V1_SURFACES, REALTIME_V1_EVENT_NAMES, REALTIME_V1_EVENT_SEMANTICS, REALTIME_V1_RESOURCE_TYPES, buildHttpOperationPath, createGscdumpV1Protocol, createRealtimeV1Schemas, defineHttpOperation, defineHttpSurface, defineResponseObject, defineSuccessResponse };
@@ -0,0 +1,2 @@
1
+ declare const GSCDUMP_HTTP_V1_VERSION: "1.0";
2
+ export { GSCDUMP_HTTP_V1_VERSION };
@@ -0,0 +1,2 @@
1
+ const GSCDUMP_HTTP_V1_VERSION = "1.0";
2
+ export { GSCDUMP_HTTP_V1_VERSION };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gscdump/contracts",
3
3
  "type": "module",
4
- "version": "1.4.1",
4
+ "version": "1.4.3",
5
5
  "description": "Shared gscdump.com API, webhook, realtime, and lifecycle contracts.",
6
6
  "author": {
7
7
  "name": "Harlan Wilton",
@@ -45,6 +45,31 @@
45
45
  "types": "./dist/v1/index.d.mts",
46
46
  "import": "./dist/v1/index.mjs",
47
47
  "default": "./dist/v1/index.mjs"
48
+ },
49
+ "./v1/browser": {
50
+ "types": "./dist/v1/browser.d.mts",
51
+ "import": "./dist/v1/browser.mjs",
52
+ "default": "./dist/v1/browser.mjs"
53
+ },
54
+ "./v1/documents": {
55
+ "types": "./dist/v1/documents.d.mts",
56
+ "import": "./dist/v1/documents.mjs",
57
+ "default": "./dist/v1/documents.mjs"
58
+ },
59
+ "./v1/http": {
60
+ "types": "./dist/v1/http.d.mts",
61
+ "import": "./dist/v1/http.mjs",
62
+ "default": "./dist/v1/http.mjs"
63
+ },
64
+ "./v1/realtime": {
65
+ "types": "./dist/v1/realtime.d.mts",
66
+ "import": "./dist/v1/realtime.mjs",
67
+ "default": "./dist/v1/realtime.mjs"
68
+ },
69
+ "./v1/server": {
70
+ "types": "./dist/v1/server.d.mts",
71
+ "import": "./dist/v1/server.mjs",
72
+ "default": "./dist/v1/server.mjs"
48
73
  }
49
74
  },
50
75
  "main": "./dist/index.mjs",
@@ -59,7 +84,7 @@
59
84
  "zod": "^4.4.3"
60
85
  },
61
86
  "devDependencies": {
62
- "typescript": "^7.0.2",
87
+ "typescript": "^6.0.3",
63
88
  "vitest": "^4.1.10"
64
89
  },
65
90
  "scripts": {