@vibes.diy/api-types 14.3.354 → 14.3.355

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.
@@ -0,0 +1,4 @@
1
+ export type AssetMagic = readonly (readonly [number, readonly number[]])[];
2
+ export declare const ASSET_MAGIC: readonly (readonly [string, AssetMagic])[];
3
+ export declare function headMatchesMagic(head: Uint8Array, magic: AssetMagic): boolean;
4
+ export declare function sniffAssetMime(head: Uint8Array): string | null;
package/asset-magic.js ADDED
@@ -0,0 +1,48 @@
1
+ export const ASSET_MAGIC = [
2
+ ["image/png", [[0, [0x89, 0x50, 0x4e, 0x47]]]],
3
+ ["image/jpeg", [[0, [0xff, 0xd8, 0xff]]]],
4
+ ["image/gif", [[0, [0x47, 0x49, 0x46, 0x38]]]],
5
+ [
6
+ "image/webp",
7
+ [
8
+ [0, [0x52, 0x49, 0x46, 0x46]],
9
+ [8, [0x57, 0x45, 0x42, 0x50]],
10
+ ],
11
+ ],
12
+ ["application/pdf", [[0, [0x25, 0x50, 0x44, 0x46]]]],
13
+ ["audio/mpeg", [[0, [0x49, 0x44, 0x33]]]],
14
+ [
15
+ "audio/wav",
16
+ [
17
+ [0, [0x52, 0x49, 0x46, 0x46]],
18
+ [8, [0x57, 0x41, 0x56, 0x45]],
19
+ ],
20
+ ],
21
+ ["audio/ogg", [[0, [0x4f, 0x67, 0x67, 0x53]]]],
22
+ [
23
+ "audio/mp4",
24
+ [
25
+ [4, [0x66, 0x74, 0x79, 0x70]],
26
+ [8, [0x4d, 0x34, 0x41, 0x20]],
27
+ ],
28
+ ],
29
+ [
30
+ "image/avif",
31
+ [
32
+ [4, [0x66, 0x74, 0x79, 0x70]],
33
+ [8, [0x61, 0x76, 0x69, 0x66]],
34
+ ],
35
+ ],
36
+ ["font/woff2", [[0, [0x77, 0x4f, 0x46, 0x32]]]],
37
+ ["font/ttf", [[0, [0x00, 0x01, 0x00, 0x00]]]],
38
+ ];
39
+ export function headMatchesMagic(head, magic) {
40
+ return magic.every(([off, bytes]) => bytes.every((b, i) => head[off + i] === b));
41
+ }
42
+ export function sniffAssetMime(head) {
43
+ for (const [mime, magic] of ASSET_MAGIC) {
44
+ if (headMatchesMagic(head, magic))
45
+ return mime;
46
+ }
47
+ return null;
48
+ }
package/index.d.ts CHANGED
@@ -79,6 +79,7 @@ export * from "./billing-msg.js";
79
79
  export * from "./credits-copy.js";
80
80
  export * from "./asset.js";
81
81
  export * from "./asset-extensions.js";
82
+ export * from "./asset-magic.js";
82
83
  export * from "./report.js";
83
84
  export * from "./report-activity-engaged.js";
84
85
  export * from "./home-feed.js";
package/index.js CHANGED
@@ -78,6 +78,7 @@ export * from "./billing-msg.js";
78
78
  export * from "./credits-copy.js";
79
79
  export * from "./asset.js";
80
80
  export * from "./asset-extensions.js";
81
+ export * from "./asset-magic.js";
81
82
  export * from "./report.js";
82
83
  export * from "./report-activity-engaged.js";
83
84
  export * from "./home-feed.js";
package/invite-flow.d.ts CHANGED
@@ -8,53 +8,6 @@ export declare const KeyGrantKey: import("arktype/internal/variants/object.ts").
8
8
  export type KeyGrantKey = typeof KeyGrantKey.infer;
