cordova-plugin-pushizo 0.1.0 → 0.3.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.
@@ -19,6 +19,16 @@ export interface LoginOptions {
19
19
  identityHash?: string;
20
20
  /** SDK isteklerinde `Authorization: Bearer` başlığıyla gider; süresi dolunca `updateUserJwt` ile yenilenir. */
21
21
  jwt?: string;
22
+ /** Girişle birlikte ayarlanan profil; geçersiz e-posta veya telefon girişten önce `INVALID_ARGUMENT` ile reddedilir. */
23
+ profile?: UserProfile;
24
+ }
25
+ /** `Pushizo.login` ile tek çağrıda ayarlanan profil alanları (native `HsUserProfile`). */
26
+ export interface UserProfile {
27
+ email?: string;
28
+ /** E.164 biçiminde telefon numarası. */
29
+ sms?: string;
30
+ tags?: Record<string, InAppTriggerValue>;
31
+ aliases?: Record<string, string>;
22
32
  }
23
33
  /** Bildirim içeriği (native `HsNotification` / `HSNotification`). */
24
34
  export interface PushizoNotification {
@@ -103,6 +113,41 @@ export interface InboxPage {
103
113
  nextCursor: string | null;
104
114
  hasMore: boolean;
105
115
  }
116
+ /** İçerik kartı türü (ADR-0082). */
117
+ export type ContentCardType = 'classic' | 'captioned_image' | 'image_only';
118
+ /** İçerik kartı; zamanlar epoch milisaniyedir. Akış sabitlenmiş → öncelik → yeni sırasıyla gelir. */
119
+ export interface ContentCard {
120
+ id: string;
121
+ messageId: string | null;
122
+ type: ContentCardType;
123
+ title: string | null;
124
+ body: string | null;
125
+ url: string | null;
126
+ imageUrl: string | null;
127
+ buttonText: string | null;
128
+ data: Record<string, string>;
129
+ pinned: boolean;
130
+ priority: number;
131
+ viewed: boolean;
132
+ clicked: boolean;
133
+ expiresAt: number | null;
134
+ createdAt: number | null;
135
+ }
136
+ export interface ContentCardFeed {
137
+ cards: ContentCard[];
138
+ unviewedCount: number;
139
+ }
140
+ /** Kart olayı: gösterim, tıklama veya kapatma. */
141
+ export type ContentCardEvent = 'impression' | 'click' | 'dismiss';
142
+ /**
143
+ * `Inbox.addObserver` olayı (yerel `HsInboxChangeEvent` / `HSInboxChangeEvent`, Web SDK `InboxChangeEvent`).
144
+ * `itemId` yalnızca tek öğe olaylarında (`read`, `archived`) bulunur; `unreadCount` güncel okunmamış sayısıdır.
145
+ */
146
+ export interface InboxChangeEvent {
147
+ type: 'listed' | 'read' | 'read_all' | 'archived' | 'count';
148
+ itemId?: string;
149
+ unreadCount: number;
150
+ }
106
151
  export interface InboxListOptions {
107
152
  /** 1-200 (varsayılan 50). */
108
153
  limit?: number;
@@ -137,6 +182,15 @@ export interface UserPreferences {
137
182
  preferences: UserPreference[];
138
183
  categories: PreferenceCategory[];
139
184
  }
185
+ /** Rıza kaydı (`User.getConsents`; ADR-0037): `ads_personalization` gibi ayrılmış amaç anahtarları. */
186
+ export interface UserConsent {
187
+ purpose: string;
188
+ granted: boolean;
189
+ /** Kaydı yazan taraf (`sdk`, `api`, `dashboard` …); kayıt yoksa null. */
190
+ source: string | null;
191
+ /** Epoch milisaniye; kayıt yoksa null. */
192
+ updatedAt: number | null;
193
+ }
140
194
  /** `User.setPreferences` girdisi; `channel` verilmezse veya null ise tüm kanallar. */
141
195
  export interface PreferenceInput {
142
196
  category: string;
@@ -144,6 +198,18 @@ export interface PreferenceInput {
144
198
  channel?: PreferenceChannel | null;
145
199
  }
146
200
  export type InAppTriggerValue = string | number | boolean;
201
+ /**
202
+ * `User.setProperty` değeri: metin, sonlu sayı, mantıksal ya da bunların dizisi/düz nesnesi. En üstteki `null` özelliği
203
+ * siler; iç içe `null` kabul edilmez.
204
+ */
205
+ export type UserPropertyValue = string | number | boolean | null | UserPropertyValue[] | {
206
+ [key: string]: UserPropertyValue;
207
+ };
208
+ /** `Session.sendEvent` seçenekleri. */
209
+ export interface SendEventOptions {
210
+ /** Tekilleştirme kimliği: 8-64 karakter; harf, rakam ve `. _ : -`. Biçim geçersizse yerel SDK kendi kimliğini üretir. */
211
+ eventId?: string;
212
+ }
147
213
  /**
148
214
  * iOS Live Activity alan değeri (`PushizoDefaultLiveActivityAttributes.data` / `ContentState.data`): metin, sonlu
149
215
  * sayı veya mantıksal değer.
@@ -163,6 +229,180 @@ export interface RawInAppLifecycleEvent {
163
229
  id: string;
164
230
  };
165
231
  }
232
+ /** Özellik bayrağı değeri: metin, sayı, mantıksal, nesne veya dizi (JSON). */
233
+ export type FeatureFlagValue = string | number | boolean | null | FeatureFlagValue[] | {
234
+ [key: string]: FeatureFlagValue;
235
+ };
236
+ /**
237
+ * In-app mesaj tetik koşulu. `trigger`: `InAppMessages.addTrigger` değeri (`op`: eq | neq | exists | gt | lt).
238
+ * `unsupported`: bu SDK sürümünün tanımadığı tür (`name` sunucudaki tür adı).
239
+ */
240
+ export type InAppTrigger = {
241
+ kind: 'session_start';
242
+ } | {
243
+ kind: 'event';
244
+ name: string;
245
+ } | {
246
+ kind: 'screen';
247
+ name: string;
248
+ } | {
249
+ kind: 'trigger';
250
+ key: string;
251
+ op: string;
252
+ value: string | number | null;
253
+ } | {
254
+ kind: 'session_duration';
255
+ seconds: number;
256
+ } | {
257
+ kind: 'unsupported';
258
+ name: string;
259
+ };
260
+ /** Düğme aksiyonu; `url` http/https adresi, `deeplink` uygulama şemasıdır. */
261
+ export type InAppAction = {
262
+ type: 'dismiss';
263
+ } | {
264
+ type: 'url';
265
+ url: string;
266
+ } | {
267
+ type: 'deeplink';
268
+ url: string;
269
+ } | {
270
+ type: 'tags';
271
+ tags: Record<string, string>;
272
+ } | {
273
+ type: 'push_prompt';
274
+ } | {
275
+ type: 'outcome';
276
+ name: string;
277
+ value: number | null;
278
+ };
279
+ export interface InAppButton {
280
+ id: string;
281
+ text: string;
282
+ action: InAppAction;
283
+ backgroundColor: string | null;
284
+ textColor: string | null;
285
+ }
286
+ /** Carousel kartı; `button` geçersiz aksiyonluysa null. */
287
+ export interface InAppCarouselCard {
288
+ id: string;
289
+ title: string;
290
+ body: string | null;
291
+ imageUrl: string | null;
292
+ imageAlt: string | null;
293
+ button: InAppButton | null;
294
+ }
295
+ /** Mesaj içerik bloğu; metinler sunucuda kullanıcının dilinde çözülmüştür. */
296
+ export type InAppBlock = {
297
+ type: 'image';
298
+ url: string;
299
+ alt: string | null;
300
+ } | {
301
+ type: 'title';
302
+ text: string;
303
+ } | {
304
+ type: 'body';
305
+ text: string;
306
+ } | ({
307
+ type: 'button';
308
+ } & InAppButton) | {
309
+ type: 'carousel';
310
+ id: string;
311
+ cards: InAppCarouselCard[];
312
+ };
313
+ export type InAppLayout = 'modal' | 'banner_top' | 'banner_bottom' | 'fullscreen';
314
+ export interface InAppDisplay {
315
+ layout: InAppLayout;
316
+ backgroundColor: string | null;
317
+ textColor: string | null;
318
+ dismissible: boolean;
319
+ autoDismissSeconds: number | null;
320
+ /** `html` ise `blocks` boştur ve içerik `html` alanındadır. */
321
+ contentType: 'blocks' | 'html';
322
+ blocks: InAppBlock[];
323
+ html: string | null;
324
+ htmlHeight: number | null;
325
+ }
326
+ /**
327
+ * In-app mesaj modeli (native `HsInAppMessage` / `HSInAppMessage` alanları); `Placements.list` bu modeli döndürür.
328
+ * Zamanlar epoch milisaniyedir.
329
+ */
330
+ export interface InAppMessage {
331
+ id: string;
332
+ priority: number;
333
+ /** İlk tetik grubu (geriye uyum). */
334
+ triggers: InAppTrigger[];
335
+ /** Gruplar VEYA, grup içi VE ile bağlıdır. */
336
+ triggerGroups: InAppTrigger[][];
337
+ /** Sunucunun seçtiği A/B görünüm varyantı. */
338
+ variantId: string | null;
339
+ display: InAppDisplay;
340
+ remainingImpressions: number;
341
+ minIntervalSeconds: number;
342
+ stopAfterInteraction: boolean;
343
+ lastImpressionAt: number | null;
344
+ endAt: number | null;
345
+ /** Sunucunun içeriği çözdüğü dil; web'de null. */
346
+ language: string | null;
347
+ }
348
+ export interface PlacementListOptions {
349
+ /** 1-10 (varsayılan 1). */
350
+ limit?: number;
351
+ }
352
+ /** Bildirim teslim riski (native Android `HsDeliveryRisk`). */
353
+ export type DeliveryRisk = 'none' | 'elevated' | 'high';
354
+ /**
355
+ * `Pushizo.Delivery.openSettings` / `showGuidance` ile açılabilen Android ayar ekranı: `auto` duruma en uygun ekran,
356
+ * `notifications` bildirim ayarları, `auto_start` üreticinin otomatik başlatma yöneticisi, `battery_optimization` pil
357
+ * optimizasyonu, `app_details` uygulama ayrıntıları.
358
+ */
359
+ export type DeliverySetting = 'auto' | 'notifications' | 'auto_start' | 'battery_optimization' | 'app_details';
360
+ /**
361
+ * Cihazın bildirim teslim durumu (`Pushizo.Delivery.status()`; native Android `HsDeliveryStatus`). Kişisel veri içermez.
362
+ * Yalnızca Android'de doludur: iOS'ta, web'de ve Android'de SDK başlatılmadan önce `supported` `false`, `risk` `none` ve
363
+ * `recommendedSettings` boştur.
364
+ */
365
+ export interface DeliveryStatus {
366
+ /** Teşhis bu platformda okunabildi mi. */
367
+ supported: boolean;
368
+ /** `Build.MANUFACTURER` (küçük harf). */
369
+ manufacturer: string;
370
+ /** `Build.BRAND` (küçük harf). */
371
+ brand: string;
372
+ /** Üretici ailesi: `xiaomi`, `huawei`, `honor`, `oppo`, `realme`, `oneplus`, `vivo`, `samsung`, `meizu`, `asus`, `transsion`, `other`. */
373
+ vendor: string;
374
+ /** Üreticinin kendi pil/otomatik başlatma yöneticisi arka plandaki uygulamaları durdurabiliyor mu. */
375
+ aggressiveVendor: boolean;
376
+ /** ROM kimliği: `miui`, `hyperos`, `emui`, `harmonyos`, `magicos`, `coloros`, `oxygenos`, `realmeui`, `funtouchos`, `originos`, `oneui`, `flyme`, `android`. */
377
+ rom: string;
378
+ romVersion: string | null;
379
+ /** Bildirim izni verilmiş ve bildirimler açık mı. */
380
+ notificationsEnabled: boolean;
381
+ /** Varsayılan bildirim kanalı kullanıcı tarafından kapatılmış mı. */
382
+ channelBlocked: boolean;
383
+ /** Uygulama pil optimizasyonundan muaf mı. */
384
+ batteryOptimizationExempt: boolean;
385
+ /** Kullanıcı arka plan etkinliğini kısıtlamış mı. */
386
+ backgroundRestricted: boolean;
387
+ /** Bekleme kovası: `exempted`, `active`, `working_set`, `frequent`, `rare`, `restricted` (okunamadıysa null). */
388
+ standbyBucket: string | null;
389
+ /** Pil tasarrufu kipi açık mı. */
390
+ powerSaveMode: boolean;
391
+ /** Veri tasarrufu uygulamanın arka plan verisini engelliyor mu. */
392
+ dataSaverEnabled: boolean;
393
+ /** Sistem arka plan kısıtı: kullanıcı kısıtlamış ya da uygulama `rare`/`restricted` kovasında. */
394
+ restricted: boolean;
395
+ risk: DeliveryRisk;
396
+ /** Kullanıcının açması önerilen ayar ekranları (önem sırasıyla; öneri yoksa boş). */
397
+ recommendedSettings: DeliverySetting[];
398
+ }
399
+ /** `Pushizo.Delivery.showGuidance` seçenekleri. */
400
+ export interface DeliveryGuidanceOptions {
401
+ /** Kullanıcı kabul edince açılacak ekran (varsayılan `auto`). */
402
+ setting?: DeliverySetting;
403
+ /** SDK'nın yerelleştirilmiş metni yerine gösterilecek açıklama. */
404
+ message?: string;
405
+ }
166
406
  export interface ChatAttachment {
167
407
  id: string;
168
408
  name: string;