@joryio/web-sdk 0.0.0-stage → 1.3.0-beta.1

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.
Files changed (76) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +54 -0
  3. package/README.md +497 -2
  4. package/dist/core/config.d.ts +101 -0
  5. package/dist/core/config.d.ts.map +1 -0
  6. package/dist/core/device.d.ts +14 -0
  7. package/dist/core/device.d.ts.map +1 -0
  8. package/dist/core/ecommerce.d.ts +67 -0
  9. package/dist/core/ecommerce.d.ts.map +1 -0
  10. package/dist/core/identity.d.ts +36 -0
  11. package/dist/core/identity.d.ts.map +1 -0
  12. package/dist/core/inapp.d.ts +169 -0
  13. package/dist/core/inapp.d.ts.map +1 -0
  14. package/dist/core/network.d.ts +158 -0
  15. package/dist/core/network.d.ts.map +1 -0
  16. package/dist/core/outbox.d.ts +79 -0
  17. package/dist/core/outbox.d.ts.map +1 -0
  18. package/dist/core/pending-attributes.d.ts +43 -0
  19. package/dist/core/pending-attributes.d.ts.map +1 -0
  20. package/dist/core/push.d.ts +59 -0
  21. package/dist/core/push.d.ts.map +1 -0
  22. package/dist/core/queue.d.ts +107 -0
  23. package/dist/core/queue.d.ts.map +1 -0
  24. package/dist/core/sdk.d.ts +169 -0
  25. package/dist/core/sdk.d.ts.map +1 -0
  26. package/dist/core/session.d.ts +36 -0
  27. package/dist/core/session.d.ts.map +1 -0
  28. package/dist/core/storage.d.ts +17 -0
  29. package/dist/core/storage.d.ts.map +1 -0
  30. package/dist/core/user.d.ts +28 -0
  31. package/dist/core/user.d.ts.map +1 -0
  32. package/dist/core/utm.d.ts +39 -0
  33. package/dist/core/utm.d.ts.map +1 -0
  34. package/dist/core/values.d.ts +3 -0
  35. package/dist/core/values.d.ts.map +1 -0
  36. package/dist/core/write-retry.d.ts +66 -0
  37. package/dist/core/write-retry.d.ts.map +1 -0
  38. package/dist/index.d.mts +711 -0
  39. package/dist/index.d.ts +21 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/joryio-sw.js +6 -0
  42. package/dist/joryio.cjs.js +7265 -0
  43. package/dist/joryio.min.js +7 -0
  44. package/dist/joryio.min.js.map +1 -0
  45. package/dist/joryio.mjs +7254 -0
  46. package/dist/joryio.umd.js +7271 -0
  47. package/dist/utils/bucket-hash.d.ts +2 -0
  48. package/dist/utils/bucket-hash.d.ts.map +1 -0
  49. package/dist/utils/logger.d.ts +14 -0
  50. package/dist/utils/logger.d.ts.map +1 -0
  51. package/dist/utils/uuid.d.ts +3 -0
  52. package/dist/utils/uuid.d.ts.map +1 -0
  53. package/package.json +90 -4
  54. package/src/core/config.ts +362 -0
  55. package/src/core/device.ts +50 -0
  56. package/src/core/ecommerce.ts +482 -0
  57. package/src/core/identity.ts +251 -0
  58. package/src/core/inapp.ts +2419 -0
  59. package/src/core/network.ts +1261 -0
  60. package/src/core/outbox.ts +707 -0
  61. package/src/core/pending-attributes.ts +350 -0
  62. package/src/core/push.ts +667 -0
  63. package/src/core/queue.ts +894 -0
  64. package/src/core/sdk.ts +3108 -0
  65. package/src/core/session.ts +311 -0
  66. package/src/core/storage.ts +157 -0
  67. package/src/core/user.ts +203 -0
  68. package/src/core/utm.ts +304 -0
  69. package/src/core/values.ts +85 -0
  70. package/src/core/write-retry.ts +136 -0
  71. package/src/index.ts +305 -0
  72. package/src/snippet/loader.js +134 -0
  73. package/src/utils/bucket-hash.ts +44 -0
  74. package/src/utils/logger.ts +58 -0
  75. package/src/utils/uuid.ts +29 -0
  76. package/src/worker/joryio-sw.js +218 -0
