@antiphony/shared 0.3.0 → 0.5.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/README.md +4 -4
- package/dist/cjs/api-codecs.cjs +149 -142
- package/dist/cjs/api-codecs.d.cts +157 -68
- package/dist/cjs/index.cjs +187 -192
- package/dist/cjs/index.d.cts +310 -7
- package/dist/cjs/nsid.cjs +6 -9
- package/dist/cjs/nsid.d.cts +7 -8
- package/dist/cjs/types/audio.cjs +133 -119
- package/dist/cjs/types/audio.d.cts +343 -199
- package/dist/cjs/types/blob.cjs +5 -9
- package/dist/cjs/types/blob.d.cts +21 -21
- package/dist/cjs/types/records.cjs +0 -45
- package/dist/cjs/types/records.d.cts +1 -103
- package/dist/esm/api-codecs.d.ts +187 -98
- package/dist/esm/api-codecs.js +4 -5
- package/dist/esm/chunk-D655OH2I.js +35 -0
- package/dist/esm/chunk-F5ZKFJL2.js +39 -0
- package/dist/esm/{chunk-6LROFBKK.js → chunk-SBYNIQRZ.js} +7 -9
- package/dist/esm/chunk-SMK4OZNU.js +17 -0
- package/dist/esm/chunk-TVOXIQKF.js +294 -0
- package/dist/esm/index.d.ts +310 -7
- package/dist/esm/index.js +5 -7
- package/dist/esm/nsid.d.ts +7 -8
- package/dist/esm/nsid.js +1 -1
- package/dist/esm/types/audio.d.ts +420 -276
- package/dist/esm/types/audio.js +3 -4
- package/dist/esm/types/blob.d.ts +21 -21
- package/dist/esm/types/blob.js +1 -1
- package/dist/esm/types/records.d.ts +1 -103
- package/dist/esm/types/records.js +1 -1
- package/package.json +94 -26
- package/dist/cjs/types/api.cjs +0 -166
- package/dist/cjs/types/api.d.cts +0 -242
- package/dist/cjs/types/views.cjs +0 -179
- package/dist/cjs/types/views.d.cts +0 -726
- package/dist/esm/chunk-5EHV73BA.js +0 -20
- package/dist/esm/chunk-F7IHVM34.js +0 -144
- package/dist/esm/chunk-FDM5FDN4.js +0 -46
- package/dist/esm/chunk-IHIBHQBJ.js +0 -78
- package/dist/esm/chunk-R6SBR3IG.js +0 -97
- package/dist/esm/chunk-Y6HNNRVD.js +0 -12
- package/dist/esm/types/api.d.ts +0 -242
- package/dist/esm/types/api.js +0 -4
- package/dist/esm/types/views.d.ts +0 -726
- package/dist/esm/types/views.js +0 -3
package/dist/esm/api-codecs.d.ts
CHANGED
|
@@ -16,17 +16,27 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
|
|
|
16
16
|
$type: z.ZodLiteral<"dev.antiphony.embed.audio">;
|
|
17
17
|
audio: z.ZodObject<{
|
|
18
18
|
$type: z.ZodLiteral<"blob">;
|
|
19
|
-
ref: z.
|
|
19
|
+
ref: z.ZodObject<{
|
|
20
|
+
$link: z.ZodString;
|
|
21
|
+
}, "strip", z.ZodTypeAny, {
|
|
22
|
+
$link: string;
|
|
23
|
+
}, {
|
|
24
|
+
$link: string;
|
|
25
|
+
}>;
|
|
20
26
|
mimeType: z.ZodString;
|
|
21
27
|
size: z.ZodNumber;
|
|
22
28
|
}, "strip", z.ZodTypeAny, {
|
|
23
29
|
$type: "blob";
|
|
24
|
-
ref:
|
|
30
|
+
ref: {
|
|
31
|
+
$link: string;
|
|
32
|
+
};
|
|
25
33
|
mimeType: string;
|
|
26
34
|
size: number;
|
|
27
35
|
}, {
|
|
28
36
|
$type: "blob";
|
|
29
|
-
ref:
|
|
37
|
+
ref: {
|
|
38
|
+
$link: string;
|
|
39
|
+
};
|
|
30
40
|
mimeType: string;
|
|
31
41
|
size: number;
|
|
32
42
|
}>;
|
|
@@ -37,24 +47,28 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
|
|
|
37
47
|
$type: "dev.antiphony.embed.audio";
|
|
38
48
|
audio: {
|
|
39
49
|
$type: "blob";
|
|
40
|
-
ref:
|
|
50
|
+
ref: {
|
|
51
|
+
$link: string;
|
|
52
|
+
};
|
|
41
53
|
mimeType: string;
|
|
42
54
|
size: number;
|
|
43
55
|
};
|
|
56
|
+
waveform?: number[] | undefined;
|
|
44
57
|
durationMs?: number | undefined;
|
|
45
58
|
alt?: string | undefined;
|
|
46
|
-
waveform?: number[] | undefined;
|
|
47
59
|
}, {
|
|
48
60
|
$type: "dev.antiphony.embed.audio";
|
|
49
61
|
audio: {
|
|
50
62
|
$type: "blob";
|
|
51
|
-
ref:
|
|
63
|
+
ref: {
|
|
64
|
+
$link: string;
|
|
65
|
+
};
|
|
52
66
|
mimeType: string;
|
|
53
67
|
size: number;
|
|
54
68
|
};
|
|
69
|
+
waveform?: number[] | undefined;
|
|
55
70
|
durationMs?: number | undefined;
|
|
56
71
|
alt?: string | undefined;
|
|
57
|
-
waveform?: number[] | undefined;
|
|
58
72
|
}>>;
|
|
59
73
|
/** Present ⇒ this is a reply (StrongRef root + parent). */
|
|
60
74
|
reply: z.ZodOptional<z.ZodObject<{
|
|
@@ -101,20 +115,41 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
|
|
|
101
115
|
langs: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
102
116
|
/** Author self-label values (content warnings). */
|
|
103
117
|
selfLabels: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
118
|
+
/**
|
|
119
|
+
* Opt-in audio processing for this post's audio (denoise / trim /
|
|
120
|
+
* transcribe / waveform). All default off. Stages the deployment can't
|
|
121
|
+
* provide come back marked `skipped` on the view rather than failing the
|
|
122
|
+
* create. A multi-stage request runs denoise → trim → (transcribe,
|
|
123
|
+
* waveform); request stages individually to override that order. See
|
|
124
|
+
* `types/processing.ts`.
|
|
125
|
+
*/
|
|
126
|
+
processing: z.ZodOptional<z.ZodObject<{
|
|
127
|
+
transcribe: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
denoise: z.ZodOptional<z.ZodBoolean>;
|
|
129
|
+
trim: z.ZodOptional<z.ZodBoolean>;
|
|
130
|
+
waveform: z.ZodOptional<z.ZodBoolean>;
|
|
131
|
+
reprocess: z.ZodOptional<z.ZodBoolean>;
|
|
132
|
+
}, "strip", z.ZodTypeAny, {
|
|
133
|
+
denoise?: boolean | undefined;
|
|
134
|
+
trim?: boolean | undefined;
|
|
135
|
+
transcribe?: boolean | undefined;
|
|
136
|
+
waveform?: boolean | undefined;
|
|
137
|
+
reprocess?: boolean | undefined;
|
|
138
|
+
}, {
|
|
139
|
+
denoise?: boolean | undefined;
|
|
140
|
+
trim?: boolean | undefined;
|
|
141
|
+
transcribe?: boolean | undefined;
|
|
142
|
+
waveform?: boolean | undefined;
|
|
143
|
+
reprocess?: boolean | undefined;
|
|
144
|
+
}>>;
|
|
104
145
|
}, "strip", z.ZodTypeAny, {
|
|
105
146
|
text: string;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
mimeType: string;
|
|
113
|
-
size: number;
|
|
114
|
-
};
|
|
115
|
-
durationMs?: number | undefined;
|
|
116
|
-
alt?: string | undefined;
|
|
117
|
-
waveform?: number[] | undefined;
|
|
147
|
+
processing?: {
|
|
148
|
+
denoise?: boolean | undefined;
|
|
149
|
+
trim?: boolean | undefined;
|
|
150
|
+
transcribe?: boolean | undefined;
|
|
151
|
+
waveform?: boolean | undefined;
|
|
152
|
+
reprocess?: boolean | undefined;
|
|
118
153
|
} | undefined;
|
|
119
154
|
reply?: {
|
|
120
155
|
root: {
|
|
@@ -126,22 +161,31 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
|
|
|
126
161
|
cid: string;
|
|
127
162
|
};
|
|
128
163
|
} | undefined;
|
|
129
|
-
langs?: string[] | undefined;
|
|
130
|
-
selfLabels?: string[] | undefined;
|
|
131
|
-
}, {
|
|
132
|
-
text?: string | undefined;
|
|
133
164
|
title?: string | undefined;
|
|
134
165
|
embed?: {
|
|
135
166
|
$type: "dev.antiphony.embed.audio";
|
|
136
167
|
audio: {
|
|
137
168
|
$type: "blob";
|
|
138
|
-
ref:
|
|
169
|
+
ref: {
|
|
170
|
+
$link: string;
|
|
171
|
+
};
|
|
139
172
|
mimeType: string;
|
|
140
173
|
size: number;
|
|
141
174
|
};
|
|
175
|
+
waveform?: number[] | undefined;
|
|
142
176
|
durationMs?: number | undefined;
|
|
143
177
|
alt?: string | undefined;
|
|
144
|
-
|
|
178
|
+
} | undefined;
|
|
179
|
+
langs?: string[] | undefined;
|
|
180
|
+
selfLabels?: string[] | undefined;
|
|
181
|
+
}, {
|
|
182
|
+
text?: string | undefined;
|
|
183
|
+
processing?: {
|
|
184
|
+
denoise?: boolean | undefined;
|
|
185
|
+
trim?: boolean | undefined;
|
|
186
|
+
transcribe?: boolean | undefined;
|
|
187
|
+
waveform?: boolean | undefined;
|
|
188
|
+
reprocess?: boolean | undefined;
|
|
145
189
|
} | undefined;
|
|
146
190
|
reply?: {
|
|
147
191
|
root: {
|
|
@@ -153,22 +197,31 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
|
|
|
153
197
|
cid: string;
|
|
154
198
|
};
|
|
155
199
|
} | undefined;
|
|
156
|
-
langs?: string[] | undefined;
|
|
157
|
-
selfLabels?: string[] | undefined;
|
|
158
|
-
}>, {
|
|
159
|
-
text: string;
|
|
160
200
|
title?: string | undefined;
|
|
161
201
|
embed?: {
|
|
162
202
|
$type: "dev.antiphony.embed.audio";
|
|
163
203
|
audio: {
|
|
164
204
|
$type: "blob";
|
|
165
|
-
ref:
|
|
205
|
+
ref: {
|
|
206
|
+
$link: string;
|
|
207
|
+
};
|
|
166
208
|
mimeType: string;
|
|
167
209
|
size: number;
|
|
168
210
|
};
|
|
211
|
+
waveform?: number[] | undefined;
|
|
169
212
|
durationMs?: number | undefined;
|
|
170
213
|
alt?: string | undefined;
|
|
171
|
-
|
|
214
|
+
} | undefined;
|
|
215
|
+
langs?: string[] | undefined;
|
|
216
|
+
selfLabels?: string[] | undefined;
|
|
217
|
+
}>, {
|
|
218
|
+
text: string;
|
|
219
|
+
processing?: {
|
|
220
|
+
denoise?: boolean | undefined;
|
|
221
|
+
trim?: boolean | undefined;
|
|
222
|
+
transcribe?: boolean | undefined;
|
|
223
|
+
waveform?: boolean | undefined;
|
|
224
|
+
reprocess?: boolean | undefined;
|
|
172
225
|
} | undefined;
|
|
173
226
|
reply?: {
|
|
174
227
|
root: {
|
|
@@ -180,22 +233,31 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
|
|
|
180
233
|
cid: string;
|
|
181
234
|
};
|
|
182
235
|
} | undefined;
|
|
183
|
-
langs?: string[] | undefined;
|
|
184
|
-
selfLabels?: string[] | undefined;
|
|
185
|
-
}, {
|
|
186
|
-
text?: string | undefined;
|
|
187
236
|
title?: string | undefined;
|
|
188
237
|
embed?: {
|
|
189
238
|
$type: "dev.antiphony.embed.audio";
|
|
190
239
|
audio: {
|
|
191
240
|
$type: "blob";
|
|
192
|
-
ref:
|
|
241
|
+
ref: {
|
|
242
|
+
$link: string;
|
|
243
|
+
};
|
|
193
244
|
mimeType: string;
|
|
194
245
|
size: number;
|
|
195
246
|
};
|
|
247
|
+
waveform?: number[] | undefined;
|
|
196
248
|
durationMs?: number | undefined;
|
|
197
249
|
alt?: string | undefined;
|
|
198
|
-
|
|
250
|
+
} | undefined;
|
|
251
|
+
langs?: string[] | undefined;
|
|
252
|
+
selfLabels?: string[] | undefined;
|
|
253
|
+
}, {
|
|
254
|
+
text?: string | undefined;
|
|
255
|
+
processing?: {
|
|
256
|
+
denoise?: boolean | undefined;
|
|
257
|
+
trim?: boolean | undefined;
|
|
258
|
+
transcribe?: boolean | undefined;
|
|
259
|
+
waveform?: boolean | undefined;
|
|
260
|
+
reprocess?: boolean | undefined;
|
|
199
261
|
} | undefined;
|
|
200
262
|
reply?: {
|
|
201
263
|
root: {
|
|
@@ -207,22 +269,31 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
|
|
|
207
269
|
cid: string;
|
|
208
270
|
};
|
|
209
271
|
} | undefined;
|
|
210
|
-
langs?: string[] | undefined;
|
|
211
|
-
selfLabels?: string[] | undefined;
|
|
212
|
-
}>, {
|
|
213
|
-
text: string;
|
|
214
272
|
title?: string | undefined;
|
|
215
273
|
embed?: {
|
|
216
274
|
$type: "dev.antiphony.embed.audio";
|
|
217
275
|
audio: {
|
|
218
276
|
$type: "blob";
|
|
219
|
-
ref:
|
|
277
|
+
ref: {
|
|
278
|
+
$link: string;
|
|
279
|
+
};
|
|
220
280
|
mimeType: string;
|
|
221
281
|
size: number;
|
|
222
282
|
};
|
|
283
|
+
waveform?: number[] | undefined;
|
|
223
284
|
durationMs?: number | undefined;
|
|
224
285
|
alt?: string | undefined;
|
|
225
|
-
|
|
286
|
+
} | undefined;
|
|
287
|
+
langs?: string[] | undefined;
|
|
288
|
+
selfLabels?: string[] | undefined;
|
|
289
|
+
}>, {
|
|
290
|
+
text: string;
|
|
291
|
+
processing?: {
|
|
292
|
+
denoise?: boolean | undefined;
|
|
293
|
+
trim?: boolean | undefined;
|
|
294
|
+
transcribe?: boolean | undefined;
|
|
295
|
+
waveform?: boolean | undefined;
|
|
296
|
+
reprocess?: boolean | undefined;
|
|
226
297
|
} | undefined;
|
|
227
298
|
reply?: {
|
|
228
299
|
root: {
|
|
@@ -234,22 +305,31 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
|
|
|
234
305
|
cid: string;
|
|
235
306
|
};
|
|
236
307
|
} | undefined;
|
|
237
|
-
langs?: string[] | undefined;
|
|
238
|
-
selfLabels?: string[] | undefined;
|
|
239
|
-
}, {
|
|
240
|
-
text?: string | undefined;
|
|
241
308
|
title?: string | undefined;
|
|
242
309
|
embed?: {
|
|
243
310
|
$type: "dev.antiphony.embed.audio";
|
|
244
311
|
audio: {
|
|
245
312
|
$type: "blob";
|
|
246
|
-
ref:
|
|
313
|
+
ref: {
|
|
314
|
+
$link: string;
|
|
315
|
+
};
|
|
247
316
|
mimeType: string;
|
|
248
317
|
size: number;
|
|
249
318
|
};
|
|
319
|
+
waveform?: number[] | undefined;
|
|
250
320
|
durationMs?: number | undefined;
|
|
251
321
|
alt?: string | undefined;
|
|
252
|
-
|
|
322
|
+
} | undefined;
|
|
323
|
+
langs?: string[] | undefined;
|
|
324
|
+
selfLabels?: string[] | undefined;
|
|
325
|
+
}, {
|
|
326
|
+
text?: string | undefined;
|
|
327
|
+
processing?: {
|
|
328
|
+
denoise?: boolean | undefined;
|
|
329
|
+
trim?: boolean | undefined;
|
|
330
|
+
transcribe?: boolean | undefined;
|
|
331
|
+
waveform?: boolean | undefined;
|
|
332
|
+
reprocess?: boolean | undefined;
|
|
253
333
|
} | undefined;
|
|
254
334
|
reply?: {
|
|
255
335
|
root: {
|
|
@@ -261,64 +341,73 @@ declare const CreateAudioPostRequestSchema: z.ZodEffects<z.ZodEffects<z.ZodObjec
|
|
|
261
341
|
cid: string;
|
|
262
342
|
};
|
|
263
343
|
} | undefined;
|
|
344
|
+
title?: string | undefined;
|
|
345
|
+
embed?: {
|
|
346
|
+
$type: "dev.antiphony.embed.audio";
|
|
347
|
+
audio: {
|
|
348
|
+
$type: "blob";
|
|
349
|
+
ref: {
|
|
350
|
+
$link: string;
|
|
351
|
+
};
|
|
352
|
+
mimeType: string;
|
|
353
|
+
size: number;
|
|
354
|
+
};
|
|
355
|
+
waveform?: number[] | undefined;
|
|
356
|
+
durationMs?: number | undefined;
|
|
357
|
+
alt?: string | undefined;
|
|
358
|
+
} | undefined;
|
|
264
359
|
langs?: string[] | undefined;
|
|
265
360
|
selfLabels?: string[] | undefined;
|
|
266
361
|
}>;
|
|
267
362
|
type CreateAudioPostRequest = z.infer<typeof CreateAudioPostRequestSchema>;
|
|
268
363
|
/**
|
|
269
|
-
*
|
|
270
|
-
*
|
|
364
|
+
* Patch-request codec for the canonical Antiphony `dev.antiphony.audio.post`
|
|
365
|
+
* model. **Processing opt-in is the ONLY thing a PATCH may change** — it
|
|
366
|
+
* re-triggers async audio enrichment (transcribe / denoise) on an existing
|
|
367
|
+
* post. No lexicon fields are editable here: those feed the record CID (its
|
|
368
|
+
* content address / identity), so a content edit would mint a different record.
|
|
369
|
+
* Processing state is storage-layer, so this changes no CID. See
|
|
370
|
+
* `types/processing.ts`.
|
|
271
371
|
*/
|
|
272
|
-
declare const
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
* value stored on `UserRecord` (which requires `.url() | null`) round-trips
|
|
282
|
-
* cleanly through `UserRecordSchema.parse` on subsequent reads.
|
|
283
|
-
*/
|
|
284
|
-
website: z.ZodEffects<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<"">, z.ZodNull]>>, string | null | undefined, string | null | undefined>;
|
|
285
|
-
/** Up to 5 public links (label + URL) shown under the bio. */
|
|
286
|
-
links: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
287
|
-
label: z.ZodString;
|
|
288
|
-
url: z.ZodString;
|
|
372
|
+
declare const PatchAudioPostRequestSchema: z.ZodObject<{
|
|
373
|
+
/** Opt-in audio processing to (re)run for this post's audio. Required — a
|
|
374
|
+
* PATCH with no processing request is a no-op and rejected as invalid. */
|
|
375
|
+
processing: z.ZodObject<{
|
|
376
|
+
transcribe: z.ZodOptional<z.ZodBoolean>;
|
|
377
|
+
denoise: z.ZodOptional<z.ZodBoolean>;
|
|
378
|
+
trim: z.ZodOptional<z.ZodBoolean>;
|
|
379
|
+
waveform: z.ZodOptional<z.ZodBoolean>;
|
|
380
|
+
reprocess: z.ZodOptional<z.ZodBoolean>;
|
|
289
381
|
}, "strip", z.ZodTypeAny, {
|
|
290
|
-
|
|
291
|
-
|
|
382
|
+
denoise?: boolean | undefined;
|
|
383
|
+
trim?: boolean | undefined;
|
|
384
|
+
transcribe?: boolean | undefined;
|
|
385
|
+
waveform?: boolean | undefined;
|
|
386
|
+
reprocess?: boolean | undefined;
|
|
292
387
|
}, {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
388
|
+
denoise?: boolean | undefined;
|
|
389
|
+
trim?: boolean | undefined;
|
|
390
|
+
transcribe?: boolean | undefined;
|
|
391
|
+
waveform?: boolean | undefined;
|
|
392
|
+
reprocess?: boolean | undefined;
|
|
393
|
+
}>;
|
|
298
394
|
}, "strip", z.ZodTypeAny, {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
label: string;
|
|
307
|
-
url: string;
|
|
308
|
-
}[] | undefined;
|
|
309
|
-
showBlueskyPublicly?: boolean | undefined;
|
|
395
|
+
processing: {
|
|
396
|
+
denoise?: boolean | undefined;
|
|
397
|
+
trim?: boolean | undefined;
|
|
398
|
+
transcribe?: boolean | undefined;
|
|
399
|
+
waveform?: boolean | undefined;
|
|
400
|
+
reprocess?: boolean | undefined;
|
|
401
|
+
};
|
|
310
402
|
}, {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
label: string;
|
|
319
|
-
url: string;
|
|
320
|
-
}[] | undefined;
|
|
321
|
-
showBlueskyPublicly?: boolean | undefined;
|
|
403
|
+
processing: {
|
|
404
|
+
denoise?: boolean | undefined;
|
|
405
|
+
trim?: boolean | undefined;
|
|
406
|
+
transcribe?: boolean | undefined;
|
|
407
|
+
waveform?: boolean | undefined;
|
|
408
|
+
reprocess?: boolean | undefined;
|
|
409
|
+
};
|
|
322
410
|
}>;
|
|
411
|
+
type PatchAudioPostRequest = z.infer<typeof PatchAudioPostRequestSchema>;
|
|
323
412
|
|
|
324
|
-
export { type CreateAudioPostRequest, CreateAudioPostRequestSchema,
|
|
413
|
+
export { type CreateAudioPostRequest, CreateAudioPostRequestSchema, type PatchAudioPostRequest, PatchAudioPostRequestSchema };
|
package/dist/esm/api-codecs.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export { CreateAudioPostRequestSchema,
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
5
|
-
import './chunk-IHIBHQBJ.js';
|
|
1
|
+
export { CreateAudioPostRequestSchema, PatchAudioPostRequestSchema } from './chunk-F5ZKFJL2.js';
|
|
2
|
+
import './chunk-TVOXIQKF.js';
|
|
3
|
+
import './chunk-D655OH2I.js';
|
|
4
|
+
import './chunk-SMK4OZNU.js';
|
|
6
5
|
import './chunk-5JBD5THX.js';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// types/records.ts
|
|
4
|
+
var FirestoreTimestampSchema = z.union([
|
|
5
|
+
z.custom((data) => {
|
|
6
|
+
return data && typeof data === "object" && (typeof data.toDate === "function" || "seconds" in data && "nanoseconds" in data);
|
|
7
|
+
}),
|
|
8
|
+
z.string(),
|
|
9
|
+
z.number(),
|
|
10
|
+
z.date()
|
|
11
|
+
]).transform((data, ctx) => {
|
|
12
|
+
let date;
|
|
13
|
+
if (data instanceof Date) {
|
|
14
|
+
date = data;
|
|
15
|
+
} else if (typeof data === "string") {
|
|
16
|
+
date = new Date(data);
|
|
17
|
+
} else if (typeof data === "number") {
|
|
18
|
+
date = new Date(data);
|
|
19
|
+
} else if (typeof data.toDate === "function") {
|
|
20
|
+
date = data.toDate();
|
|
21
|
+
} else {
|
|
22
|
+
const timestamp = data;
|
|
23
|
+
date = new Date(timestamp.seconds * 1e3 + timestamp.nanoseconds / 1e6);
|
|
24
|
+
}
|
|
25
|
+
if (Number.isNaN(date.getTime())) {
|
|
26
|
+
ctx.addIssue({
|
|
27
|
+
code: z.ZodIssueCode.custom,
|
|
28
|
+
message: "FirestoreTimestamp coerced to Invalid Date"
|
|
29
|
+
});
|
|
30
|
+
return z.NEVER;
|
|
31
|
+
}
|
|
32
|
+
return date;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export { FirestoreTimestampSchema };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ProcessingRequestSchema, ReplyRefSchema, AudioEmbedSchema } from './chunk-TVOXIQKF.js';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
var CreateAudioPostRequestSchema = z.object({
|
|
5
|
+
/** User-authored text; may be empty for pure-audio posts. */
|
|
6
|
+
text: z.string().max(3e3).default(""),
|
|
7
|
+
/** Optional headline (prompt feature). */
|
|
8
|
+
title: z.string().max(3e3).optional(),
|
|
9
|
+
/** The uploaded audio attachment. */
|
|
10
|
+
embed: AudioEmbedSchema.optional(),
|
|
11
|
+
/** Present ⇒ this is a reply (StrongRef root + parent). */
|
|
12
|
+
reply: ReplyRefSchema.optional(),
|
|
13
|
+
/** BCP-47 language tags. */
|
|
14
|
+
langs: z.array(z.string()).max(3).optional(),
|
|
15
|
+
/** Author self-label values (content warnings). */
|
|
16
|
+
selfLabels: z.array(z.string()).optional(),
|
|
17
|
+
/**
|
|
18
|
+
* Opt-in audio processing for this post's audio (denoise / trim /
|
|
19
|
+
* transcribe / waveform). All default off. Stages the deployment can't
|
|
20
|
+
* provide come back marked `skipped` on the view rather than failing the
|
|
21
|
+
* create. A multi-stage request runs denoise → trim → (transcribe,
|
|
22
|
+
* waveform); request stages individually to override that order. See
|
|
23
|
+
* `types/processing.ts`.
|
|
24
|
+
*/
|
|
25
|
+
processing: ProcessingRequestSchema.optional()
|
|
26
|
+
}).refine((d) => !(d.reply && d.title), {
|
|
27
|
+
message: "Replies cannot have a title",
|
|
28
|
+
path: ["title"]
|
|
29
|
+
}).refine((d) => d.text.trim().length > 0 || !!d.embed, {
|
|
30
|
+
message: "Post must have text or an audio embed",
|
|
31
|
+
path: ["text"]
|
|
32
|
+
});
|
|
33
|
+
var PatchAudioPostRequestSchema = z.object({
|
|
34
|
+
/** Opt-in audio processing to (re)run for this post's audio. Required — a
|
|
35
|
+
* PATCH with no processing request is a no-op and rejected as invalid. */
|
|
36
|
+
processing: ProcessingRequestSchema
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export { CreateAudioPostRequestSchema, PatchAudioPostRequestSchema };
|
|
@@ -4,6 +4,10 @@ var NSID = {
|
|
|
4
4
|
// See lexicons/dev/antiphony/ + packages/shared/types/audio.ts.
|
|
5
5
|
AudioPost: "dev.antiphony.audio.post",
|
|
6
6
|
AudioTranscript: "dev.antiphony.audio.transcript",
|
|
7
|
+
// Portable lexicon only — the core never stores actor profiles; the
|
|
8
|
+
// caller BFF is the sole authority for profile data (see
|
|
9
|
+
// specs/core-bff-boundary.md, "actor.profile lexicon"). Hence no
|
|
10
|
+
// COLLECTIONS entry below.
|
|
7
11
|
ActorProfile: "dev.antiphony.actor.profile"
|
|
8
12
|
};
|
|
9
13
|
var EMBED_NSID = {
|
|
@@ -11,15 +15,9 @@ var EMBED_NSID = {
|
|
|
11
15
|
RecordWithAudio: "dev.antiphony.embed.recordWithAudio"
|
|
12
16
|
};
|
|
13
17
|
var COLLECTIONS = {
|
|
14
|
-
// One post collection + the transcript enrichment namespace
|
|
18
|
+
// One post collection + the transcript enrichment namespace.
|
|
15
19
|
[NSID.AudioPost]: "posts",
|
|
16
|
-
[NSID.AudioTranscript]: "audio_transcripts"
|
|
17
|
-
[NSID.ActorProfile]: "users"
|
|
20
|
+
[NSID.AudioTranscript]: "audio_transcripts"
|
|
18
21
|
};
|
|
19
|
-
function nsidForCollection(collection) {
|
|
20
|
-
const entries = Object.entries(COLLECTIONS);
|
|
21
|
-
const match = entries.find(([, col]) => col === collection);
|
|
22
|
-
return match == null ? void 0 : match[0];
|
|
23
|
-
}
|
|
24
22
|
|
|
25
|
-
export { COLLECTIONS, EMBED_NSID, NSID
|
|
23
|
+
export { COLLECTIONS, EMBED_NSID, NSID };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// types/blob.ts
|
|
4
|
+
var BlobRefSchema = z.object({
|
|
5
|
+
/** Discriminator for AT Protocol type system */
|
|
6
|
+
$type: z.literal("blob"),
|
|
7
|
+
/** IPLD link to the blob bytes: the content CID. */
|
|
8
|
+
ref: z.object({
|
|
9
|
+
$link: z.string().min(1)
|
|
10
|
+
}),
|
|
11
|
+
/** MIME type of the blob (e.g., 'audio/webm') */
|
|
12
|
+
mimeType: z.string(),
|
|
13
|
+
/** Size of the blob in bytes */
|
|
14
|
+
size: z.number().int().min(0)
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
export { BlobRefSchema };
|