@actschurch/ccms-sdk 0.0.1 → 0.0.2

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 (3) hide show
  1. package/README.html +46 -46
  2. package/README.md +46 -46
  3. package/package.json +7 -7
package/README.html CHANGED
@@ -218,11 +218,11 @@ strong {
218
218
 
219
219
  <h2>Installation</h2>
220
220
 
221
- <pre><code class="language-bash">npm install @ccms/sdk
221
+ <pre><code class="language-bash">npm install @actschurch/ccms-sdk
222
222
  <h1>or</h1>
223
- <p>yarn add @ccms/sdk</p>
223
+ <p>yarn add @actschurch/ccms-sdk</p>
224
224
  <h1>or</h1>
225
- <p>pnpm add @ccms/sdk</code></pre></p>
225
+ <p>pnpm add @actschurch/ccms-sdk</code></pre></p>
226
226
 
227
227
  <h3>Peer Dependencies</h3>
228
228
 
@@ -235,7 +235,7 @@ strong {
235
235
 
236
236
  <h3>Basic Setup (Vanilla JavaScript/TypeScript)</h3>
237
237
 
238
- <pre><code class="language-typescript">import { HttpClient, AuthManager, LocalStorageAdapter } from &#039;@ccms/sdk&#039;;
238
+ <pre><code class="language-typescript">import { HttpClient, AuthManager, LocalStorageAdapter } from &#039;@actschurch/ccms-sdk&#039;;
239
239
 
240
240
  <p>// Create HTTP client
241
241
  const http = new HttpClient({
@@ -262,7 +262,7 @@ const response = await http.get(&#039;/api/members&#039;);</code></pre></p>
262
262
 
263
263
  <h3>React Setup</h3>
264
264
 
265
- <pre><code class="language-tsx">import { CCMSProvider, useCCMS, useAuth } from &#039;@ccms/sdk&#039;;
265
+ <pre><code class="language-tsx">import { CCMSProvider, useCCMS, useAuth } from &#039;@actschurch/ccms-sdk&#039;;
266
266
 
267
267
  <p>// Wrap your app with CCMSProvider
268
268
  function App() {
@@ -303,7 +303,7 @@ function Dashboard() {
303
303
 
304
304
  <p>The <code>HttpClient</code> is the foundation for all API communication. It handles request/response interceptors, authentication headers, and error handling.</p>
305
305
 
306
- <pre><code class="language-typescript">import { HttpClient } from &#039;@ccms/sdk&#039;;
306
+ <pre><code class="language-typescript">import { HttpClient } from &#039;@actschurch/ccms-sdk&#039;;
307
307
 
308
308
  <p>const http = new HttpClient({
309
309
  baseUrl: &#039;https://api.yourccms.com&#039;,
@@ -369,7 +369,7 @@ http.interceptors.response.use(
369
369
 
370
370
  <p>The <code>AuthManager</code> handles the complete authentication flow including login, logout, token refresh, and session persistence.</p>
371
371
 
372
- <pre><code class="language-typescript">import { AuthManager, LocalStorageAdapter, MemoryStorageAdapter } from &#039;@ccms/sdk&#039;;
372
+ <pre><code class="language-typescript">import { AuthManager, LocalStorageAdapter, MemoryStorageAdapter } from &#039;@actschurch/ccms-sdk&#039;;
373
373
 
374
374
  <p>// Create auth manager
375
375
  const authManager = new AuthManager(http, {
@@ -441,7 +441,7 @@ authManager.destroy();</code></pre></p>
441
441
  SecureStorageAdapter, // React Native - secure storage
442
442
  CookieStorageAdapter, // SSR/universal apps
443
443
  GenericStorageAuthAdapter, // Custom storage
444
- } from &#039;@ccms/sdk&#039;;</p>
444
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
445
445
 
446
446
  <p>// React Native with AsyncStorage
447
447
  import AsyncStorage from &#039;@react-native-async-storage/async-storage&#039;;
@@ -460,7 +460,7 @@ const storage = new LocalStorageAdapter(&#039;my<em>app</em>auth&#039;);</code><
460
460
 
461
461
  <p>The <code>PermissionManager</code> handles feature-based access control using roles and permissions.</p>
462
462
 
463
- <pre><code class="language-typescript">import { PermissionManager, defineFeature, requires } from &#039;@ccms/sdk&#039;;
463
+ <pre><code class="language-typescript">import { PermissionManager, defineFeature, requires } from &#039;@actschurch/ccms-sdk&#039;;
464
464
 
465
465
  <p>// Create permission manager
466
466
  const permissions = new PermissionManager({
@@ -557,7 +557,7 @@ permissions.onDenied((event) =&gt; {
557
557
 
558
558
  <p><strong>Available Statuses:</strong> <code>Online</code>, <code>Away</code>, <code>Busy</code>, <code>Offline</code></p>
559
559
 
560
- <pre><code class="language-tsx">import { PresenceProvider, usePresence, useUserPresence, useOnlineUsers, usePresenceStatus, PresenceStatus } from &#039;@ccms/sdk/realtime/presence&#039;;
560
+ <pre><code class="language-tsx">import { PresenceProvider, usePresence, useUserPresence, useOnlineUsers, usePresenceStatus, PresenceStatus } from &#039;@actschurch/ccms-sdk/realtime/presence&#039;;
561
561
 
562
562
  <p>// Setup in your app root with auto-connection management
563
563
  function App() {
@@ -645,7 +645,7 @@ function OnlineUsersList() {
645
645
  useApiLogs,
646
646
  useQueryLogs,
647
647
  useDashboard,
648
- } from &#039;@ccms/sdk/realtime/logs&#039;;</p>
648
+ } from &#039;@actschurch/ccms-sdk/realtime/logs&#039;;</p>
649
649
 
650
650
  <p>// Application logs with filtering and event handling
651
651
  function LogsViewer() {
@@ -840,12 +840,12 @@ function PerformanceDashboard() {
840
840
  <p>The old <code>RealtimeClient</code> is deprecated. Migrate to the new SignalR-based modules:</p>
841
841
 
842
842
  <pre><code class="language-typescript">// Old (deprecated)
843
- <p>import { RealtimeClient } from &#039;@ccms/sdk&#039;;
843
+ <p>import { RealtimeClient } from &#039;@actschurch/ccms-sdk&#039;;
844
844
  const realtime = new RealtimeClient(config);
845
845
  realtime.updatePresence(&#039;Online&#039;);</p>
846
846
 
847
847
  <p>// New (recommended)
848
- import { usePresence } from &#039;@ccms/sdk/realtime/presence&#039;;
848
+ import { usePresence } from &#039;@actschurch/ccms-sdk/realtime/presence&#039;;
849
849
  const { updateStatus } = usePresence();
850
850
  updateStatus(PresenceStatus.Online);</code></pre></p>
851
851
 
@@ -855,7 +855,7 @@ updateStatus(PresenceStatus.Online);</code></pre></p>
855
855
 
856
856
  <p>The SDK provides comprehensive error handling utilities.</p>
857
857
 
858
- <pre><code class="language-typescript">import { ErrorHandler, CCMSError } from &#039;@ccms/sdk&#039;;
858
+ <pre><code class="language-typescript">import { ErrorHandler, CCMSError } from &#039;@actschurch/ccms-sdk&#039;;
859
859
 
860
860
  <p>// Create error handler
861
861
  const errorHandler = new ErrorHandler({
@@ -888,7 +888,7 @@ throw new CCMSError(&#039;Something went wrong&#039;, {
888
888
 
889
889
  <p>Wrap your application with <code>CCMSProvider</code>:</p>
890
890
 
891
- <pre><code class="language-tsx">import { CCMSProvider } from &#039;@ccms/sdk&#039;;
891
+ <pre><code class="language-tsx">import { CCMSProvider } from &#039;@actschurch/ccms-sdk&#039;;
892
892
 
893
893
  <p>function App() {
894
894
  return (
@@ -918,7 +918,7 @@ throw new CCMSError(&#039;Something went wrong&#039;, {
918
918
  useHttpClient,
919
919
  useRealtime,
920
920
  usePermissions,
921
- } from &#039;@ccms/sdk&#039;;</p>
921
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
922
922
 
923
923
  <p>function MyComponent() {
924
924
  // Access full SDK context
@@ -932,7 +932,7 @@ throw new CCMSError(&#039;Something went wrong&#039;, {
932
932
 
933
933
  <h4>Authentication Hooks</h4>
934
934
 
935
- <pre><code class="language-tsx">import { useAuth, useIsAuthenticated, useUser, useHasRole, useHasRight } from &#039;@ccms/sdk&#039;;
935
+ <pre><code class="language-tsx">import { useAuth, useIsAuthenticated, useUser, useHasRole, useHasRight } from &#039;@actschurch/ccms-sdk&#039;;
936
936
 
937
937
  <p>function Profile() {
938
938
  const { user, isAuthenticated, isLoading, login, logout } = useAuth();</p>
@@ -957,7 +957,7 @@ throw new CCMSError(&#039;Something went wrong&#039;, {
957
957
 
958
958
  <h4>API Hooks</h4>
959
959
 
960
- <pre><code class="language-tsx">import { useQuery, useMutation, useInfiniteQuery, usePrefetch } from &#039;@ccms/sdk&#039;;
960
+ <pre><code class="language-tsx">import { useQuery, useMutation, useInfiniteQuery, usePrefetch } from &#039;@actschurch/ccms-sdk&#039;;
961
961
 
962
962
  <p>function MemberList() {
963
963
  // Fetch data
@@ -1011,7 +1011,7 @@ throw new CCMSError(&#039;Something went wrong&#039;, {
1011
1011
  usePresenceStatus,
1012
1012
  useOnlineUsers,
1013
1013
  useUserPresence,
1014
- } from &#039;@ccms/sdk/realtime/presence&#039;;</p>
1014
+ } from &#039;@actschurch/ccms-sdk/realtime/presence&#039;;</p>
1015
1015
 
1016
1016
  <p>function ChatRoom() {
1017
1017
  // Main presence hook
@@ -1047,7 +1047,7 @@ throw new CCMSError(&#039;Something went wrong&#039;, {
1047
1047
  useApiLogs,
1048
1048
  useQueryLogs,
1049
1049
  useDashboard,
1050
- } from &#039;@ccms/sdk/realtime/logs&#039;;</p>
1050
+ } from &#039;@actschurch/ccms-sdk/realtime/logs&#039;;</p>
1051
1051
 
1052
1052
  <p>function LogMonitor() {
1053
1053
  // Application logs
@@ -1087,7 +1087,7 @@ throw new CCMSError(&#039;Something went wrong&#039;, {
1087
1087
  <pre><code class="language-tsx">// ⚠️ DEPRECATED: These hooks are deprecated and will be removed in v2.0.0
1088
1088
  <p>// Use the new hooks above instead</p>
1089
1089
 
1090
- <p>import { useRealtimeEvent, useConnectionState } from &#039;@ccms/sdk&#039;;</p>
1090
+ <p>import { useRealtimeEvent, useConnectionState } from &#039;@actschurch/ccms-sdk&#039;;</p>
1091
1091
 
1092
1092
  <p>function OldComponent() {
1093
1093
  const connectionState = useConnectionState(); // Use usePresence() instead
@@ -1112,7 +1112,7 @@ throw new CCMSError(&#039;Something went wrong&#039;, {
1112
1112
  useClipboard,
1113
1113
  useClickOutside,
1114
1114
  useKeyPress,
1115
- } from &#039;@ccms/sdk&#039;;</p>
1115
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1116
1116
 
1117
1117
  <p>function SearchComponent() {
1118
1118
  const [search, setSearch] = useState(&#039;&#039;);
@@ -1150,7 +1150,7 @@ throw new CCMSError(&#039;Something went wrong&#039;, {
1150
1150
 
1151
1151
  <h4>Permission Components</h4>
1152
1152
 
1153
- <pre><code class="language-tsx">import { Can, RequireAuth, RequireRole, RequireRight } from &#039;@ccms/sdk&#039;;
1153
+ <pre><code class="language-tsx">import { Can, RequireAuth, RequireRole, RequireRight } from &#039;@actschurch/ccms-sdk&#039;;
1154
1154
 
1155
1155
  <p>function App() {
1156
1156
  return (
@@ -1188,7 +1188,7 @@ throw new CCMSError(&#039;Something went wrong&#039;, {
1188
1188
 
1189
1189
  <h4>Error Boundary</h4>
1190
1190
 
1191
- <pre><code class="language-tsx">import { ErrorBoundary } from &#039;@ccms/sdk&#039;;
1191
+ <pre><code class="language-tsx">import { ErrorBoundary } from &#039;@actschurch/ccms-sdk&#039;;
1192
1192
 
1193
1193
  <p>function App() {
1194
1194
  return (
@@ -1215,7 +1215,7 @@ throw new CCMSError(&#039;Something went wrong&#039;, {
1215
1215
  <pre><code class="language-typescript">// In your app entry point (App.tsx or index.js)
1216
1216
  <p>import AsyncStorage from &#039;@react-native-async-storage/async-storage&#039;;
1217
1217
  import NetInfo from &#039;@react-native-community/netinfo&#039;;
1218
- import { setGlobalStorage, setGlobalNetworkStatus } from &#039;@ccms/sdk&#039;;</p>
1218
+ import { setGlobalStorage, setGlobalNetworkStatus } from &#039;@actschurch/ccms-sdk&#039;;</p>
1219
1219
 
1220
1220
  <p>// Configure storage (do this before using any SDK features)
1221
1221
  setGlobalStorage(AsyncStorage);</p>
@@ -1236,7 +1236,7 @@ setGlobalNetworkStatus({
1236
1236
  <h3>Use with Expo SecureStore</h3>
1237
1237
 
1238
1238
  <pre><code class="language-typescript">import * as SecureStore from &#039;expo-secure-store&#039;;
1239
- <p>import { SecureStorageAdapter, AuthManager } from &#039;@ccms/sdk&#039;;</p>
1239
+ <p>import { SecureStorageAdapter, AuthManager } from &#039;@actschurch/ccms-sdk&#039;;</p>
1240
1240
 
1241
1241
  <p>const authManager = new AuthManager(http, {
1242
1242
  storage: new SecureStorageAdapter(SecureStore),
@@ -1359,7 +1359,7 @@ setGlobalNetworkStatus({
1359
1359
 
1360
1360
  <h3>Using Services</h3>
1361
1361
 
1362
- <pre><code class="language-typescript">import { MemberService, TaskService } from &#039;@ccms/sdk&#039;;
1362
+ <pre><code class="language-typescript">import { MemberService, TaskService } from &#039;@actschurch/ccms-sdk&#039;;
1363
1363
 
1364
1364
  <p>// Initialize services with HTTP client
1365
1365
  const memberService = new MemberService(http);
@@ -1419,7 +1419,7 @@ await taskService.addComment(&#039;task-789&#039;, &#039;Completed the follow-up
1419
1419
  useFeedbackServices,
1420
1420
  useSystemServices,
1421
1421
  useGeneratorsServices,
1422
- } from &#039;@ccms/sdk&#039;;</p>
1422
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1423
1423
 
1424
1424
  <p>function TaskList() {
1425
1425
  const { task, taskStatus, taskPriority } = useTaskServices();
@@ -1469,7 +1469,7 @@ function MeetingScheduler() {
1469
1469
 
1470
1470
  <p>You can create custom services by extending the base service class:</p>
1471
1471
 
1472
- <pre><code class="language-typescript">import { BaseService } from &#039;@ccms/sdk&#039;;
1472
+ <pre><code class="language-typescript">import { BaseService } from &#039;@actschurch/ccms-sdk&#039;;
1473
1473
 
1474
1474
  <p>class CustomService extends BaseService {
1475
1475
  constructor(http: HttpClient) {
@@ -1567,7 +1567,7 @@ await memberService.deleteMany([&#039;member-3&#039;, &#039;member-4&#039;]);</c
1567
1567
  getInitials,
1568
1568
  pluralize,
1569
1569
  similarity,
1570
- } from &#039;@ccms/sdk&#039;;</p>
1570
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1571
1571
 
1572
1572
  <p>capitalize(&#039;hello world&#039;); // &quot;Hello world&quot;
1573
1573
  toCamelCase(&#039;hello-world&#039;); // &quot;helloWorld&quot;
@@ -1591,7 +1591,7 @@ similarity(&#039;hello&#039;, &#039;hallo&#039;); // 0.8</code></pre></p>
1591
1591
  toOrdinal,
1592
1592
  formatFileSize,
1593
1593
  formatDurationFromSeconds,
1594
- } from &#039;@ccms/sdk&#039;;</p>
1594
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1595
1595
 
1596
1596
  <p>formatCurrency(1234.56, &#039;USD&#039;); // &quot;$1,234.56&quot;
1597
1597
  formatNumber(1234567); // &quot;1,234,567&quot;
@@ -1618,7 +1618,7 @@ formatDurationFromSeconds(3661); // &quot;1:01:01&quot;</code></pre></p>
1618
1618
  fromNow,
1619
1619
  toUnix,
1620
1620
  fromUnix,
1621
- } from &#039;@ccms/sdk&#039;;</p>
1621
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1622
1622
 
1623
1623
  <p>formatDate(new Date(), &#039;YYYY-MM-DD&#039;); // &quot;2024-01-15&quot;
1624
1624
  addDays(new Date(), 7); // Date 7 days from now
@@ -1642,7 +1642,7 @@ isWeekend(new Date()); // true/false</code></pre></p>
1642
1642
  union,
1643
1643
  flatten,
1644
1644
  moveItem,
1645
- } from &#039;@ccms/sdk&#039;;</p>
1645
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1646
1646
 
1647
1647
  <p>unique([1, 2, 2, 3]); // [1, 2, 3]
1648
1648
  uniqueBy(users, &#039;email&#039;); // Remove duplicates by email
@@ -1669,7 +1669,7 @@ sample(items, 3); // Random 3 items</code></pre></p>
1669
1669
  isEmpty,
1670
1670
  mapValues,
1671
1671
  filterObject,
1672
- } from &#039;@ccms/sdk&#039;;</p>
1672
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1673
1673
 
1674
1674
  <p>deepClone(complexObject);
1675
1675
  deepMerge(defaults, userConfig);
@@ -1698,7 +1698,7 @@ diff(original, modified); // { changed: &#039;fields&#039; }</code></pre></p>
1698
1698
  validatePassword,
1699
1699
  validateUsername,
1700
1700
  validateAll,
1701
- } from &#039;@ccms/sdk&#039;;</p>
1701
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1702
1702
 
1703
1703
  <p>isEmail(&#039;test@example.com&#039;); // true
1704
1704
  isPhoneNumber(&#039;+1-555-123-4567&#039;); // true
@@ -1730,7 +1730,7 @@ validateAll([
1730
1730
  isLightColor,
1731
1731
  mix,
1732
1732
  generatePalette,
1733
- } from &#039;@ccms/sdk&#039;;</p>
1733
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1734
1734
 
1735
1735
  <p>hexToRgb(&#039;#ff5500&#039;); // { r: 255, g: 85, b: 0 }
1736
1736
  rgbToHex(255, 85, 0); // &quot;#ff5500&quot;
@@ -1754,7 +1754,7 @@ generatePalette(&#039;#ff5500&#039;, 5); // { light: [...], dark: [...] }</code>
1754
1754
  isIOS,
1755
1755
  isAndroid,
1756
1756
  getBrowserInfo,
1757
- } from &#039;@ccms/sdk&#039;;</p>
1757
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1758
1758
 
1759
1759
  <p>if (isProduction()) {
1760
1760
  // Production-only code
@@ -1788,7 +1788,7 @@ generatePalette(&#039;#ff5500&#039;, 5); // { light: [...], dark: [...] }</code>
1788
1788
  getCurrentBreakpoint,
1789
1789
  isAtLeast,
1790
1790
  isAtMost,
1791
- } from &#039;@ccms/sdk&#039;;</p>
1791
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1792
1792
 
1793
1793
  <p>const screen = getScreenInfo(); // { width, height, pixelRatio, orientation }
1794
1794
  const device = getDeviceType(); // &#039;phone&#039; | &#039;tablet&#039; | &#039;desktop&#039;
@@ -1819,7 +1819,7 @@ if (isAtLeast(&#039;md&#039;)) {
1819
1819
  fetchWithRetry,
1820
1820
  createQueryString,
1821
1821
  buildUrl,
1822
- } from &#039;@ccms/sdk&#039;;</p>
1822
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1823
1823
 
1824
1824
  <p>// Create responses
1825
1825
  const success = createSuccessResponse(data, &#039;Operation successful&#039;);
@@ -1862,7 +1862,7 @@ const url = buildUrl(&#039;https://api.example.com&#039;, &#039;/users&#039;, {
1862
1862
  ValidationError,
1863
1863
  NetworkError,
1864
1864
  TimeoutError,
1865
- } from &#039;@ccms/sdk&#039;;</p>
1865
+ } from &#039;@actschurch/ccms-sdk&#039;;</p>
1866
1866
 
1867
1867
  <p>// Safe execution with fallback
1868
1868
  const result = safeTry(() =&gt; JSON.parse(input), {});</p>
@@ -1926,7 +1926,7 @@ const message = formatErrorForUser(error);
1926
1926
  Address,</p>
1927
1927
 
1928
1928
  <p> // And many more...
1929
- } from &#039;@ccms/sdk&#039;;</code></pre></p>
1929
+ } from &#039;@actschurch/ccms-sdk&#039;;</code></pre></p>
1930
1930
 
1931
1931
  <hr>
1932
1932
 
@@ -1942,7 +1942,7 @@ const message = formatErrorForUser(error);
1942
1942
  createMockUser,
1943
1943
  createMockPagedResult,
1944
1944
  TestProvider,
1945
- } from &#039;@ccms/sdk/testing&#039;;</p>
1945
+ } from &#039;@actschurch/ccms-sdk/testing&#039;;</p>
1946
1946
 
1947
1947
  <p>// In your tests
1948
1948
  describe(&#039;MyComponent&#039;, () =&gt; {
@@ -2424,22 +2424,22 @@ const mockUser = createMockUser({
2424
2424
  <tr>
2425
2425
  <td><code>RealtimeClient</code></td>
2426
2426
  <td><code>PresenceClient</code>, <code>ApplicationLogsClient</code>, etc.</td>
2427
- <td><code>@ccms/sdk/realtime/*</code></td>
2427
+ <td><code>@actschurch/ccms-sdk/realtime/*</code></td>
2428
2428
  </tr>
2429
2429
  <tr>
2430
2430
  <td><code>useConnectionState()</code></td>
2431
2431
  <td><code>usePresence().state</code></td>
2432
- <td><code>@ccms/sdk/realtime/presence</code></td>
2432
+ <td><code>@actschurch/ccms-sdk/realtime/presence</code></td>
2433
2433
  </tr>
2434
2434
  <tr>
2435
2435
  <td><code>usePresence()</code></td>
2436
2436
  <td><code>usePresence()</code> (new API)</td>
2437
- <td><code>@ccms/sdk/realtime/presence</code></td>
2437
+ <td><code>@actschurch/ccms-sdk/realtime/presence</code></td>
2438
2438
  </tr>
2439
2439
  <tr>
2440
2440
  <td><code>useRealtimeEvent()</code></td>
2441
2441
  <td><code>useApplicationLogs()</code>, <code>useApiLogs()</code>, etc.</td>
2442
- <td><code>@ccms/sdk/realtime/logs</code></td>
2442
+ <td><code>@actschurch/ccms-sdk/realtime/logs</code></td>
2443
2443
  </tr>
2444
2444
  </tbody>
2445
2445
  </table>For detailed migration instructions, see the <a href="src/realtime/README.md#migration-guide">Realtime Module Documentation</a>.</p>
package/README.md CHANGED
@@ -51,11 +51,11 @@ Official TypeScript/JavaScript SDK for the CCMS (Church/Community Management Sys
51
51
  ## Installation
52
52
 
53
53
  ```bash
54
- npm install @ccms/sdk
54
+ npm install @actschurch/ccms-sdk
55
55
  # or
56
- yarn add @ccms/sdk
56
+ yarn add @actschurch/ccms-sdk
57
57
  # or
58
- pnpm add @ccms/sdk
58
+ pnpm add @actschurch/ccms-sdk
59
59
  ```
60
60
 
61
61
  ### Peer Dependencies
@@ -72,7 +72,7 @@ npm install react@^18.0.0
72
72
  ### Basic Setup (Vanilla JavaScript/TypeScript)
73
73
 
74
74
  ```typescript
75
- import { HttpClient, AuthManager, LocalStorageAdapter } from '@ccms/sdk';
75
+ import { HttpClient, AuthManager, LocalStorageAdapter } from '@actschurch/ccms-sdk';
76
76
 
77
77
  // Create HTTP client
78
78
  const http = new HttpClient({
@@ -101,7 +101,7 @@ const response = await http.get('/api/members');
101
101
  ### React Setup
102
102
 
103
103
  ```tsx
104
- import { CCMSProvider, useCCMS, useAuth } from '@ccms/sdk';
104
+ import { CCMSProvider, useCCMS, useAuth } from '@actschurch/ccms-sdk';
105
105
 
106
106
  // Wrap your app with CCMSProvider
107
107
  function App() {
@@ -144,7 +144,7 @@ function Dashboard() {
144
144
  The `HttpClient` is the foundation for all API communication. It handles request/response interceptors, authentication headers, and error handling.
145
145
 
146
146
  ```typescript
147
- import { HttpClient } from '@ccms/sdk';
147
+ import { HttpClient } from '@actschurch/ccms-sdk';
148
148
 
149
149
  const http = new HttpClient({
150
150
  baseUrl: 'https://api.yourccms.com',
@@ -214,7 +214,7 @@ http.interceptors.response.use(
214
214
  The `AuthManager` handles the complete authentication flow including login, logout, token refresh, and session persistence.
215
215
 
216
216
  ```typescript
217
- import { AuthManager, LocalStorageAdapter, MemoryStorageAdapter } from '@ccms/sdk';
217
+ import { AuthManager, LocalStorageAdapter, MemoryStorageAdapter } from '@actschurch/ccms-sdk';
218
218
 
219
219
  // Create auth manager
220
220
  const authManager = new AuthManager(http, {
@@ -288,7 +288,7 @@ import {
288
288
  SecureStorageAdapter, // React Native - secure storage
289
289
  CookieStorageAdapter, // SSR/universal apps
290
290
  GenericStorageAuthAdapter, // Custom storage
291
- } from '@ccms/sdk';
291
+ } from '@actschurch/ccms-sdk';
292
292
 
293
293
  // React Native with AsyncStorage
294
294
  import AsyncStorage from '@react-native-async-storage/async-storage';
@@ -309,7 +309,7 @@ const storage = new LocalStorageAdapter('my_app_auth');
309
309
  The `PermissionManager` handles feature-based access control using roles and permissions.
310
310
 
311
311
  ```typescript
312
- import { PermissionManager, defineFeature, requires } from '@ccms/sdk';
312
+ import { PermissionManager, defineFeature, requires } from '@actschurch/ccms-sdk';
313
313
 
314
314
  // Create permission manager
315
315
  const permissions = new PermissionManager({
@@ -404,7 +404,7 @@ Track user presence and status across the platform with automatic activity detec
404
404
  **Available Statuses:** `Online`, `Away`, `Busy`, `Offline`
405
405
 
406
406
  ```tsx
407
- import { PresenceProvider, usePresence, useUserPresence, useOnlineUsers, usePresenceStatus, PresenceStatus } from '@ccms/sdk/realtime/presence';
407
+ import { PresenceProvider, usePresence, useUserPresence, useOnlineUsers, usePresenceStatus, PresenceStatus } from '@actschurch/ccms-sdk/realtime/presence';
408
408
 
409
409
  // Setup in your app root with auto-connection management
410
410
  function App() {
@@ -490,7 +490,7 @@ import {
490
490
  useApiLogs,
491
491
  useQueryLogs,
492
492
  useDashboard,
493
- } from '@ccms/sdk/realtime/logs';
493
+ } from '@actschurch/ccms-sdk/realtime/logs';
494
494
 
495
495
  // Application logs with filtering and event handling
496
496
  function LogsViewer() {
@@ -685,12 +685,12 @@ The old `RealtimeClient` is deprecated. Migrate to the new SignalR-based modules
685
685
 
686
686
  ```typescript
687
687
  // Old (deprecated)
688
- import { RealtimeClient } from '@ccms/sdk';
688
+ import { RealtimeClient } from '@actschurch/ccms-sdk';
689
689
  const realtime = new RealtimeClient(config);
690
690
  realtime.updatePresence('Online');
691
691
 
692
692
  // New (recommended)
693
- import { usePresence } from '@ccms/sdk/realtime/presence';
693
+ import { usePresence } from '@actschurch/ccms-sdk/realtime/presence';
694
694
  const { updateStatus } = usePresence();
695
695
  updateStatus(PresenceStatus.Online);
696
696
  ```
@@ -702,7 +702,7 @@ updateStatus(PresenceStatus.Online);
702
702
  The SDK provides comprehensive error handling utilities.
703
703
 
704
704
  ```typescript
705
- import { ErrorHandler, CCMSError } from '@ccms/sdk';
705
+ import { ErrorHandler, CCMSError } from '@actschurch/ccms-sdk';
706
706
 
707
707
  // Create error handler
708
708
  const errorHandler = new ErrorHandler({
@@ -737,7 +737,7 @@ throw new CCMSError('Something went wrong', {
737
737
  Wrap your application with `CCMSProvider`:
738
738
 
739
739
  ```tsx
740
- import { CCMSProvider } from '@ccms/sdk';
740
+ import { CCMSProvider } from '@actschurch/ccms-sdk';
741
741
 
742
742
  function App() {
743
743
  return (
@@ -769,7 +769,7 @@ import {
769
769
  useHttpClient,
770
770
  useRealtime,
771
771
  usePermissions,
772
- } from '@ccms/sdk';
772
+ } from '@actschurch/ccms-sdk';
773
773
 
774
774
  function MyComponent() {
775
775
  // Access full SDK context
@@ -785,7 +785,7 @@ function MyComponent() {
785
785
  #### Authentication Hooks
786
786
 
787
787
  ```tsx
788
- import { useAuth, useIsAuthenticated, useUser, useHasRole, useHasRight } from '@ccms/sdk';
788
+ import { useAuth, useIsAuthenticated, useUser, useHasRole, useHasRight } from '@actschurch/ccms-sdk';
789
789
 
790
790
  function Profile() {
791
791
  const { user, isAuthenticated, isLoading, login, logout } = useAuth();
@@ -812,7 +812,7 @@ function Profile() {
812
812
  #### API Hooks
813
813
 
814
814
  ```tsx
815
- import { useQuery, useMutation, useInfiniteQuery, usePrefetch } from '@ccms/sdk';
815
+ import { useQuery, useMutation, useInfiniteQuery, usePrefetch } from '@actschurch/ccms-sdk';
816
816
 
817
817
  function MemberList() {
818
818
  // Fetch data
@@ -868,7 +868,7 @@ import {
868
868
  usePresenceStatus,
869
869
  useOnlineUsers,
870
870
  useUserPresence,
871
- } from '@ccms/sdk/realtime/presence';
871
+ } from '@actschurch/ccms-sdk/realtime/presence';
872
872
 
873
873
  function ChatRoom() {
874
874
  // Main presence hook
@@ -906,7 +906,7 @@ import {
906
906
  useApiLogs,
907
907
  useQueryLogs,
908
908
  useDashboard,
909
- } from '@ccms/sdk/realtime/logs';
909
+ } from '@actschurch/ccms-sdk/realtime/logs';
910
910
 
911
911
  function LogMonitor() {
912
912
  // Application logs
@@ -948,7 +948,7 @@ function LogMonitor() {
948
948
  // ⚠️ DEPRECATED: These hooks are deprecated and will be removed in v2.0.0
949
949
  // Use the new hooks above instead
950
950
 
951
- import { useRealtimeEvent, useConnectionState } from '@ccms/sdk';
951
+ import { useRealtimeEvent, useConnectionState } from '@actschurch/ccms-sdk';
952
952
 
953
953
  function OldComponent() {
954
954
  const connectionState = useConnectionState(); // Use usePresence() instead
@@ -975,7 +975,7 @@ import {
975
975
  useClipboard,
976
976
  useClickOutside,
977
977
  useKeyPress,
978
- } from '@ccms/sdk';
978
+ } from '@actschurch/ccms-sdk';
979
979
 
980
980
  function SearchComponent() {
981
981
  const [search, setSearch] = useState('');
@@ -1015,7 +1015,7 @@ function SearchComponent() {
1015
1015
  #### Permission Components
1016
1016
 
1017
1017
  ```tsx
1018
- import { Can, RequireAuth, RequireRole, RequireRight } from '@ccms/sdk';
1018
+ import { Can, RequireAuth, RequireRole, RequireRight } from '@actschurch/ccms-sdk';
1019
1019
 
1020
1020
  function App() {
1021
1021
  return (
@@ -1055,7 +1055,7 @@ function Dashboard() {
1055
1055
  #### Error Boundary
1056
1056
 
1057
1057
  ```tsx
1058
- import { ErrorBoundary } from '@ccms/sdk';
1058
+ import { ErrorBoundary } from '@actschurch/ccms-sdk';
1059
1059
 
1060
1060
  function App() {
1061
1061
  return (
@@ -1084,7 +1084,7 @@ function App() {
1084
1084
  // In your app entry point (App.tsx or index.js)
1085
1085
  import AsyncStorage from '@react-native-async-storage/async-storage';
1086
1086
  import NetInfo from '@react-native-community/netinfo';
1087
- import { setGlobalStorage, setGlobalNetworkStatus } from '@ccms/sdk';
1087
+ import { setGlobalStorage, setGlobalNetworkStatus } from '@actschurch/ccms-sdk';
1088
1088
 
1089
1089
  // Configure storage (do this before using any SDK features)
1090
1090
  setGlobalStorage(AsyncStorage);
@@ -1107,7 +1107,7 @@ setGlobalNetworkStatus({
1107
1107
 
1108
1108
  ```typescript
1109
1109
  import * as SecureStore from 'expo-secure-store';
1110
- import { SecureStorageAdapter, AuthManager } from '@ccms/sdk';
1110
+ import { SecureStorageAdapter, AuthManager } from '@actschurch/ccms-sdk';
1111
1111
 
1112
1112
  const authManager = new AuthManager(http, {
1113
1113
  storage: new SecureStorageAdapter(SecureStore),
@@ -1149,7 +1149,7 @@ For detailed information about the service architecture and how to create custom
1149
1149
  ### Using Services
1150
1150
 
1151
1151
  ```typescript
1152
- import { MemberService, TaskService } from '@ccms/sdk';
1152
+ import { MemberService, TaskService } from '@actschurch/ccms-sdk';
1153
1153
 
1154
1154
  // Initialize services with HTTP client
1155
1155
  const memberService = new MemberService(http);
@@ -1211,7 +1211,7 @@ import {
1211
1211
  useFeedbackServices,
1212
1212
  useSystemServices,
1213
1213
  useGeneratorsServices,
1214
- } from '@ccms/sdk';
1214
+ } from '@actschurch/ccms-sdk';
1215
1215
 
1216
1216
  function TaskList() {
1217
1217
  const { task, taskStatus, taskPriority } = useTaskServices();
@@ -1263,7 +1263,7 @@ function MeetingScheduler() {
1263
1263
  You can create custom services by extending the base service class:
1264
1264
 
1265
1265
  ```typescript
1266
- import { BaseService } from '@ccms/sdk';
1266
+ import { BaseService } from '@actschurch/ccms-sdk';
1267
1267
 
1268
1268
  class CustomService extends BaseService {
1269
1269
  constructor(http: HttpClient) {
@@ -1369,7 +1369,7 @@ import {
1369
1369
  getInitials,
1370
1370
  pluralize,
1371
1371
  similarity,
1372
- } from '@ccms/sdk';
1372
+ } from '@actschurch/ccms-sdk';
1373
1373
 
1374
1374
  capitalize('hello world'); // "Hello world"
1375
1375
  toCamelCase('hello-world'); // "helloWorld"
@@ -1395,7 +1395,7 @@ import {
1395
1395
  toOrdinal,
1396
1396
  formatFileSize,
1397
1397
  formatDurationFromSeconds,
1398
- } from '@ccms/sdk';
1398
+ } from '@actschurch/ccms-sdk';
1399
1399
 
1400
1400
  formatCurrency(1234.56, 'USD'); // "$1,234.56"
1401
1401
  formatNumber(1234567); // "1,234,567"
@@ -1424,7 +1424,7 @@ import {
1424
1424
  fromNow,
1425
1425
  toUnix,
1426
1426
  fromUnix,
1427
- } from '@ccms/sdk';
1427
+ } from '@actschurch/ccms-sdk';
1428
1428
 
1429
1429
  formatDate(new Date(), 'YYYY-MM-DD'); // "2024-01-15"
1430
1430
  addDays(new Date(), 7); // Date 7 days from now
@@ -1450,7 +1450,7 @@ import {
1450
1450
  union,
1451
1451
  flatten,
1452
1452
  moveItem,
1453
- } from '@ccms/sdk';
1453
+ } from '@actschurch/ccms-sdk';
1454
1454
 
1455
1455
  unique([1, 2, 2, 3]); // [1, 2, 3]
1456
1456
  uniqueBy(users, 'email'); // Remove duplicates by email
@@ -1479,7 +1479,7 @@ import {
1479
1479
  isEmpty,
1480
1480
  mapValues,
1481
1481
  filterObject,
1482
- } from '@ccms/sdk';
1482
+ } from '@actschurch/ccms-sdk';
1483
1483
 
1484
1484
  deepClone(complexObject);
1485
1485
  deepMerge(defaults, userConfig);
@@ -1510,7 +1510,7 @@ import {
1510
1510
  validatePassword,
1511
1511
  validateUsername,
1512
1512
  validateAll,
1513
- } from '@ccms/sdk';
1513
+ } from '@actschurch/ccms-sdk';
1514
1514
 
1515
1515
  isEmail('test@example.com'); // true
1516
1516
  isPhoneNumber('+1-555-123-4567'); // true
@@ -1544,7 +1544,7 @@ import {
1544
1544
  isLightColor,
1545
1545
  mix,
1546
1546
  generatePalette,
1547
- } from '@ccms/sdk';
1547
+ } from '@actschurch/ccms-sdk';
1548
1548
 
1549
1549
  hexToRgb('#ff5500'); // { r: 255, g: 85, b: 0 }
1550
1550
  rgbToHex(255, 85, 0); // "#ff5500"
@@ -1570,7 +1570,7 @@ import {
1570
1570
  isIOS,
1571
1571
  isAndroid,
1572
1572
  getBrowserInfo,
1573
- } from '@ccms/sdk';
1573
+ } from '@actschurch/ccms-sdk';
1574
1574
 
1575
1575
  if (isProduction()) {
1576
1576
  // Production-only code
@@ -1606,7 +1606,7 @@ import {
1606
1606
  getCurrentBreakpoint,
1607
1607
  isAtLeast,
1608
1608
  isAtMost,
1609
- } from '@ccms/sdk';
1609
+ } from '@actschurch/ccms-sdk';
1610
1610
 
1611
1611
  const screen = getScreenInfo(); // { width, height, pixelRatio, orientation }
1612
1612
  const device = getDeviceType(); // 'phone' | 'tablet' | 'desktop'
@@ -1639,7 +1639,7 @@ import {
1639
1639
  fetchWithRetry,
1640
1640
  createQueryString,
1641
1641
  buildUrl,
1642
- } from '@ccms/sdk';
1642
+ } from '@actschurch/ccms-sdk';
1643
1643
 
1644
1644
  // Create responses
1645
1645
  const success = createSuccessResponse(data, 'Operation successful');
@@ -1684,7 +1684,7 @@ import {
1684
1684
  ValidationError,
1685
1685
  NetworkError,
1686
1686
  TimeoutError,
1687
- } from '@ccms/sdk';
1687
+ } from '@actschurch/ccms-sdk';
1688
1688
 
1689
1689
  // Safe execution with fallback
1690
1690
  const result = safeTry(() => JSON.parse(input), {});
@@ -1750,7 +1750,7 @@ import {
1750
1750
  Address,
1751
1751
 
1752
1752
  // And many more...
1753
- } from '@ccms/sdk';
1753
+ } from '@actschurch/ccms-sdk';
1754
1754
  ```
1755
1755
 
1756
1756
  ---
@@ -1768,7 +1768,7 @@ import {
1768
1768
  createMockUser,
1769
1769
  createMockPagedResult,
1770
1770
  TestProvider,
1771
- } from '@ccms/sdk/testing';
1771
+ } from '@actschurch/ccms-sdk/testing';
1772
1772
 
1773
1773
  // In your tests
1774
1774
  describe('MyComponent', () => {
@@ -1950,10 +1950,10 @@ The original `RealtimeClient` and related hooks are deprecated and will be remov
1950
1950
 
1951
1951
  | Old API | New API | Module |
1952
1952
  |---------|---------|--------|
1953
- | `RealtimeClient` | `PresenceClient`, `ApplicationLogsClient`, etc. | `@ccms/sdk/realtime/*` |
1954
- | `useConnectionState()` | `usePresence().state` | `@ccms/sdk/realtime/presence` |
1955
- | `usePresence()` | `usePresence()` (new API) | `@ccms/sdk/realtime/presence` |
1956
- | `useRealtimeEvent()` | `useApplicationLogs()`, `useApiLogs()`, etc. | `@ccms/sdk/realtime/logs` |
1953
+ | `RealtimeClient` | `PresenceClient`, `ApplicationLogsClient`, etc. | `@actschurch/ccms-sdk/realtime/*` |
1954
+ | `useConnectionState()` | `usePresence().state` | `@actschurch/ccms-sdk/realtime/presence` |
1955
+ | `usePresence()` | `usePresence()` (new API) | `@actschurch/ccms-sdk/realtime/presence` |
1956
+ | `useRealtimeEvent()` | `useApplicationLogs()`, `useApiLogs()`, etc. | `@actschurch/ccms-sdk/realtime/logs` |
1957
1957
 
1958
1958
  For detailed migration instructions, see the [Realtime Module Documentation](src/realtime/README.md#migration-guide).
1959
1959
 
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@actschurch/ccms-sdk",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "CCMS TypeScript SDK for Web APIs and WebSockets (Express, Web, React Native)",
5
5
  "license": "MIT",
6
- "main": "dist/index.cjs.js",
7
- "module": "dist/index.esm.js",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "sideEffects": false,
10
10
  "files": [
@@ -14,13 +14,13 @@
14
14
  ],
15
15
  "exports": {
16
16
  ".": {
17
- "import": "./dist/index.esm.js",
18
- "require": "./dist/index.cjs.js",
17
+ "import": "./dist/index.js",
18
+ "require": "./dist/index.js",
19
19
  "types": "./dist/index.d.ts"
20
20
  },
21
21
  "./react": {
22
- "import": "./dist/react/index.esm.js",
23
- "require": "./dist/react/index.cjs.js",
22
+ "import": "./dist/react/index.js",
23
+ "require": "./dist/react/index.js",
24
24
  "types": "./dist/react/index.d.ts"
25
25
  }
26
26
  },