@favish/staffbase-utils 0.15.0 → 0.17.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.
- package/README.md +1 -0
- package/dist/device.cjs.js +1 -1
- package/dist/device.cjs.js.map +1 -1
- package/dist/device.es.mjs +2 -2
- package/dist/device.es.mjs.map +1 -1
- package/dist/host.cjs.js +2 -0
- package/dist/host.cjs.js.map +1 -0
- package/dist/host.es.mjs +10 -0
- package/dist/host.es.mjs.map +1 -0
- package/dist/src/device/index.d.ts +2 -0
- package/dist/src/device/index.d.ts.map +1 -1
- package/dist/src/device/isMobilePlatform.d.ts +7 -0
- package/dist/src/device/isMobilePlatform.d.ts.map +1 -0
- package/dist/src/device/isNativeApp.d.ts +7 -0
- package/dist/src/device/isNativeApp.d.ts.map +1 -0
- package/dist/src/host/getStaffbaseCsrfToken.d.ts +11 -0
- package/dist/src/host/getStaffbaseCsrfToken.d.ts.map +1 -0
- package/dist/src/host/index.d.ts +2 -0
- package/dist/src/host/index.d.ts.map +1 -0
- package/dist/src/types/device/WindowWithStaffbaseRuntime.d.ts +12 -0
- package/dist/src/types/device/WindowWithStaffbaseRuntime.d.ts.map +1 -0
- package/dist/src/types/groups/CreateGroupBody.d.ts +12 -0
- package/dist/src/types/groups/CreateGroupBody.d.ts.map +1 -0
- package/dist/src/types/groups/Group.d.ts +47 -0
- package/dist/src/types/groups/Group.d.ts.map +1 -0
- package/dist/src/types/groups/GroupAccessors.d.ts +13 -0
- package/dist/src/types/groups/GroupAccessors.d.ts.map +1 -0
- package/dist/src/types/groups/GroupAdminsWithGroups.d.ts +18 -0
- package/dist/src/types/groups/GroupAdminsWithGroups.d.ts.map +1 -0
- package/dist/src/types/groups/GroupBranch.d.ts +23 -0
- package/dist/src/types/groups/GroupBranch.d.ts.map +1 -0
- package/dist/src/types/groups/GroupConfig.d.ts +16 -0
- package/dist/src/types/groups/GroupConfig.d.ts.map +1 -0
- package/dist/src/types/groups/GroupConfigLocalization.d.ts +13 -0
- package/dist/src/types/groups/GroupConfigLocalization.d.ts.map +1 -0
- package/dist/src/types/groups/GroupUser.d.ts +51 -0
- package/dist/src/types/groups/GroupUser.d.ts.map +1 -0
- package/dist/src/types/groups/GroupUsers.d.ts +21 -0
- package/dist/src/types/groups/GroupUsers.d.ts.map +1 -0
- package/dist/src/types/groups/UpdateGroupBody.d.ts +12 -0
- package/dist/src/types/groups/UpdateGroupBody.d.ts.map +1 -0
- package/dist/src/types/groups/generated/groupsApi.d.ts +739 -0
- package/dist/src/types/groups/generated/groupsApi.d.ts.map +1 -0
- package/dist/src/types/groups/index.d.ts +11 -0
- package/dist/src/types/groups/index.d.ts.map +1 -0
- package/dist/src/types/host/WindowWithStaffbaseAuth.d.ts +13 -0
- package/dist/src/types/host/WindowWithStaffbaseAuth.d.ts.map +1 -0
- package/dist/src/types/news/CreatePostBody.d.ts +11 -0
- package/dist/src/types/news/CreatePostBody.d.ts.map +1 -0
- package/dist/src/types/news/Post.d.ts +73 -0
- package/dist/src/types/news/Post.d.ts.map +1 -0
- package/dist/src/types/news/PostAcknowledgements.d.ts +14 -0
- package/dist/src/types/news/PostAcknowledgements.d.ts.map +1 -0
- package/dist/src/types/news/PostAuthor.d.ts +16 -0
- package/dist/src/types/news/PostAuthor.d.ts.map +1 -0
- package/dist/src/types/news/PostAuthorAvatar.d.ts +17 -0
- package/dist/src/types/news/PostAuthorAvatar.d.ts.map +1 -0
- package/dist/src/types/news/PostComments.d.ts +11 -0
- package/dist/src/types/news/PostComments.d.ts.map +1 -0
- package/dist/src/types/news/PostLayout.d.ts +12 -0
- package/dist/src/types/news/PostLayout.d.ts.map +1 -0
- package/dist/src/types/news/PostLikes.d.ts +12 -0
- package/dist/src/types/news/PostLikes.d.ts.map +1 -0
- package/dist/src/types/news/PostSource.d.ts +11 -0
- package/dist/src/types/news/PostSource.d.ts.map +1 -0
- package/dist/src/types/news/UpdatePostBody.d.ts +10 -0
- package/dist/src/types/news/UpdatePostBody.d.ts.map +1 -0
- package/dist/src/types/news/generated/newsApi.d.ts +1433 -0
- package/dist/src/types/news/generated/newsApi.d.ts.map +1 -0
- package/dist/src/types/news/index.d.ts +11 -0
- package/dist/src/types/news/index.d.ts.map +1 -0
- package/dist/src/types/pages/CreatePagePayload.d.ts +12 -0
- package/dist/src/types/pages/CreatePagePayload.d.ts.map +1 -0
- package/dist/src/types/pages/Page.d.ts +51 -0
- package/dist/src/types/pages/Page.d.ts.map +1 -0
- package/dist/src/types/pages/PageAccess.d.ts +20 -0
- package/dist/src/types/pages/PageAccess.d.ts.map +1 -0
- package/dist/src/types/pages/PageContent.d.ts +18 -0
- package/dist/src/types/pages/PageContent.d.ts.map +1 -0
- package/dist/src/types/pages/UpdatePagePayload.d.ts +11 -0
- package/dist/src/types/pages/UpdatePagePayload.d.ts.map +1 -0
- package/dist/src/types/pages/generated/pagesApi.d.ts +418 -0
- package/dist/src/types/pages/generated/pagesApi.d.ts.map +1 -0
- package/dist/src/types/pages/index.d.ts +6 -0
- package/dist/src/types/pages/index.d.ts.map +1 -0
- package/dist/src/types/user/CreateUserBody.d.ts +11 -0
- package/dist/src/types/user/CreateUserBody.d.ts.map +1 -0
- package/dist/src/types/user/UpdateUserBody.d.ts +11 -0
- package/dist/src/types/user/UpdateUserBody.d.ts.map +1 -0
- package/dist/src/types/user/User.d.ts +65 -0
- package/dist/src/types/user/User.d.ts.map +1 -0
- package/dist/src/types/user/UserAvatar.d.ts +19 -0
- package/dist/src/types/user/UserAvatar.d.ts.map +1 -0
- package/dist/src/types/user/UserAvatarVariant.d.ts +23 -0
- package/dist/src/types/user/UserAvatarVariant.d.ts.map +1 -0
- package/dist/src/types/user/UserConfig.d.ts +11 -0
- package/dist/src/types/user/UserConfig.d.ts.map +1 -0
- package/dist/src/types/user/UserCreation.d.ts +16 -0
- package/dist/src/types/user/UserCreation.d.ts.map +1 -0
- package/dist/src/types/user/UserEmail.d.ts +15 -0
- package/dist/src/types/user/UserEmail.d.ts.map +1 -0
- package/dist/src/types/user/UserName.d.ts +13 -0
- package/dist/src/types/user/UserName.d.ts.map +1 -0
- package/dist/src/types/user/UserProfile.d.ts +28 -0
- package/dist/src/types/user/UserProfile.d.ts.map +1 -0
- package/dist/src/types/user/UserRecoveryCode.d.ts +17 -0
- package/dist/src/types/user/UserRecoveryCode.d.ts.map +1 -0
- package/dist/src/types/user/UserRole.d.ts +12 -0
- package/dist/src/types/user/UserRole.d.ts.map +1 -0
- package/dist/src/types/user/UserSecret.d.ts +20 -0
- package/dist/src/types/user/UserSecret.d.ts.map +1 -0
- package/dist/src/types/user/generated/userApi.d.ts +1525 -0
- package/dist/src/types/user/generated/userApi.d.ts.map +1 -0
- package/dist/src/types/user/index.d.ts +14 -0
- package/dist/src/types/user/index.d.ts.map +1 -0
- package/dist/types/groups.cjs.js +1 -0
- package/dist/types/groups.es.mjs +0 -0
- package/dist/types/news.cjs.js +1 -0
- package/dist/types/news.es.mjs +0 -0
- package/dist/types/pages.cjs.js +1 -0
- package/dist/types/pages.es.mjs +0 -0
- package/dist/types/user.cjs.js +1 -0
- package/dist/types/user.es.mjs +0 -0
- package/package.json +31 -1
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ minimumReleaseAgeExclude:
|
|
|
31
31
|
| `@favish/staffbase-utils/shadow/react` | `ensureShadowMount` (+ re-exports portal) (React + @emotion/cache peers) |
|
|
32
32
|
| `@favish/staffbase-utils/log` | `logError`, `logWarn`, `logDebug`, `setLoggingEnabled` |
|
|
33
33
|
| `@favish/staffbase-utils/dom` | `getDynamicClasses` |
|
|
34
|
+
| `@favish/staffbase-utils/host` | `getStaffbaseCsrfToken` |
|
|
34
35
|
| `@favish/staffbase-utils/types` | `Channel`, `ChannelLink`, `ChannelLinkParameter`, `DropdownOption`, `LocalizedContent`, `ArticleImage`, `ArticleImageVariant` (type-only) |
|
|
35
36
|
|
|
36
37
|
More modules (`/env`, `/device`, `/html`, `/links`, `/widgets`) are added per the
|
package/dist/device.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=()=>{if(typeof navigator>`u`)return!1;let e=navigator.userAgent.toLowerCase(),t=/mobile|android|ios|iphone|ipad|ipod|windows phone/i.test(e),n=/wv|webview/i.test(e);return t||n},t=()=>typeof window>`u`?!1:window.innerWidth<=768,n=()=>e()||t();exports.isMobile=n,exports.isMobileOrWebview=e,exports.isMobileViewport=t;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=()=>{if(typeof navigator>`u`)return!1;let e=navigator.userAgent.toLowerCase(),t=/mobile|android|ios|iphone|ipad|ipod|windows phone/i.test(e),n=/wv|webview/i.test(e);return t||n},t=()=>typeof window>`u`?!1:window.innerWidth<=768,n=()=>e()||t(),r=()=>typeof window>`u`?!1:window.we?.mobile===!0||n(),i=()=>typeof window>`u`?!1:window.we?.native===!0;exports.isMobile=n,exports.isMobileOrWebview=e,exports.isMobilePlatform=r,exports.isMobileViewport=t,exports.isNativeApp=i;
|
|
2
2
|
//# sourceMappingURL=device.cjs.js.map
|
package/dist/device.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.cjs.js","names":[],"sources":["../src/device/isMobileOrWebview.ts","../src/device/isMobileViewport.ts","../src/device/isMobile.ts"],"sourcesContent":["/**\n * Detects if the current environment is a mobile device or running inside a\n * webview, using userAgent heuristics common on iOS/Android and webviews.\n * Guards against non-browser environments (SSR/tests without navigator).\n * @returns {boolean} True if likely mobile or webview.\n */\nexport const isMobileOrWebview = (): boolean => {\n if (typeof navigator === 'undefined') return false\n\n const userAgent = navigator.userAgent.toLowerCase()\n const isMobilePlatform =\n /mobile|android|ios|iphone|ipad|ipod|windows phone/i.test(userAgent)\n const isWebview = /wv|webview/i.test(userAgent)\n\n return isMobilePlatform || isWebview\n}\n","/**\n * Checks if the viewport width is mobile-sized (<= 768px).\n * Guards against non-browser environments (SSR/tests without window).\n * @returns {boolean} True if the viewport width is 768px or less.\n */\nexport const isMobileViewport = (): boolean => {\n if (typeof window === 'undefined') return false\n return window.innerWidth <= 768\n}\n","import { isMobileOrWebview } from './isMobileOrWebview'\nimport { isMobileViewport } from './isMobileViewport'\n\n/**\n * Checks if the device is mobile either by user agent/webview or viewport size.\n * @returns {boolean} True if either a mobile/webview UA or a mobile viewport.\n */\nexport const isMobile = (): boolean => isMobileOrWebview() || isMobileViewport()\n"],"mappings":"mEAMA,IAAa,MAAmC,CAC9C,GAAI,OAAO,UAAc,IAAa,MAAO,GAE7C,IAAM,EAAY,UAAU,UAAU,YAAY,EAC5C,EACJ,qDAAqD,KAAK,CAAS,EAC/D,EAAY,cAAc,KAAK,CAAS,EAE9C,OAAO,GAAoB,CAC7B,ECVa,MACP,OAAO,OAAW,IAAoB,GACnC,OAAO,YAAc,ICAjB,MAA0B,EAAkB,GAAK,EAAiB"}
|
|
1
|
+
{"version":3,"file":"device.cjs.js","names":[],"sources":["../src/device/isMobileOrWebview.ts","../src/device/isMobileViewport.ts","../src/device/isMobile.ts","../src/device/isMobilePlatform.ts","../src/device/isNativeApp.ts"],"sourcesContent":["/**\n * Detects if the current environment is a mobile device or running inside a\n * webview, using userAgent heuristics common on iOS/Android and webviews.\n * Guards against non-browser environments (SSR/tests without navigator).\n * @returns {boolean} True if likely mobile or webview.\n */\nexport const isMobileOrWebview = (): boolean => {\n if (typeof navigator === 'undefined') return false\n\n const userAgent = navigator.userAgent.toLowerCase()\n const isMobilePlatform =\n /mobile|android|ios|iphone|ipad|ipod|windows phone/i.test(userAgent)\n const isWebview = /wv|webview/i.test(userAgent)\n\n return isMobilePlatform || isWebview\n}\n","/**\n * Checks if the viewport width is mobile-sized (<= 768px).\n * Guards against non-browser environments (SSR/tests without window).\n * @returns {boolean} True if the viewport width is 768px or less.\n */\nexport const isMobileViewport = (): boolean => {\n if (typeof window === 'undefined') return false\n return window.innerWidth <= 768\n}\n","import { isMobileOrWebview } from './isMobileOrWebview'\nimport { isMobileViewport } from './isMobileViewport'\n\n/**\n * Checks if the device is mobile either by user agent/webview or viewport size.\n * @returns {boolean} True if either a mobile/webview UA or a mobile viewport.\n */\nexport const isMobile = (): boolean => isMobileOrWebview() || isMobileViewport()\n","import type { WindowWithStaffbaseRuntime } from '../types/device/WindowWithStaffbaseRuntime'\nimport { isMobile } from './isMobile'\n\n/**\n * Whether the app is running on a mobile platform, per the `window.we.mobile`\n * runtime flag or device detection. Returns false outside a browser.\n * @returns {boolean} True when running on a mobile platform.\n */\nexport const isMobilePlatform = (): boolean => {\n if (typeof window === 'undefined') return false\n\n return (\n (window as unknown as WindowWithStaffbaseRuntime).we?.mobile === true ||\n isMobile()\n )\n}\n","import type { WindowWithStaffbaseRuntime } from '../types/device/WindowWithStaffbaseRuntime'\n\n/**\n * Whether the app is running inside the Staffbase native shell, per the\n * `window.we.native` runtime flag. Returns false outside a browser.\n * @returns {boolean} True when running in the native app.\n */\nexport const isNativeApp = (): boolean => {\n if (typeof window === 'undefined') return false\n\n return (window as unknown as WindowWithStaffbaseRuntime).we?.native === true\n}\n"],"mappings":"mEAMA,IAAa,MAAmC,CAC9C,GAAI,OAAO,UAAc,IAAa,MAAO,GAE7C,IAAM,EAAY,UAAU,UAAU,YAAY,EAC5C,EACJ,qDAAqD,KAAK,CAAS,EAC/D,EAAY,cAAc,KAAK,CAAS,EAE9C,OAAO,GAAoB,CAC7B,ECVa,MACP,OAAO,OAAW,IAAoB,GACnC,OAAO,YAAc,ICAjB,MAA0B,EAAkB,GAAK,EAAiB,ECClE,MACP,OAAO,OAAW,IAAoB,GAGvC,OAAiD,IAAI,SAAW,IACjE,EAAS,ECNA,MACP,OAAO,OAAW,IAAoB,GAElC,OAAiD,IAAI,SAAW"}
|
package/dist/device.es.mjs
CHANGED
|
@@ -3,8 +3,8 @@ var e = () => {
|
|
|
3
3
|
if (typeof navigator > "u") return !1;
|
|
4
4
|
let e = navigator.userAgent.toLowerCase(), t = /mobile|android|ios|iphone|ipad|ipod|windows phone/i.test(e), n = /wv|webview/i.test(e);
|
|
5
5
|
return t || n;
|
|
6
|
-
}, t = () => typeof window > "u" ? !1 : window.innerWidth <= 768, n = () => e() || t();
|
|
6
|
+
}, t = () => typeof window > "u" ? !1 : window.innerWidth <= 768, n = () => e() || t(), r = () => typeof window > "u" ? !1 : window.we?.mobile === !0 || n(), i = () => typeof window > "u" ? !1 : window.we?.native === !0;
|
|
7
7
|
//#endregion
|
|
8
|
-
export { n as isMobile, e as isMobileOrWebview, t as isMobileViewport };
|
|
8
|
+
export { n as isMobile, e as isMobileOrWebview, r as isMobilePlatform, t as isMobileViewport, i as isNativeApp };
|
|
9
9
|
|
|
10
10
|
//# sourceMappingURL=device.es.mjs.map
|
package/dist/device.es.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.es.mjs","names":[],"sources":["../src/device/isMobileOrWebview.ts","../src/device/isMobileViewport.ts","../src/device/isMobile.ts"],"sourcesContent":["/**\n * Detects if the current environment is a mobile device or running inside a\n * webview, using userAgent heuristics common on iOS/Android and webviews.\n * Guards against non-browser environments (SSR/tests without navigator).\n * @returns {boolean} True if likely mobile or webview.\n */\nexport const isMobileOrWebview = (): boolean => {\n if (typeof navigator === 'undefined') return false\n\n const userAgent = navigator.userAgent.toLowerCase()\n const isMobilePlatform =\n /mobile|android|ios|iphone|ipad|ipod|windows phone/i.test(userAgent)\n const isWebview = /wv|webview/i.test(userAgent)\n\n return isMobilePlatform || isWebview\n}\n","/**\n * Checks if the viewport width is mobile-sized (<= 768px).\n * Guards against non-browser environments (SSR/tests without window).\n * @returns {boolean} True if the viewport width is 768px or less.\n */\nexport const isMobileViewport = (): boolean => {\n if (typeof window === 'undefined') return false\n return window.innerWidth <= 768\n}\n","import { isMobileOrWebview } from './isMobileOrWebview'\nimport { isMobileViewport } from './isMobileViewport'\n\n/**\n * Checks if the device is mobile either by user agent/webview or viewport size.\n * @returns {boolean} True if either a mobile/webview UA or a mobile viewport.\n */\nexport const isMobile = (): boolean => isMobileOrWebview() || isMobileViewport()\n"],"mappings":";AAMA,IAAa,UAAmC;CAC9C,IAAI,OAAO,YAAc,KAAa,OAAO;CAE7C,IAAM,IAAY,UAAU,UAAU,YAAY,GAC5C,IACJ,qDAAqD,KAAK,CAAS,GAC/D,IAAY,cAAc,KAAK,CAAS;CAE9C,OAAO,KAAoB;AAC7B,GCVa,UACP,OAAO,SAAW,MAAoB,KACnC,OAAO,cAAc,KCAjB,UAA0B,EAAkB,KAAK,EAAiB"}
|
|
1
|
+
{"version":3,"file":"device.es.mjs","names":[],"sources":["../src/device/isMobileOrWebview.ts","../src/device/isMobileViewport.ts","../src/device/isMobile.ts","../src/device/isMobilePlatform.ts","../src/device/isNativeApp.ts"],"sourcesContent":["/**\n * Detects if the current environment is a mobile device or running inside a\n * webview, using userAgent heuristics common on iOS/Android and webviews.\n * Guards against non-browser environments (SSR/tests without navigator).\n * @returns {boolean} True if likely mobile or webview.\n */\nexport const isMobileOrWebview = (): boolean => {\n if (typeof navigator === 'undefined') return false\n\n const userAgent = navigator.userAgent.toLowerCase()\n const isMobilePlatform =\n /mobile|android|ios|iphone|ipad|ipod|windows phone/i.test(userAgent)\n const isWebview = /wv|webview/i.test(userAgent)\n\n return isMobilePlatform || isWebview\n}\n","/**\n * Checks if the viewport width is mobile-sized (<= 768px).\n * Guards against non-browser environments (SSR/tests without window).\n * @returns {boolean} True if the viewport width is 768px or less.\n */\nexport const isMobileViewport = (): boolean => {\n if (typeof window === 'undefined') return false\n return window.innerWidth <= 768\n}\n","import { isMobileOrWebview } from './isMobileOrWebview'\nimport { isMobileViewport } from './isMobileViewport'\n\n/**\n * Checks if the device is mobile either by user agent/webview or viewport size.\n * @returns {boolean} True if either a mobile/webview UA or a mobile viewport.\n */\nexport const isMobile = (): boolean => isMobileOrWebview() || isMobileViewport()\n","import type { WindowWithStaffbaseRuntime } from '../types/device/WindowWithStaffbaseRuntime'\nimport { isMobile } from './isMobile'\n\n/**\n * Whether the app is running on a mobile platform, per the `window.we.mobile`\n * runtime flag or device detection. Returns false outside a browser.\n * @returns {boolean} True when running on a mobile platform.\n */\nexport const isMobilePlatform = (): boolean => {\n if (typeof window === 'undefined') return false\n\n return (\n (window as unknown as WindowWithStaffbaseRuntime).we?.mobile === true ||\n isMobile()\n )\n}\n","import type { WindowWithStaffbaseRuntime } from '../types/device/WindowWithStaffbaseRuntime'\n\n/**\n * Whether the app is running inside the Staffbase native shell, per the\n * `window.we.native` runtime flag. Returns false outside a browser.\n * @returns {boolean} True when running in the native app.\n */\nexport const isNativeApp = (): boolean => {\n if (typeof window === 'undefined') return false\n\n return (window as unknown as WindowWithStaffbaseRuntime).we?.native === true\n}\n"],"mappings":";AAMA,IAAa,UAAmC;CAC9C,IAAI,OAAO,YAAc,KAAa,OAAO;CAE7C,IAAM,IAAY,UAAU,UAAU,YAAY,GAC5C,IACJ,qDAAqD,KAAK,CAAS,GAC/D,IAAY,cAAc,KAAK,CAAS;CAE9C,OAAO,KAAoB;AAC7B,GCVa,UACP,OAAO,SAAW,MAAoB,KACnC,OAAO,cAAc,KCAjB,UAA0B,EAAkB,KAAK,EAAiB,GCClE,UACP,OAAO,SAAW,MAAoB,KAGvC,OAAiD,IAAI,WAAW,MACjE,EAAS,GCNA,UACP,OAAO,SAAW,MAAoB,KAElC,OAAiD,IAAI,WAAW"}
|
package/dist/host.cjs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.cjs.js","names":[],"sources":["../src/host/getStaffbaseCsrfToken.ts"],"sourcesContent":["import type { WindowWithStaffbaseAuth } from '../types/host/WindowWithStaffbaseAuth'\n\n/**\n * Reads the Staffbase CSRF token from the host's global auth manager\n * (`window.we.authMgr.getCsrfToken`).\n *\n * Returns null (instead of an empty string) when the token is unavailable, so\n * callers can fail fast with a clear message rather than firing a request the\n * server is guaranteed to reject with a 403.\n * @returns {string | null} The CSRF token, or null when it cannot be resolved.\n */\nexport const getStaffbaseCsrfToken = (): string | null => {\n if (typeof window === 'undefined') return null\n\n const w = window as unknown as WindowWithStaffbaseAuth\n const token = w?.we?.authMgr?.getCsrfToken?.()\n\n return token && token.length > 0 ? token : null\n}\n"],"mappings":"mEAWA,IAAa,MAA6C,CACxD,GAAI,OAAO,OAAW,IAAa,OAAO,KAG1C,IAAM,EAAQ,QAAG,IAAI,SAAS,eAAe,EAE7C,OAAO,GAAS,EAAM,OAAS,EAAI,EAAQ,IAC7C"}
|
package/dist/host.es.mjs
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//#region src/host/getStaffbaseCsrfToken.ts
|
|
2
|
+
var e = () => {
|
|
3
|
+
if (typeof window > "u") return null;
|
|
4
|
+
let e = window?.we?.authMgr?.getCsrfToken?.();
|
|
5
|
+
return e && e.length > 0 ? e : null;
|
|
6
|
+
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as getStaffbaseCsrfToken };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=host.es.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.es.mjs","names":[],"sources":["../src/host/getStaffbaseCsrfToken.ts"],"sourcesContent":["import type { WindowWithStaffbaseAuth } from '../types/host/WindowWithStaffbaseAuth'\n\n/**\n * Reads the Staffbase CSRF token from the host's global auth manager\n * (`window.we.authMgr.getCsrfToken`).\n *\n * Returns null (instead of an empty string) when the token is unavailable, so\n * callers can fail fast with a clear message rather than firing a request the\n * server is guaranteed to reject with a 403.\n * @returns {string | null} The CSRF token, or null when it cannot be resolved.\n */\nexport const getStaffbaseCsrfToken = (): string | null => {\n if (typeof window === 'undefined') return null\n\n const w = window as unknown as WindowWithStaffbaseAuth\n const token = w?.we?.authMgr?.getCsrfToken?.()\n\n return token && token.length > 0 ? token : null\n}\n"],"mappings":";AAWA,IAAa,UAA6C;CACxD,IAAI,OAAO,SAAW,KAAa,OAAO;CAG1C,IAAM,IAAQ,QAAG,IAAI,SAAS,eAAe;CAE7C,OAAO,KAAS,EAAM,SAAS,IAAI,IAAQ;AAC7C"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { isMobile } from './isMobile';
|
|
2
2
|
export { isMobileOrWebview } from './isMobileOrWebview';
|
|
3
|
+
export { isMobilePlatform } from './isMobilePlatform';
|
|
3
4
|
export { isMobileViewport } from './isMobileViewport';
|
|
5
|
+
export { isNativeApp } from './isNativeApp';
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/device/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/device/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the app is running on a mobile platform, per the `window.we.mobile`
|
|
3
|
+
* runtime flag or device detection. Returns false outside a browser.
|
|
4
|
+
* @returns {boolean} True when running on a mobile platform.
|
|
5
|
+
*/
|
|
6
|
+
export declare const isMobilePlatform: () => boolean;
|
|
7
|
+
//# sourceMappingURL=isMobilePlatform.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isMobilePlatform.d.ts","sourceRoot":"","sources":["../../../src/device/isMobilePlatform.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAAO,OAOnC,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the app is running inside the Staffbase native shell, per the
|
|
3
|
+
* `window.we.native` runtime flag. Returns false outside a browser.
|
|
4
|
+
* @returns {boolean} True when running in the native app.
|
|
5
|
+
*/
|
|
6
|
+
export declare const isNativeApp: () => boolean;
|
|
7
|
+
//# sourceMappingURL=isNativeApp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isNativeApp.d.ts","sourceRoot":"","sources":["../../../src/device/isNativeApp.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAO,OAI9B,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reads the Staffbase CSRF token from the host's global auth manager
|
|
3
|
+
* (`window.we.authMgr.getCsrfToken`).
|
|
4
|
+
*
|
|
5
|
+
* Returns null (instead of an empty string) when the token is unavailable, so
|
|
6
|
+
* callers can fail fast with a clear message rather than firing a request the
|
|
7
|
+
* server is guaranteed to reject with a 403.
|
|
8
|
+
* @returns {string | null} The CSRF token, or null when it cannot be resolved.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getStaffbaseCsrfToken: () => string | null;
|
|
11
|
+
//# sourceMappingURL=getStaffbaseCsrfToken.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getStaffbaseCsrfToken.d.ts","sourceRoot":"","sources":["../../../src/host/getStaffbaseCsrfToken.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB,QAAO,MAAM,GAAG,IAOjD,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/host/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Window augmented with the Staffbase runtime flags (`window.we`) that report
|
|
3
|
+
* whether the app is running inside the native shell and on a mobile platform.
|
|
4
|
+
* Optional because the runtime is absent outside the Staffbase shell.
|
|
5
|
+
*/
|
|
6
|
+
export interface WindowWithStaffbaseRuntime {
|
|
7
|
+
we?: {
|
|
8
|
+
native?: boolean;
|
|
9
|
+
mobile?: boolean;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=WindowWithStaffbaseRuntime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WindowWithStaffbaseRuntime.d.ts","sourceRoot":"","sources":["../../../../src/types/device/WindowWithStaffbaseRuntime.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,EAAE,CAAC,EAAE;QACH,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,MAAM,CAAC,EAAE,OAAO,CAAA;KACjB,CAAA;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { components } from './generated/groupsApi';
|
|
2
|
+
/**
|
|
3
|
+
* Request body for creating a group.
|
|
4
|
+
*
|
|
5
|
+
* Thin alias over the machine-generated groups API schema so the public name
|
|
6
|
+
* stays stable even if `generated/groupsApi.ts` is regenerated. The write side
|
|
7
|
+
* of the spec is properly schematized, so this is sourced directly from codegen
|
|
8
|
+
* (unlike `Group`, whose read shape had to be curated from prod because
|
|
9
|
+
* the spec's `Group` schema does not match the runtime).
|
|
10
|
+
*/
|
|
11
|
+
export type CreateGroupBody = components['schemas']['GroupCreate'];
|
|
12
|
+
//# sourceMappingURL=CreateGroupBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CreateGroupBody.d.ts","sourceRoot":"","sources":["../../../../src/types/groups/CreateGroupBody.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAA"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ChannelLink } from '../content/ChannelLink';
|
|
2
|
+
import { GroupAccessors } from './GroupAccessors';
|
|
3
|
+
import { GroupAdminsWithGroups } from './GroupAdminsWithGroups';
|
|
4
|
+
import { GroupConfig } from './GroupConfig';
|
|
5
|
+
import { GroupUser } from './GroupUser';
|
|
6
|
+
import { GroupUsers } from './GroupUsers';
|
|
7
|
+
/**
|
|
8
|
+
* A group as returned by the Staffbase read endpoints (`GET /api/groups` and
|
|
9
|
+
* `GET /api/groups/{id}`).
|
|
10
|
+
*
|
|
11
|
+
* Curated, not machine-generated: the official groups OpenAPI `Group` schema
|
|
12
|
+
* does NOT match the runtime (it models the v2026 management API with
|
|
13
|
+
* `externalId`/`inclusions`/`exclusions`; only `id`/`name`/`type` overlap).
|
|
14
|
+
* Every field below is grounded in a live prod sweep of all 45 groups (45 list
|
|
15
|
+
* items + 6 single reads). Group membership is PII; only key names and types
|
|
16
|
+
* were extracted, never values.
|
|
17
|
+
*
|
|
18
|
+
* Field names match the wire format verbatim, including the capitalised `ID`
|
|
19
|
+
* suffix on `accessorIDs`, `adminIDs` and `ownerID`. The required/optional
|
|
20
|
+
* split reflects observed presence: `accessorIDs`/`adminIDs`/`ownerID`/
|
|
21
|
+
* `ownerType`/`config`/`links`/`rights` were present on 45/45 list items, while
|
|
22
|
+
* `accessors`, `owner`, `adminsWithGroups` and `users` were present only on the
|
|
23
|
+
* single reads (6/6) and never on the list items, so they are optional.
|
|
24
|
+
* `adminIDs` was an empty array for some groups but always present.
|
|
25
|
+
*
|
|
26
|
+
* `links` reuses {@link ChannelLink}: every entry was `{ method, href }`, some
|
|
27
|
+
* also carrying the optional `parameters`/`form` descriptors, matching the
|
|
28
|
+
* channel link shape exactly.
|
|
29
|
+
*/
|
|
30
|
+
export interface Group {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
type: string;
|
|
34
|
+
accessorIDs: string[];
|
|
35
|
+
adminIDs: string[];
|
|
36
|
+
ownerID: string;
|
|
37
|
+
ownerType: string;
|
|
38
|
+
config: GroupConfig;
|
|
39
|
+
entityType: string;
|
|
40
|
+
links: Record<string, ChannelLink>;
|
|
41
|
+
rights: string[];
|
|
42
|
+
accessors?: GroupAccessors;
|
|
43
|
+
owner?: GroupUser;
|
|
44
|
+
adminsWithGroups?: GroupAdminsWithGroups;
|
|
45
|
+
users?: GroupUsers;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=Group.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Group.d.ts","sourceRoot":"","sources":["../../../../src/types/groups/Group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACtD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,WAAW,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IAClC,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,SAAS,CAAC,EAAE,cAAc,CAAA;IAC1B,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,gBAAgB,CAAC,EAAE,qBAAqB,CAAA;IACxC,KAAK,CAAC,EAAE,UAAU,CAAA;CACnB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { GroupBranch } from './GroupBranch';
|
|
2
|
+
/**
|
|
3
|
+
* The `accessors` object on a group's single-read response.
|
|
4
|
+
*
|
|
5
|
+
* Grounded in a live prod sweep (6/6 single reads): every `accessors` carried a
|
|
6
|
+
* single key, `branch`, holding the platform branch entity the group belongs
|
|
7
|
+
* to. Present only on single reads (`GET /api/groups/{id}`), never on the list
|
|
8
|
+
* items. The official groups spec does not document this shape.
|
|
9
|
+
*/
|
|
10
|
+
export interface GroupAccessors {
|
|
11
|
+
branch: GroupBranch;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=GroupAccessors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupAccessors.d.ts","sourceRoot":"","sources":["../../../../src/types/groups/GroupAccessors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,WAAW,CAAA;CACpB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ChannelLink } from '../content/ChannelLink';
|
|
2
|
+
/**
|
|
3
|
+
* The `adminsWithGroups` object on a group's single-read response.
|
|
4
|
+
*
|
|
5
|
+
* Grounded in a live prod sweep (6 single reads): `links` (a HAL link map) and
|
|
6
|
+
* `rights` (a string array) were present on 6/6, while `groups` (an embedded
|
|
7
|
+
* paginated collection of `{ total, data }`) appeared on only 1/6 and is
|
|
8
|
+
* therefore optional. Present only on single reads, never on the list items.
|
|
9
|
+
* The `groups` payload is an embedded collection of platform entities and is
|
|
10
|
+
* typed as an opaque record. The official groups spec does not document this
|
|
11
|
+
* shape.
|
|
12
|
+
*/
|
|
13
|
+
export interface GroupAdminsWithGroups {
|
|
14
|
+
links: Record<string, ChannelLink>;
|
|
15
|
+
rights: string[];
|
|
16
|
+
groups?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=GroupAdminsWithGroups.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupAdminsWithGroups.d.ts","sourceRoot":"","sources":["../../../../src/types/groups/GroupAdminsWithGroups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEzD;;;;;;;;;;GAUG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IAClC,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACjC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A platform branch entity as embedded in a group's `accessors.branch` on the
|
|
3
|
+
* single-read response.
|
|
4
|
+
*
|
|
5
|
+
* Grounded in a live prod sweep (6 branch entities across 6 single reads): all
|
|
6
|
+
* nine top-level keys below were present on 6/6. The nested `config`, `image`
|
|
7
|
+
* and `colors` objects are platform-controlled branch settings dumps and are
|
|
8
|
+
* typed as opaque records, since their inner shapes are tenant-wide
|
|
9
|
+
* configuration rather than part of the group read contract. The official
|
|
10
|
+
* groups spec does not document this shape.
|
|
11
|
+
*/
|
|
12
|
+
export interface GroupBranch {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
slug: string;
|
|
16
|
+
tag: string;
|
|
17
|
+
config: Record<string, unknown>;
|
|
18
|
+
image: Record<string, unknown>;
|
|
19
|
+
colors: Record<string, unknown>;
|
|
20
|
+
created: string;
|
|
21
|
+
updated: string;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=GroupBranch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupBranch.d.ts","sourceRoot":"","sources":["../../../../src/types/groups/GroupBranch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { GroupConfigLocalization } from './GroupConfigLocalization';
|
|
2
|
+
/**
|
|
3
|
+
* A group's `config` object as returned by the read endpoints
|
|
4
|
+
* (`GET /api/groups`, `GET /api/groups/{id}`).
|
|
5
|
+
*
|
|
6
|
+
* Grounded in a live prod sweep of all 45 groups: every group's `config`
|
|
7
|
+
* carried exactly two keys, `localization` (a per-locale map keyed by locale
|
|
8
|
+
* code) and `showInOverview` (boolean), both present on 45/45 list items and
|
|
9
|
+
* 6/6 single reads. The head-start hint of `icon`/`imageUrl`/`link` was not
|
|
10
|
+
* observed on any group and is therefore not modeled.
|
|
11
|
+
*/
|
|
12
|
+
export interface GroupConfig {
|
|
13
|
+
localization: Record<string, GroupConfigLocalization>;
|
|
14
|
+
showInOverview: boolean;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=GroupConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupConfig.d.ts","sourceRoot":"","sources":["../../../../src/types/groups/GroupConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAExE;;;;;;;;;GASG;AACH,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAA;IACrD,cAAc,EAAE,OAAO,CAAA;CACxB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One per-locale entry of a group's `config.localization` map.
|
|
3
|
+
*
|
|
4
|
+
* Grounded in a live prod sweep of all 45 groups (51 localization entries
|
|
5
|
+
* across list + single reads): every entry carried exactly one key, `title`,
|
|
6
|
+
* always a string. The spec does not document this shape (the official groups
|
|
7
|
+
* `Group` schema models a different management API and does not match the
|
|
8
|
+
* runtime at all).
|
|
9
|
+
*/
|
|
10
|
+
export interface GroupConfigLocalization {
|
|
11
|
+
title: string;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=GroupConfigLocalization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupConfigLocalization.d.ts","sourceRoot":"","sources":["../../../../src/types/groups/GroupConfigLocalization.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A platform user entity as embedded in a group's single-read response, used
|
|
3
|
+
* both for `owner` and for each item of `users.data`.
|
|
4
|
+
*
|
|
5
|
+
* Grounded in a live prod sweep (306 user entities across 6 single reads). The
|
|
6
|
+
* required/optional split below reflects observed presence counts: the core
|
|
7
|
+
* identity and account fields were present on 306/306, while `avatar`
|
|
8
|
+
* (276/306), `recoveryCode` (11/306), `secret` (20/306) and `deactivatedAt`
|
|
9
|
+
* (2/306) were genuinely absent on some users. `mandatoryGroupIDs` and
|
|
10
|
+
* `phoneNumber` were always `null` in the sweep; `department`, `location` and
|
|
11
|
+
* `position` were string-or-null.
|
|
12
|
+
*
|
|
13
|
+
* Nested platform sub-objects (`avatar`, `config`, `creation`, `profile`,
|
|
14
|
+
* `recoveryCode`, `role`, `secret`, `userName`) are full entity dumps and are
|
|
15
|
+
* typed as opaque records: their inner shapes are platform-controlled, vary by
|
|
16
|
+
* tenant (`profile` is a free-form custom-field map), and are not part of the
|
|
17
|
+
* contract this read type guarantees. The official groups spec does not
|
|
18
|
+
* document this user shape at all.
|
|
19
|
+
*/
|
|
20
|
+
export interface GroupUser {
|
|
21
|
+
id: string;
|
|
22
|
+
firstName: string;
|
|
23
|
+
lastName: string;
|
|
24
|
+
entityType: string;
|
|
25
|
+
status: string;
|
|
26
|
+
activated: string;
|
|
27
|
+
branchID: string;
|
|
28
|
+
branchRole: string;
|
|
29
|
+
externalID: string;
|
|
30
|
+
publicEmailAddress: string;
|
|
31
|
+
department: string | null;
|
|
32
|
+
location: string | null;
|
|
33
|
+
position: string | null;
|
|
34
|
+
mandatoryGroupIDs: string[] | null;
|
|
35
|
+
phoneNumber: string | null;
|
|
36
|
+
groupIDs: string[];
|
|
37
|
+
tags: string[];
|
|
38
|
+
emails: Record<string, unknown>[];
|
|
39
|
+
config: Record<string, unknown>;
|
|
40
|
+
creation: Record<string, unknown>;
|
|
41
|
+
profile: Record<string, unknown>;
|
|
42
|
+
role: Record<string, unknown>;
|
|
43
|
+
userName: Record<string, unknown>;
|
|
44
|
+
avatar?: Record<string, unknown>;
|
|
45
|
+
recoveryCode?: Record<string, unknown>;
|
|
46
|
+
secret?: Record<string, unknown>;
|
|
47
|
+
deactivatedAt?: string;
|
|
48
|
+
created: string;
|
|
49
|
+
updated: string;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=GroupUser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupUser.d.ts","sourceRoot":"","sources":["../../../../src/types/groups/GroupUser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,MAAM,CAAA;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,iBAAiB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAClC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ChannelLink } from '../content/ChannelLink';
|
|
2
|
+
import { GroupUser } from './GroupUser';
|
|
3
|
+
/**
|
|
4
|
+
* The `users` object on a group's single-read response: a paginated collection
|
|
5
|
+
* of the group's members.
|
|
6
|
+
*
|
|
7
|
+
* Grounded in a live prod sweep (6/6 single reads): the pagination envelope
|
|
8
|
+
* (`total`, `limit`, `offset`), the `data` array of {@link GroupUser} members,
|
|
9
|
+
* the `links` HAL map and the `rights` string array were all present on 6/6.
|
|
10
|
+
* Present only on single reads (`GET /api/groups/{id}`), never on the list
|
|
11
|
+
* items. The official groups spec does not document this shape.
|
|
12
|
+
*/
|
|
13
|
+
export interface GroupUsers {
|
|
14
|
+
total: number;
|
|
15
|
+
limit: number;
|
|
16
|
+
offset: number;
|
|
17
|
+
data: GroupUser[];
|
|
18
|
+
links: Record<string, ChannelLink>;
|
|
19
|
+
rights: string[];
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=GroupUsers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GroupUsers.d.ts","sourceRoot":"","sources":["../../../../src/types/groups/GroupUsers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C;;;;;;;;;GASG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,SAAS,EAAE,CAAA;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;IAClC,MAAM,EAAE,MAAM,EAAE,CAAA;CACjB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { components } from './generated/groupsApi';
|
|
2
|
+
/**
|
|
3
|
+
* Request body for updating a group.
|
|
4
|
+
*
|
|
5
|
+
* Thin alias over the machine-generated groups API schema so the public name
|
|
6
|
+
* stays stable even if `generated/groupsApi.ts` is regenerated. The write side
|
|
7
|
+
* of the spec is properly schematized, so this is sourced directly from codegen
|
|
8
|
+
* (unlike `Group`, whose read shape had to be curated from prod because
|
|
9
|
+
* the spec's `Group` schema does not match the runtime).
|
|
10
|
+
*/
|
|
11
|
+
export type UpdateGroupBody = components['schemas']['GroupUpdate'];
|
|
12
|
+
//# sourceMappingURL=UpdateGroupBody.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateGroupBody.d.ts","sourceRoot":"","sources":["../../../../src/types/groups/UpdateGroupBody.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,aAAa,CAAC,CAAA"}
|