9
9
  export declare const ResKeyGrantItem: import("arktype/internal/variants/object.ts").ObjectType<{
10
10
  entry: {
11
- type: "app.acl.active.request";
12
- role: "viewer";
13
- state: "pending";
14
- request: {
15
- key: string;
16
- provider: "clerk" | "github" | "google";
17
- msg?: string | undefined;
18
- userId: string;
19
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
20
- };
21
- } | {
22
- type: "app.acl.active.request";
23
- role: "editor" | "submitter" | "viewer";
24
- state: "approved";
25
- request: {
26
- key: string;
27
- provider: "clerk" | "github" | "google";
28
- msg?: string | undefined;
29
- userId: string;
30
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
31
- };
32
- tick: {
33
- count: number;
34
- last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
35
- };
36
- grant: {
37
- ownerId: string;
38
- key?: string | undefined;
39
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
40
- };
41
- } | {
42
- type: "app.acl.active.request";
43
- role: "editor" | "submitter" | "viewer";
44
- state: "rejected";
45
- request: {
46
- key: string;
47
- provider: "clerk" | "github" | "google";
48
- msg?: string | undefined;
49
- userId: string;
50
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
51
- };
52
- grant: {
53
- ownerId: string;
54
- key?: string | undefined;
55
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
56
- };
57
- } | {
58
11
  type: "app.acl.active.invite";
59
12
  role: "editor";
60
13
  state: "pending";
@@ -140,6 +93,53 @@ export declare const ResKeyGrantItem: import("arktype/internal/variants/object.t
140
93
  count: number;
141
94
  last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
142
95
  };
96
+ } | {
97
+ type: "app.acl.active.request";
98
+ role: "viewer";
99
+ state: "pending";
100
+ request: {
101
+ key: string;
102
+ provider: "clerk" | "github" | "google";
103
+ msg?: string | undefined;
104
+ userId: string;
105
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
106
+ };
107
+ } | {
108
+ type: "app.acl.active.request";
109
+ role: "editor" | "submitter" | "viewer";
110
+ state: "approved";
111
+ request: {
112
+ key: string;
113
+ provider: "clerk" | "github" | "google";
114
+ msg?: string | undefined;
115
+ userId: string;
116
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
117
+ };
118
+ tick: {
119
+ count: number;
120
+ last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
121
+ };
122
+ grant: {
123
+ ownerId: string;
124
+ key?: string | undefined;
125
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
126
+ };
127
+ } | {
128
+ type: "app.acl.active.request";
129
+ role: "editor" | "submitter" | "viewer";
130
+ state: "rejected";
131
+ request: {
132
+ key: string;
133
+ provider: "clerk" | "github" | "google";
134
+ msg?: string | undefined;
135
+ userId: string;
136
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
137
+ };
138
+ grant: {
139
+ ownerId: string;
140
+ key?: string | undefined;
141
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
142
+ };
143
143
  };
144
144
  grantUserId?: string | undefined;
145
145
  grantType: "invite" | "request";
@@ -168,53 +168,6 @@ export declare const ResListKeyGrants: import("arktype/internal/variants/object.
168
168
  items: {
169
169
  key: string;
170
170
  entry: {
171
- type: "app.acl.active.request";
172
- role: "viewer";
173
- state: "pending";
174
- request: {
175
- key: string;
176
- provider: "clerk" | "github" | "google";
177
- msg?: string | undefined;
178
- userId: string;
179
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
180
- };
181
- } | {
182
- type: "app.acl.active.request";
183
- role: "editor" | "submitter" | "viewer";
184
- state: "approved";
185
- request: {
186
- key: string;
187
- provider: "clerk" | "github" | "google";
188
- msg?: string | undefined;
189
- userId: string;
190
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
191
- };
192
- tick: {
193
- count: number;
194
- last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
195
- };
196
- grant: {
197
- ownerId: string;
198
- key?: string | undefined;
199
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
200
- };
201
- } | {
202
- type: "app.acl.active.request";
203
- role: "editor" | "submitter" | "viewer";
204
- state: "rejected";
205
- request: {
206
- key: string;
207
- provider: "clerk" | "github" | "google";
208
- msg?: string | undefined;
209
- userId: string;
210
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
211
- };
212
- grant: {
213
- ownerId: string;
214
- key?: string | undefined;
215
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
216
- };
217
- } | {
218
171
  type: "app.acl.active.invite";
219
172
  role: "editor";
220
173
  state: "pending";
@@ -300,6 +253,53 @@ export declare const ResListKeyGrants: import("arktype/internal/variants/object.
300
253
  count: number;
301
254
  last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
302
255
  };
256
+ } | {
257
+ type: "app.acl.active.request";
258
+ role: "viewer";
259
+ state: "pending";
260
+ request: {
261
+ key: string;
262
+ provider: "clerk" | "github" | "google";
263
+ msg?: string | undefined;
264
+ userId: string;
265
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
266
+ };
267
+ } | {
268
+ type: "app.acl.active.request";
269
+ role: "editor" | "submitter" | "viewer";
270
+ state: "approved";
271
+ request: {
272
+ key: string;
273
+ provider: "clerk" | "github" | "google";
274
+ msg?: string | undefined;
275
+ userId: string;
276
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
277
+ };
278
+ tick: {
279
+ count: number;
280
+ last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
281
+ };
282
+ grant: {
283
+ ownerId: string;
284
+ key?: string | undefined;
285
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
286
+ };
287
+ } | {
288
+ type: "app.acl.active.request";
289
+ role: "editor" | "submitter" | "viewer";
290
+ state: "rejected";
291
+ request: {
292
+ key: string;
293
+ provider: "clerk" | "github" | "google";
294
+ msg?: string | undefined;
295
+ userId: string;
296
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
297
+ };
298
+ grant: {
299
+ ownerId: string;
300
+ key?: string | undefined;
301
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
302
+ };
303
303
  };
304
304
  grantUserId?: string | undefined;
305
305
  updated: string;
@@ -321,53 +321,6 @@ export declare const ReqUpsertKeyGrant: import("arktype/internal/variants/object
321
321
  appSlug: string;
322
322
  ownerHandle: string;
323
323
  entry: {
324
- type: "app.acl.active.request";
325
- role: "viewer";
326
- state: "pending";
327
- request: {
328
- key: string;
329
- provider: "clerk" | "github" | "google";
330
- msg?: string | undefined;
331
- userId: string;
332
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
333
- };
334
- } | {
335
- type: "app.acl.active.request";
336
- role: "editor" | "submitter" | "viewer";
337
- state: "approved";
338
- request: {
339
- key: string;
340
- provider: "clerk" | "github" | "google";
341
- msg?: string | undefined;
342
- userId: string;
343
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
344
- };
345
- tick: {
346
- count: number;
347
- last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
348
- };
349
- grant: {
350
- ownerId: string;
351
- key?: string | undefined;
352
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
353
- };
354
- } | {
355
- type: "app.acl.active.request";
356
- role: "editor" | "submitter" | "viewer";
357
- state: "rejected";
358
- request: {
359
- key: string;
360
- provider: "clerk" | "github" | "google";
361
- msg?: string | undefined;
362
- userId: string;
363
- created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
364
- };
365
- grant: {
366
- ownerId: string;
367
- key?: string | undefined;
368
- on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
369
- };
370
- } | {
371
324
  type: "app.acl.active.invite";
372
325
  role: "editor";
373
326
  state: "pending";
@@ -453,16 +406,7 @@ export declare const ReqUpsertKeyGrant: import("arktype/internal/variants/object
453
406
  count: number;
454
407
  last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
455
408
  };
456
- };
457
- }, {}>;
458
- export type ReqUpsertKeyGrant = typeof ReqUpsertKeyGrant.infer;
459
- export declare function isReqUpsertKeyGrant(obj: unknown): obj is ReqUpsertKeyGrant;
460
- export declare const ResUpsertKeyGrant: import("arktype/internal/variants/object.ts").ObjectType<{
461
- appSlug: string;
462
- ownerHandle: string;
463
- grantType: "invite" | "request";
464
- key: string;
465
- entry: {
409
+ } | {
466
410
  type: "app.acl.active.request";
467
411
  role: "viewer";
468
412
  state: "pending";
@@ -509,7 +453,16 @@ export declare const ResUpsertKeyGrant: import("arktype/internal/variants/object
509
453
  key?: string | undefined;
510
454
  on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
511
455
  };
512
- } | {
456
+ };
457
+ }, {}>;
458
+ export type ReqUpsertKeyGrant = typeof ReqUpsertKeyGrant.infer;
459
+ export declare function isReqUpsertKeyGrant(obj: unknown): obj is ReqUpsertKeyGrant;
460
+ export declare const ResUpsertKeyGrant: import("arktype/internal/variants/object.ts").ObjectType<{
461
+ appSlug: string;
462
+ ownerHandle: string;
463
+ grantType: "invite" | "request";
464
+ key: string;
465
+ entry: {
513
466
  type: "app.acl.active.invite";
514
467
  role: "editor";
515
468
  state: "pending";
@@ -595,6 +548,53 @@ export declare const ResUpsertKeyGrant: import("arktype/internal/variants/object
595
548
  count: number;
596
549
  last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
597
550
  };
551
+ } | {
552
+ type: "app.acl.active.request";
553
+ role: "viewer";
554
+ state: "pending";
555
+ request: {
556
+ key: string;
557
+ provider: "clerk" | "github" | "google";
558
+ msg?: string | undefined;
559
+ userId: string;
560
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
561
+ };
562
+ } | {
563
+ type: "app.acl.active.request";
564
+ role: "editor" | "submitter" | "viewer";
565
+ state: "approved";
566
+ request: {
567
+ key: string;
568
+ provider: "clerk" | "github" | "google";
569
+ msg?: string | undefined;
570
+ userId: string;
571
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
572
+ };
573
+ tick: {
574
+ count: number;
575
+ last: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
576
+ };
577
+ grant: {
578
+ ownerId: string;
579
+ key?: string | undefined;
580
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
581
+ };
582
+ } | {
583
+ type: "app.acl.active.request";
584
+ role: "editor" | "submitter" | "viewer";
585
+ state: "rejected";
586
+ request: {
587
+ key: string;
588
+ provider: "clerk" | "github" | "google";
589
+ msg?: string | undefined;
590
+ userId: string;
591
+ created: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
592
+ };
593
+ grant: {
594
+ ownerId: string;
595
+ key?: string | undefined;
596
+ on: Date | ((In: string) => import("arktype/internal/attributes.ts").To<Date>);
597
+ };
598
598
  };
599
599
  grantUserId?: string | undefined;
600
600
  updated: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibes.diy/api-types",
3
- "version": "14.3.354",
3
+ "version": "14.3.355",
4
4
  "license": "SEE LICENSE IN LICENSE.md",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -25,9 +25,9 @@
25
25
  "dependencies": {
26
26
  "@adviser/cement": "~0.5.37",
27
27
  "@cloudflare/workers-types": "~5.20261101.1",
28
- "@vibes.diy/call-ai-v2": "14.3.354",
29
- "@vibes.diy/identity": "14.3.354",
30
- "@vibes.diy/vibe-types": "14.3.354",
28
+ "@vibes.diy/call-ai-v2": "14.3.355",
29
+ "@vibes.diy/identity": "14.3.355",
30
+ "@vibes.diy/vibe-types": "14.3.355",
31
31
  "arktype": "~2.2.9"
32
32
  },
33
33
  "repository": {