Skip to content

Commit 4ca0ae3

Browse files
committed
chore(rosters): count sys_user_device in the platform-object roster, the messaging translation bundles, the D10 inventory and the tenancy census
Claude-Session: https://claude.ai/code/session_01ADHkmRD9KKqvTU3THnute6 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3d4e3b5 commit 4ca0ae3

13 files changed

Lines changed: 304 additions & 5 deletions

‎packages/cli/src/utils/organization-ownership-inventory.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,14 @@ export const ORGANIZATION_OWNERSHIP_INVENTORY: readonly InventoryEntry[] = [
352352
),
353353
{ object: 'sys_metadata_activation', census: P1, fate: 'column-drop', citation: `${D7}, D6, D14 (C0): the tenant-less activation ledger` },
354354
{ object: 'sys_presence', census: P1, fate: 'column-drop', citation: `${CENSUS_MAIN}: systemFields.tenant: false; ${D7}` },
355+
{
356+
object: 'sys_user_device',
357+
census: PMAIN,
358+
fate: 'column-drop',
359+
citation:
360+
`${CENSUS_MAIN}: tenancy.enabled: false and no organization_id field; ${D7}: a push device belongs to its user, ` +
361+
'never to an organization (spec UserDeviceSchema, rule a)',
362+
},
355363
{
356364
object: 'sys_platform_setting',
357365
census: PMAIN,

‎packages/services/service-messaging/scripts/i18n-extract.config.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import {
4343
NotificationPreference,
4444
NotificationTemplate,
4545
HttpDelivery,
46+
UserDevice,
4647
} from '../src/objects/index.js';
4748
import { enObjects } from '../src/translations/en.objects.generated.js';
4849
import { zhCNObjects } from '../src/translations/zh-CN.objects.generated.js';
@@ -71,6 +72,7 @@ const config: ObjectStackDefinition = defineStack({
7172
NotificationPreference,
7273
NotificationTemplate,
7374
HttpDelivery,
75+
UserDevice,
7476
] as any,
7577
translations: [
7678
{ en: { objects: enObjects } },

‎packages/services/service-messaging/src/objects/user-device.object.ts‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ export const UserDevice = ObjectSchema.create({
7373
description: 'The user the device belongs to: the signed-in user who registered it.',
7474
}),
7575

76-
vendor: Field.select(['apns', 'fcm'], {
76+
vendor: Field.select([
77+
{ label: 'APNs', value: 'apns' },
78+
{ label: 'FCM', value: 'fcm' },
79+
], {
7780
label: 'Vendor',
7881
required: true,
7982
description: 'Push vendor the token belongs to.',
@@ -92,7 +95,11 @@ export const UserDevice = ObjectSchema.create({
9295
// Spec's `PUSH_DEVICE_PLATFORMS` is not on a public entry, so the three
9396
// are spelled here; `user-device.object.test.ts` holds them equal to
9497
// the registration schema's enum.
95-
platform: Field.select(['ios', 'android', 'web'], {
98+
platform: Field.select([
99+
{ label: 'iOS', value: 'ios' },
100+
{ label: 'Android', value: 'android' },
101+
{ label: 'Web', value: 'web' },
102+
], {
96103
label: 'Platform',
97104
required: true,
98105
}),

‎packages/services/service-messaging/src/translations/bundle-ownership.test.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const OWNED_OBJECTS = new Set([
2323
'sys_notification_preference',
2424
'sys_notification_template',
2525
'sys_http_delivery',
26+
'sys_user_device',
2627
]);
2728

2829
describe('objects translation bundle ownership (ADR-0029 D8)', () => {

‎packages/services/service-messaging/src/translations/en.objects.generated.ts‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,5 +417,69 @@ export const enObjects: NonNullable<TranslationData['objects']> = {
417417
label: "Pending"
418418
}
419419
}
420+
},
421+
sys_user_device: {
422+
label: "User Device",
423+
pluralLabel: "User Devices",
424+
description: "A user's push device: one row per app install, holding its vendor push token.",
425+
fields: {
426+
id: {
427+
label: "Row ID"
428+
},
429+
device_id: {
430+
label: "Device ID",
431+
help: "Client-held device id, stable per app install. Unique per user."
432+
},
433+
user_id: {
434+
label: "User",
435+
help: "The user the device belongs to: the signed-in user who registered it."
436+
},
437+
vendor: {
438+
label: "Vendor",
439+
help: "Push vendor the token belongs to.",
440+
options: {
441+
apns: "APNs",
442+
fcm: "FCM"
443+
}
444+
},
445+
token: {
446+
label: "Push Token",
447+
help: "Vendor push token. Held by one device at a time."
448+
},
449+
platform: {
450+
label: "Platform",
451+
options: {
452+
ios: "iOS",
453+
android: "Android",
454+
web: "Web"
455+
}
456+
},
457+
app_id: {
458+
label: "App ID",
459+
help: "The iOS bundle ID or Android application ID the token was issued to."
460+
},
461+
locale: {
462+
label: "Locale",
463+
help: "Device locale that pushes to this device are rendered in."
464+
},
465+
name: {
466+
label: "Device Name"
467+
},
468+
enabled: {
469+
label: "Enabled",
470+
help: "False once the vendor reported the token dead; nothing is delivered to a disabled device."
471+
},
472+
invalidated_at: {
473+
label: "Invalidated At",
474+
help: "When the vendor reported the token dead. Cleared by the registration that re-enables it."
475+
},
476+
last_seen_at: {
477+
label: "Last Seen At",
478+
help: "When the device last registered or refreshed."
479+
},
480+
created_at: {
481+
label: "Created At"
482+
}
483+
}
420484
}
421485
};

‎packages/services/service-messaging/src/translations/es-ES.objects.generated.ts‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,5 +417,69 @@ export const esESObjects: NonNullable<TranslationData['objects']> = {
417417
label: "Pending"
418418
}
419419
}
420+
},
421+
sys_user_device: {
422+
label: "Dispositivo de usuario",
423+
pluralLabel: "Dispositivos de usuario",
424+
description: "Dispositivo de notificaciones push de un usuario: una fila por instalación de la aplicación, con su token push del proveedor.",
425+
fields: {
426+
id: {
427+
label: "ID de fila"
428+
},
429+
device_id: {
430+
label: "ID del dispositivo",
431+
help: "ID del dispositivo que guarda el cliente, estable en cada instalación de la aplicación. Único por usuario."
432+
},
433+
user_id: {
434+
label: "Usuario",
435+
help: "El usuario al que pertenece el dispositivo: el usuario con sesión iniciada que lo registró."
436+
},
437+
vendor: {
438+
label: "Proveedor",
439+
help: "Proveedor push al que pertenece el token.",
440+
options: {
441+
apns: "APNs",
442+
fcm: "FCM"
443+
}
444+
},
445+
token: {
446+
label: "Token push",
447+
help: "Token push del proveedor. Solo lo tiene un dispositivo a la vez."
448+
},
449+
platform: {
450+
label: "Plataforma",
451+
options: {
452+
ios: "iOS",
453+
android: "Android",
454+
web: "Web"
455+
}
456+
},
457+
app_id: {
458+
label: "ID de la aplicación",
459+
help: "El ID de paquete de iOS o el ID de aplicación de Android para el que se emitió el token."
460+
},
461+
locale: {
462+
label: "Configuración regional",
463+
help: "Configuración regional del dispositivo en la que se muestran las notificaciones push enviadas a él."
464+
},
465+
name: {
466+
label: "Nombre del dispositivo"
467+
},
468+
enabled: {
469+
label: "Habilitado",
470+
help: "Falso cuando el proveedor informa de que el token ya no es válido; a un dispositivo deshabilitado no se le entrega nada."
471+
},
472+
invalidated_at: {
473+
label: "Invalidado el",
474+
help: "Cuándo informó el proveedor de que el token ya no es válido. Se borra con el registro que vuelve a habilitar el dispositivo."
475+
},
476+
last_seen_at: {
477+
label: "Visto por última vez",
478+
help: "Cuándo se registró o actualizó el dispositivo por última vez."
479+
},
480+
created_at: {
481+
label: "Creado el"
482+
}
483+
}
420484
}
421485
};

‎packages/services/service-messaging/src/translations/es-ES.source-hashes.generated.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,4 +150,9 @@ export const esESGeneratedSourceHashes: Readonly<Record<string, string>> = {
150150
"objects.sys_notification_template.fields.version.label": "b74a37c0879ec50e",
151151
"objects.sys_notification_template.label": "30ecafa4dac4b40d",
152152
"objects.sys_notification_template.pluralLabel": "9e270c87ef2578df",
153+
"objects.sys_user_device.fields.platform.options.android": "44fa27bdaae7f812",
154+
"objects.sys_user_device.fields.platform.options.ios": "461f32943613be91",
155+
"objects.sys_user_device.fields.platform.options.web": "2a7ead3da8c035c5",
156+
"objects.sys_user_device.fields.vendor.options.apns": "b6edcf327f308698",
157+
"objects.sys_user_device.fields.vendor.options.fcm": "fc3b030ffd243df4",
153158
};

‎packages/services/service-messaging/src/translations/ja-JP.objects.generated.ts‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,5 +417,69 @@ export const jaJPObjects: NonNullable<TranslationData['objects']> = {
417417
label: "Pending"
418418
}
419419
}
420+
},
421+
sys_user_device: {
422+
label: "ユーザーデバイス",
423+
pluralLabel: "ユーザーデバイス",
424+
description: "ユーザーのプッシュ通知デバイス:アプリのインストールごとに 1 行で、ベンダーのプッシュトークンを保持します。",
425+
fields: {
426+
id: {
427+
label: "行 ID"
428+
},
429+
device_id: {
430+
label: "デバイス ID",
431+
help: "クライアントが保持するデバイス ID。アプリのインストールごとに不変で、ユーザー内で一意です。"
432+
},
433+
user_id: {
434+
label: "ユーザー",
435+
help: "デバイスの所有ユーザー:デバイスを登録したサインイン中のユーザーです。"
436+
},
437+
vendor: {
438+
label: "ベンダー",
439+
help: "トークンが属するプッシュベンダー。",
440+
options: {
441+
apns: "APNs",
442+
fcm: "FCM"
443+
}
444+
},
445+
token: {
446+
label: "プッシュトークン",
447+
help: "ベンダーのプッシュトークン。同時に保持できるのは 1 台のデバイスのみです。"
448+
},
449+
platform: {
450+
label: "プラットフォーム",
451+
options: {
452+
ios: "iOS",
453+
android: "Android",
454+
web: "Web"
455+
}
456+
},
457+
app_id: {
458+
label: "アプリ ID",
459+
help: "トークンの発行先である iOS のバンドル ID または Android のアプリケーション ID。"
460+
},
461+
locale: {
462+
label: "ロケール",
463+
help: "このデバイスへのプッシュ通知の表示に使うデバイスのロケール。"
464+
},
465+
name: {
466+
label: "デバイス名"
467+
},
468+
enabled: {
469+
label: "有効",
470+
help: "ベンダーがトークンの無効を報告すると false になります。無効なデバイスには何も配信されません。"
471+
},
472+
invalidated_at: {
473+
label: "無効化日時",
474+
help: "ベンダーがトークンの無効を報告した日時。デバイスを再度有効にする登録でクリアされます。"
475+
},
476+
last_seen_at: {
477+
label: "最終確認日時",
478+
help: "デバイスが最後に登録または更新された日時。"
479+
},
480+
created_at: {
481+
label: "作成日時"
482+
}
483+
}
420484
}
421485
};

‎packages/services/service-messaging/src/translations/ja-JP.source-hashes.generated.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,4 +149,9 @@ export const jaJPGeneratedSourceHashes: Readonly<Record<string, string>> = {
149149
"objects.sys_notification_template.fields.version.label": "b74a37c0879ec50e",
150150
"objects.sys_notification_template.label": "30ecafa4dac4b40d",
151151
"objects.sys_notification_template.pluralLabel": "9e270c87ef2578df",
152+
"objects.sys_user_device.fields.platform.options.android": "44fa27bdaae7f812",
153+
"objects.sys_user_device.fields.platform.options.ios": "461f32943613be91",
154+
"objects.sys_user_device.fields.platform.options.web": "2a7ead3da8c035c5",
155+
"objects.sys_user_device.fields.vendor.options.apns": "b6edcf327f308698",
156+
"objects.sys_user_device.fields.vendor.options.fcm": "fc3b030ffd243df4",
152157
};

‎packages/services/service-messaging/src/translations/zh-CN.objects.generated.ts‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,5 +417,69 @@ export const zhCNObjects: NonNullable<TranslationData['objects']> = {
417417
label: "待处理"
418418
}
419419
}
420+
},
421+
sys_user_device: {
422+
label: "用户设备",
423+
pluralLabel: "用户设备",
424+
description: "用户的推送设备:每次应用安装一行,保存其厂商推送令牌。",
425+
fields: {
426+
id: {
427+
label: "行 ID"
428+
},
429+
device_id: {
430+
label: "设备 ID",
431+
help: "由客户端保存的设备 ID,每次应用安装保持不变。同一用户内唯一。"
432+
},
433+
user_id: {
434+
label: "用户",
435+
help: "设备所属的用户:注册该设备的已登录用户。"
436+
},
437+
vendor: {
438+
label: "厂商",
439+
help: "令牌所属的推送厂商。",
440+
options: {
441+
apns: "APNs",
442+
fcm: "FCM"
443+
}
444+
},
445+
token: {
446+
label: "推送令牌",
447+
help: "厂商推送令牌。同一时间只由一台设备持有。"
448+
},
449+
platform: {
450+
label: "平台",
451+
options: {
452+
ios: "iOS",
453+
android: "Android",
454+
web: "Web"
455+
}
456+
},
457+
app_id: {
458+
label: "应用 ID",
459+
help: "令牌签发给的 iOS Bundle ID 或 Android 应用 ID。"
460+
},
461+
locale: {
462+
label: "语言区域",
463+
help: "发送到此设备的推送所使用的设备语言区域。"
464+
},
465+
name: {
466+
label: "设备名称"
467+
},
468+
enabled: {
469+
label: "已启用",
470+
help: "厂商报告令牌失效后为否;不会向已停用的设备投递任何内容。"
471+
},
472+
invalidated_at: {
473+
label: "失效时间",
474+
help: "厂商报告令牌失效的时间。重新启用该设备的注册会将其清除。"
475+
},
476+
last_seen_at: {
477+
label: "最近活跃时间",
478+
help: "设备最近一次注册或刷新的时间。"
479+
},
480+
created_at: {
481+
label: "创建时间"
482+
}
483+
}
420484
}
421485
};

0 commit comments

Comments
 (0)