@deveye/types 0.21.2 → 0.21.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deveye/types",
3
- "version": "0.21.2",
3
+ "version": "0.21.4",
4
4
  "description": "Shared contracts (types + zod schemas) for DevEye apps",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -204,7 +204,7 @@ export const FEATURE_REGISTRY: readonly (FeatureDescriptor & { id: WorkspaceFeat
204
204
  icon: 'rocket',
205
205
  notifies: true,
206
206
  notifications: {
207
- hint: 'Envoyées à l’atterrissage d’un déploiement, échec comme succès, y compris ceux lancés ailleurs : depuis Dokploy, une CI ou un push git.'
207
+ hint: 'Envoyées à l’atterrissage d’un déploiement, échec comme succès, y compris ceux lancés ailleurs : depuis Dokploy, une CI ou un push git. Et quand le lien avec l’instance d’un accès se perd, puis revient.'
208
208
  },
209
209
  hasItems: true,
210
210
  itemNoun: 'cible',
@@ -182,8 +182,10 @@ export interface NotificationChannelRow {
182
182
  /** La fonctionnalité propriétaire : un canal est une source de sa feature. */
183
183
  feature: NotificationFeature;
184
184
  kind: NotificationChannelKind;
185
- label_enc: string;
186
- target_enc: string;
185
+ /** Libellé chiffré ; `null` = jamais nommé. */
186
+ label_enc: string | null;
187
+ /** Adresse ou URL chiffrée ; `null` sur un `email` = l'adresse du compte expéditeur. */
188
+ target_enc: string | null;
187
189
  mail_account_id: number | null;
188
190
  enabled: number;
189
191
  position: number;
@@ -288,10 +288,36 @@ export const debugMailSend = {
288
288
  })
289
289
  };
290
290
 
291
+ /**
292
+ * Une page publique de l'instance, mesurée par la balise : la page d'état
293
+ * (`STATUS_PAGE_URL`) ou le site vitrine (`SITE_URL`). Son site vit dans le
294
+ * même espace que celui de l'app.
295
+ */
296
+ export const debugTrackingCompanionSchema = z.object({
297
+ kind: z.enum(['status', 'site']),
298
+ /** L'adresse réglée dans l'env, dont l'hôte est la seule origine admise. */
299
+ url: z.string(),
300
+ /** `null` tant que le site n'est pas déclaré. */
301
+ site: z
302
+ .object({
303
+ siteId: z.number().int().positive(),
304
+ /** `null` quand le site a disparu d'Audience. */
305
+ siteName: z.string().nullable(),
306
+ /** Publique par nature : la page qui la porte la montre à tous. */
307
+ key: z.string()
308
+ })
309
+ .nullable()
310
+ });
311
+ export type DebugTrackingCompanion = z.infer<typeof debugTrackingCompanionSchema>;
312
+
291
313
  export const debugTrackingSchema = z.object({
292
314
  /** L'origine de ce serveur : un réglage ne vaut que pour la sienne. */
293
315
  origin: z.string(),
316
+ /** D'où les pages chargent la balise (`AUDIENCE_ORIGIN`, sinon celle de l'app). */
317
+ ingestOrigin: z.string(),
294
318
  audienceInstalled: z.boolean(),
319
+ /** Les pages publiques qui ont une adresse ; vide, seule l'app est mesurée. */
320
+ companions: z.array(debugTrackingCompanionSchema),
295
321
  config: z
296
322
  .object({
297
323
  siteId: z.number().int().positive(),
@@ -323,7 +349,11 @@ export const debugTrackingGet = {
323
349
  output: debugTrackingSchema
324
350
  };
325
351
 
326
- /** Crée dans l'espace personnel de l'administrateur un site Audience réglé pour ce serveur, et s'y branche. */
352
+ /**
353
+ * Crée ce qui manque : le site de l'app dans l'espace personnel de
354
+ * l'administrateur s'il n'est pas branché, puis celui de chaque page publique
355
+ * qui n'en a pas encore, dans le même espace. Tout déclaré, c'est un conflit.
356
+ */
327
357
  export const debugTrackingCreate = {
328
358
  command: 'debug.trackingCreate' as const,
329
359
  input: z.object({}),
package/src/index.ts CHANGED
@@ -923,6 +923,7 @@ export {
923
923
  debugRunStatusSchema,
924
924
  debugStepStatusSchema,
925
925
  debugTrackingClear,
926
+ debugTrackingCompanionSchema,
926
927
  debugTrackingCreate,
927
928
  debugTrackingGet,
928
929
  debugTrackingSchema,
@@ -946,6 +947,7 @@ export type {
946
947
  DebugRunKind,
947
948
  DebugStepStatus,
948
949
  DebugTracking,
950
+ DebugTrackingCompanion,
949
951
  DebugWorkspaceSender
950
952
  } from './features/debug';
951
953
  export {
@@ -224,8 +224,10 @@ export interface AudienceItemsProvider {
224
224
  /**
225
225
  * Key under `FeatureService.providers` for DevEye's own usage figures: the
226
226
  * app reports the pages its members open and the actions they take into an
227
- * Audience site of this very instance, chosen by an administrator. Absent
228
- * module: nothing is reported, and the admin page says why.
227
+ * Audience site of this very instance, chosen by an administrator, and
228
+ * declares beside it a site for each of its public faces (status page,
229
+ * showcase site), measured by the public beacon. Absent module: nothing is
230
+ * reported, and the admin page says why.
229
231
  */
230
232
  export const AUDIENCE_SELF_PROVIDER = 'audience.self' as const;
231
233
 
@@ -252,16 +254,41 @@ export interface AudienceSelfEvent {
252
254
  screenWidth?: number;
253
255
  }
254
256
 
257
+ /** A question of a feedback form the app declares: the public shape of the module's own field schema. */
258
+ export interface AudienceSelfFormField {
259
+ name: string;
260
+ kind: 'text' | 'email' | 'number' | 'boolean' | 'choice';
261
+ required: boolean;
262
+ /** `choice` only: the admitted answers. */
263
+ choices?: readonly string[];
264
+ /** `choice` only: several boxes may be ticked. */
265
+ multiple?: boolean;
266
+ }
267
+
255
268
  export interface AudienceSelfProvider {
256
269
  /**
257
- * Creates an anonymous site for this host in this workspace, active, with
258
- * no per-visitor limit. The caller owns the authorisation; the owner's
259
- * plan still applies.
270
+ * Creates an anonymous site for this host in this workspace, active. The
271
+ * caller owns the authorisation; the owner's plan still applies.
272
+ *
273
+ * `measuredBy`: `server` for the app itself, which reports through
274
+ * `ingest` with no per-address cap (its members behind one network are
275
+ * one address); `beacon` for a public page that embeds the tracking
276
+ * script, where the per-address cap of a new site applies.
260
277
  */
261
278
  createSite(
262
279
  workspaceId: number,
263
- input: { name: string; host: string }
280
+ input: { name: string; host: string; description: string; measuredBy: 'server' | 'beacon' }
264
281
  ): Promise<AudienceSelfSite & { publicKey: string }>;
282
+ /**
283
+ * Declares a strict feedback form on a site created here, or returns the
284
+ * one already bearing that name: a public page submits to it by name
285
+ * through the public gate.
286
+ */
287
+ declareForm(
288
+ workspaceId: number,
289
+ siteId: number,
290
+ input: { name: string; fields: readonly AudienceSelfFormField[] }
291
+ ): Promise<{ formId: number }>;
265
292
  /** The site behind this key, wherever it lives; `null` when unknown. */
266
293
  findByKey(publicKey: string): Promise<AudienceSelfSite | null>;
267
294
  /**