@@ -0,0 +1,21 @@
1
+ import { JoryioSDK } from './core/sdk';
2
+ import type { TrackingConsent } from './core/sdk';
3
+ import type { InitConfig, Plugin, InAppOptions, InAppDisplayOptions } from './core/config';
4
+ import type { UTMParameters, UTMData } from './core/utm';
5
+ import type { InAppCampaign, InAppMessage, InAppTrigger } from './core/inapp';
6
+ import type { SdkAuthFailureInfo, SdkAuthFailureReason, SdkAuthFailureCallback } from './core/network';
7
+ import { User, SubscriptionStatus } from './core/user';
8
+ import type { SubscriptionChannel, SubscriptionPreferences } from './core/user';
9
+ import { PushManager } from './core/push';
10
+ import type { PushSubscribeOptions, PushPermissionState } from './core/push';
11
+ import { EcommerceTracker, createEcommerceTracker } from './core/ecommerce';
12
+ import type { EcommerceProduct, EcommerceCartItem, EcommerceOrder, EcommerceConfig } from './core/ecommerce';
13
+ export { JoryioSDK };
14
+ export { User, SubscriptionStatus };
15
+ export { PushManager };
16
+ export { EcommerceTracker, createEcommerceTracker };
17
+ export type { InitConfig, Plugin, InAppOptions, InAppDisplayOptions, InAppCampaign, InAppMessage, InAppTrigger, UTMParameters, UTMData, SubscriptionChannel, SubscriptionPreferences, PushSubscribeOptions, PushPermissionState, TrackingConsent, EcommerceProduct, EcommerceCartItem, EcommerceOrder, EcommerceConfig, SdkAuthFailureInfo, SdkAuthFailureReason, SdkAuthFailureCallback, };
18
+ export { SDK_VERSION } from './core/config';
19
+ export default JoryioSDK;
20
+ export declare function installSnippetQueue(win: any): void;
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAA8D,MAAM,YAAY,CAAC;AACnG,OAAO,KAAK,EAAE,eAAe,EAAmB,MAAM,YAAY,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAC3F,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,KAAK,EACV,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAChF,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC5E,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EAChB,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,SAAS,EAAE,CAAC;AAGrB,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;AAGpC,OAAO,EAAE,WAAW,EAAE,CAAC;AAGvB,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,CAAC;AAGpD,YAAY,EACV,UAAU,EACV,MAAM,EACN,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,OAAO,EACP,mBAAmB,EACnB,uBAAuB,EACvB,oBAAoB,EACpB,mBAAmB,EACnB,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,GACvB,CAAC;AAGF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,eAAe,SAAS,CAAC;AA6GzB,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAwHlD"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Joryio Web SDK v1.3.0-beta.1
3
+ * (c) 2026 Joryio. All rights reserved.
4
+ * @license Commercial - see https://github.com/joryio/joryio-web-sdk/blob/main/LICENSE
5
+ */
6
+ !function(){"use strict";const t="trackingId",e="jry_image_url",n="jry_api_origin";function o(){try{return"undefined"==typeof caches?Promise.resolve(!1):caches.open("joryio-sdk-state").then(t=>t.match("/__joryio/tracking-opted-out")).then(t=>!!t).catch(()=>!1)}catch(t){return Promise.resolve(!1)}}function i(e){return o().then(o=>o?void 0:function(e){const o=e&&e[n],i=e&&e[t];if(!o||!i)return Promise.resolve();let r;try{r=new URL(o).origin}catch(t){return Promise.resolve()}return fetch(`${r}/track/push/click/${encodeURIComponent(i)}`,{method:"GET",mode:"no-cors",keepalive:!0}).catch(()=>{})}(e)).catch(()=>{})}self.addEventListener("push",i=>{let r={};try{r=i.data?i.data.json():{}}catch(t){r={title:"Notification",body:i.data?i.data.text():""}}const c=r.title||"Notification",a=function(t){const n=t&&t.data||{},o={body:t.body,icon:t.icon,actions:t.actions,data:n};o.image=t.image||n[e],t.badge&&(o.badge=t.badge);t.tag&&(o.tag=t.tag,o.renotify=!0);!0===t.requireInteraction&&(o.requireInteraction=!0);return o}(r);var s;i.waitUntil(Promise.all([(s=a.data,o().then(e=>e?void 0:function(e){const o=e&&e[n],i=e&&e[t];if(!o||!i)return Promise.resolve();let r;try{r=new URL(o).origin}catch(t){return Promise.resolve()}return fetch(`${r}/track/push/delivered/${encodeURIComponent(i)}`,{method:"POST",mode:"no-cors",keepalive:!0}).catch(()=>{})}(s))),self.registration.showNotification(c,a)]))}),self.addEventListener("notificationclick",t=>{t.notification.close();const e=t.notification.data||{},n=e.jry_deep_link||e.url||"/";t.waitUntil((async()=>{const t=await self.clients.matchAll({type:"window",includeUncontrolled:!0});for(const o of t)if(o.url===n&&"focus"in o)return void await Promise.all([o.focus(),i(e)]);const o=self.clients.openWindow?self.clients.openWindow(n):Promise.resolve();await Promise.all([o,i(e)])})())}),self.addEventListener("pushsubscriptionchange",()=>{})}();