@agility/management-sdk 0.1.36 → 0.1.37
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 +371 -317
- package/dist/apiMethods/clientInstance.d.ts +2 -0
- package/dist/apiMethods/clientInstance.js +11 -2
- package/dist/apiMethods/containerMethods.d.ts +3 -0
- package/dist/apiMethods/containerMethods.js +43 -9
- package/dist/apiMethods/contentMethods.d.ts +12 -0
- package/dist/apiMethods/contentMethods.js +100 -46
- package/dist/apiMethods/pageMethods.d.ts +12 -0
- package/dist/apiMethods/pageMethods.js +88 -34
- package/dist/enums/contentViewType.d.ts +6 -0
- package/dist/enums/contentViewType.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/models/pagedResult.d.ts +4 -0
- package/dist/models/pagedResult.js +2 -0
- package/docs/asset-methods.md +381 -381
- package/docs/auth-component.md +360 -360
- package/docs/auth.md +593 -593
- package/docs/batch-methods.md +243 -243
- package/docs/cicd.md +606 -606
- package/docs/container-methods.md +267 -267
- package/docs/content-methods.md +491 -422
- package/docs/instance-methods.md +104 -104
- package/docs/instance-user-methods.md +230 -230
- package/docs/model-methods.md +433 -433
- package/docs/multi-instance-operations.md +191 -191
- package/docs/page-methods.md +737 -670
- package/docs/server-user-methods.md +279 -279
- package/docs/webhook-methods.md +451 -451
- package/license.txt +20 -20
- package/package.json +40 -40
- package/tsconfig.json +14 -14
- package/.cursor/api-coverage.md +0 -217
- package/.cursor/api-documentation-manifest.md +0 -275
- package/.cursor/api-functions-analysis.md +0 -111
- package/.cursor/breakout-manifest.md +0 -278
- package/.cursor/docs-final-check.md +0 -269
- package/.cursor/github-actions-improvements.md +0 -76
- package/.cursor/hardening.md +0 -271
- package/.cursor/linting-fix.md +0 -160
- package/.cursor/manifest.md +0 -243
- package/.cursor/mocks.md +0 -100
- package/.cursor/test-coverage.md +0 -841
- package/.env +0 -92
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/coverage-summary.json +0 -43
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -161
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -161
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/src/apiClient.ts.html +0 -199
- package/coverage/lcov-report/src/apiMethods/assetMethods.ts.html +0 -682
- package/coverage/lcov-report/src/apiMethods/batchMethods.ts.html +0 -736
- package/coverage/lcov-report/src/apiMethods/clientInstance.ts.html +0 -403
- package/coverage/lcov-report/src/apiMethods/containerMethods.ts.html +0 -460
- package/coverage/lcov-report/src/apiMethods/contentMethods.ts.html +0 -1183
- package/coverage/lcov-report/src/apiMethods/index.html +0 -266
- package/coverage/lcov-report/src/apiMethods/instanceMethods.ts.html +0 -160
- package/coverage/lcov-report/src/apiMethods/instanceUserMethods.ts.html +0 -268
- package/coverage/lcov-report/src/apiMethods/modelMethods.ts.html +0 -352
- package/coverage/lcov-report/src/apiMethods/pageMethods.ts.html +0 -1276
- package/coverage/lcov-report/src/apiMethods/serverUserMethods.ts.html +0 -196
- package/coverage/lcov-report/src/apiMethods/webhookMethods.ts.html +0 -271
- package/coverage/lcov-report/src/enums/batchItemType.ts.html +0 -106
- package/coverage/lcov-report/src/enums/batchOperationType.ts.html +0 -142
- package/coverage/lcov-report/src/enums/batchState..ts.html +0 -106
- package/coverage/lcov-report/src/enums/index.html +0 -161
- package/coverage/lcov-report/src/enums/workflowOperationType.ts.html +0 -175
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/src/models/assetContainer.ts.html +0 -106
- package/coverage/lcov-report/src/models/assetGalleries.ts.html +0 -103
- package/coverage/lcov-report/src/models/assetMediaGrouping.ts.html +0 -136
- package/coverage/lcov-report/src/models/assetMediaGroupingMetaData.ts.html +0 -97
- package/coverage/lcov-report/src/models/batch.ts.html +0 -178
- package/coverage/lcov-report/src/models/batchItem.ts.html +0 -127
- package/coverage/lcov-report/src/models/container.ts.html +0 -232
- package/coverage/lcov-report/src/models/contentDefinitionTypeID.ts.html +0 -142
- package/coverage/lcov-report/src/models/contentItem.ts.html +0 -202
- package/coverage/lcov-report/src/models/contentSectionDefaultModule.ts.html +0 -106
- package/coverage/lcov-report/src/models/contentSectionDefinition.ts.html +0 -196
- package/coverage/lcov-report/src/models/contentViewColumn.ts.html +0 -109
- package/coverage/lcov-report/src/models/exception.ts.html +0 -109
- package/coverage/lcov-report/src/models/index.html +0 -476
- package/coverage/lcov-report/src/models/instanceRole.ts.html +0 -106
- package/coverage/lcov-report/src/models/instanceUser.ts.html +0 -130
- package/coverage/lcov-report/src/models/locales.ts.html +0 -100
- package/coverage/lcov-report/src/models/media.ts.html +0 -178
- package/coverage/lcov-report/src/models/model.ts.html +0 -172
- package/coverage/lcov-report/src/models/notification.ts.html +0 -124
- package/coverage/lcov-report/src/models/options.ts.html +0 -109
- package/coverage/lcov-report/src/models/pageItem.ts.html +0 -268
- package/coverage/lcov-report/src/models/pageModel.ts.html +0 -130
- package/coverage/lcov-report/src/models/sharedModule.ts.html +0 -106
- package/coverage/lcov-report/src/models/sitemap.ts.html +0 -148
- package/coverage/lcov-report/src/models/websiteUser.ts.html +0 -157
- package/coverage/lcov.info +0 -1459
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -210
- package/coverage/src/apiClient.ts.html +0 -199
- package/coverage/src/apiMethods/assetMethods.ts.html +0 -682
- package/coverage/src/apiMethods/batchMethods.ts.html +0 -736
- package/coverage/src/apiMethods/clientInstance.ts.html +0 -403
- package/coverage/src/apiMethods/containerMethods.ts.html +0 -460
- package/coverage/src/apiMethods/contentMethods.ts.html +0 -1183
- package/coverage/src/apiMethods/index.html +0 -266
- package/coverage/src/apiMethods/instanceMethods.ts.html +0 -160
- package/coverage/src/apiMethods/instanceUserMethods.ts.html +0 -268
- package/coverage/src/apiMethods/modelMethods.ts.html +0 -352
- package/coverage/src/apiMethods/pageMethods.ts.html +0 -1276
- package/coverage/src/apiMethods/serverUserMethods.ts.html +0 -196
- package/coverage/src/apiMethods/webhookMethods.ts.html +0 -271
- package/coverage/src/enums/batchItemType.ts.html +0 -106
- package/coverage/src/enums/batchOperationType.ts.html +0 -142
- package/coverage/src/enums/batchState..ts.html +0 -106
- package/coverage/src/enums/index.html +0 -161
- package/coverage/src/enums/workflowOperationType.ts.html +0 -175
- package/coverage/src/index.html +0 -116
- package/coverage/src/models/assetContainer.ts.html +0 -106
- package/coverage/src/models/assetGalleries.ts.html +0 -103
- package/coverage/src/models/assetMediaGrouping.ts.html +0 -136
- package/coverage/src/models/assetMediaGroupingMetaData.ts.html +0 -97
- package/coverage/src/models/batch.ts.html +0 -178
- package/coverage/src/models/batchItem.ts.html +0 -127
- package/coverage/src/models/container.ts.html +0 -232
- package/coverage/src/models/contentDefinitionTypeID.ts.html +0 -142
- package/coverage/src/models/contentItem.ts.html +0 -202
- package/coverage/src/models/contentSectionDefaultModule.ts.html +0 -106
- package/coverage/src/models/contentSectionDefinition.ts.html +0 -196
- package/coverage/src/models/contentViewColumn.ts.html +0 -109
- package/coverage/src/models/exception.ts.html +0 -109
- package/coverage/src/models/index.html +0 -476
- package/coverage/src/models/instanceRole.ts.html +0 -106
- package/coverage/src/models/instanceUser.ts.html +0 -130
- package/coverage/src/models/locales.ts.html +0 -100
- package/coverage/src/models/media.ts.html +0 -178
- package/coverage/src/models/model.ts.html +0 -172
- package/coverage/src/models/notification.ts.html +0 -124
- package/coverage/src/models/options.ts.html +0 -109
- package/coverage/src/models/pageItem.ts.html +0 -268
- package/coverage/src/models/pageModel.ts.html +0 -130
- package/coverage/src/models/sharedModule.ts.html +0 -106
- package/coverage/src/models/sitemap.ts.html +0 -148
- package/coverage/src/models/websiteUser.ts.html +0 -157
- package/dist/.tsbuildinfo +0 -1
- package/dist/apiClient.d.ts.map +0 -1
- package/dist/apiClient.js.map +0 -1
- package/dist/apiMethods/assetMethods.d.ts.map +0 -1
- package/dist/apiMethods/assetMethods.js.map +0 -1
- package/dist/apiMethods/batchMethods.d.ts.map +0 -1
- package/dist/apiMethods/batchMethods.js.map +0 -1
- package/dist/apiMethods/clientInstance.d.ts.map +0 -1
- package/dist/apiMethods/clientInstance.js.map +0 -1
- package/dist/apiMethods/containerMethods.d.ts.map +0 -1
- package/dist/apiMethods/containerMethods.js.map +0 -1
- package/dist/apiMethods/contentMethods.d.ts.map +0 -1
- package/dist/apiMethods/contentMethods.js.map +0 -1
- package/dist/apiMethods/instanceMethods.d.ts.map +0 -1
- package/dist/apiMethods/instanceMethods.js.map +0 -1
- package/dist/apiMethods/instanceUserMethods.d.ts.map +0 -1
- package/dist/apiMethods/instanceUserMethods.js.map +0 -1
- package/dist/apiMethods/modelMethods.d.ts.map +0 -1
- package/dist/apiMethods/modelMethods.js.map +0 -1
- package/dist/apiMethods/pageMethods.d.ts.map +0 -1
- package/dist/apiMethods/pageMethods.js.map +0 -1
- package/dist/apiMethods/serverUserMethods.d.ts.map +0 -1
- package/dist/apiMethods/serverUserMethods.js.map +0 -1
- package/dist/apiMethods/webhookMethods.d.ts.map +0 -1
- package/dist/apiMethods/webhookMethods.js.map +0 -1
- package/dist/enums/assetGroupingType.d.ts.map +0 -1
- package/dist/enums/assetGroupingType.js.map +0 -1
- package/dist/enums/batchItemType.d.ts.map +0 -1
- package/dist/enums/batchItemType.js.map +0 -1
- package/dist/enums/batchOperationType.d.ts.map +0 -1
- package/dist/enums/batchOperationType.js.map +0 -1
- package/dist/enums/batchState..d.ts.map +0 -1
- package/dist/enums/batchState..js.map +0 -1
- package/dist/enums/pageItemTemplateType.d.ts.map +0 -1
- package/dist/enums/pageItemTemplateType.js.map +0 -1
- package/dist/enums/workflowOperationType.d.ts.map +0 -1
- package/dist/enums/workflowOperationType.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/models/assetContainer.d.ts.map +0 -1
- package/dist/models/assetContainer.js.map +0 -1
- package/dist/models/assetGalleries.d.ts.map +0 -1
- package/dist/models/assetGalleries.js.map +0 -1
- package/dist/models/assetMediaGrouping.d.ts.map +0 -1
- package/dist/models/assetMediaGrouping.js.map +0 -1
- package/dist/models/assetMediaGroupingMetaData.d.ts.map +0 -1
- package/dist/models/assetMediaGroupingMetaData.js.map +0 -1
- package/dist/models/batch.d.ts.map +0 -1
- package/dist/models/batch.js.map +0 -1
- package/dist/models/batchItem.d.ts.map +0 -1
- package/dist/models/batchItem.js.map +0 -1
- package/dist/models/batchTypes.d.ts.map +0 -1
- package/dist/models/batchTypes.js.map +0 -1
- package/dist/models/container.d.ts.map +0 -1
- package/dist/models/container.js.map +0 -1
- package/dist/models/contentDefinitionTypeID.d.ts.map +0 -1
- package/dist/models/contentDefinitionTypeID.js.map +0 -1
- package/dist/models/contentItem.d.ts.map +0 -1
- package/dist/models/contentItem.js.map +0 -1
- package/dist/models/contentItemHistory.d.ts.map +0 -1
- package/dist/models/contentItemHistory.js.map +0 -1
- package/dist/models/contentListFilterModel.d.ts.map +0 -1
- package/dist/models/contentListFilterModel.js.map +0 -1
- package/dist/models/contentSectionDefaultModule.d.ts.map +0 -1
- package/dist/models/contentSectionDefaultModule.js.map +0 -1
- package/dist/models/contentSectionDefinition.d.ts.map +0 -1
- package/dist/models/contentSectionDefinition.js.map +0 -1
- package/dist/models/contentViewColumn.d.ts.map +0 -1
- package/dist/models/contentViewColumn.js.map +0 -1
- package/dist/models/exception.d.ts.map +0 -1
- package/dist/models/exception.js.map +0 -1
- package/dist/models/instanceRole.d.ts.map +0 -1
- package/dist/models/instanceRole.js.map +0 -1
- package/dist/models/instanceUser.d.ts.map +0 -1
- package/dist/models/instanceUser.js.map +0 -1
- package/dist/models/itemComments.d.ts.map +0 -1
- package/dist/models/itemComments.js.map +0 -1
- package/dist/models/listParams.d.ts.map +0 -1
- package/dist/models/listParams.js.map +0 -1
- package/dist/models/locales.d.ts.map +0 -1
- package/dist/models/locales.js.map +0 -1
- package/dist/models/media.d.ts.map +0 -1
- package/dist/models/media.js.map +0 -1
- package/dist/models/model.d.ts.map +0 -1
- package/dist/models/model.js.map +0 -1
- package/dist/models/notification.d.ts.map +0 -1
- package/dist/models/notification.js.map +0 -1
- package/dist/models/options.d.ts.map +0 -1
- package/dist/models/options.js.map +0 -1
- package/dist/models/pageHistory.d.ts.map +0 -1
- package/dist/models/pageHistory.js.map +0 -1
- package/dist/models/pageItem.d.ts.map +0 -1
- package/dist/models/pageItem.js.map +0 -1
- package/dist/models/pageModel.d.ts.map +0 -1
- package/dist/models/pageModel.js.map +0 -1
- package/dist/models/serverUser.d.ts.map +0 -1
- package/dist/models/serverUser.js.map +0 -1
- package/dist/models/sharedModule.d.ts.map +0 -1
- package/dist/models/sharedModule.js.map +0 -1
- package/dist/models/sitemap.d.ts.map +0 -1
- package/dist/models/sitemap.js.map +0 -1
- package/dist/models/webhook.d.ts.map +0 -1
- package/dist/models/webhook.js.map +0 -1
- package/dist/models/websiteListing.d.ts.map +0 -1
- package/dist/models/websiteListing.js.map +0 -1
- package/dist/models/websiteUser.d.ts.map +0 -1
- package/dist/models/websiteUser.js.map +0 -1
package/.cursor/manifest.md
DELETED
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
# Agility CMS Management SDK - Authentication Component
|
|
2
|
-
|
|
3
|
-
## Overview
|
|
4
|
-
Transform the current authentication UI into a reusable, highly configurable React component that can be embedded in any application. The component should support multiple display modes and extensive customization options.
|
|
5
|
-
|
|
6
|
-
## Feature Requirements
|
|
7
|
-
|
|
8
|
-
### Core Functionality
|
|
9
|
-
- **Authentication Flow**: OAuth popup-based authentication with token persistence
|
|
10
|
-
- **Display Modes**:
|
|
11
|
-
- Full-screen overlay mode
|
|
12
|
-
- Compact footer bar mode
|
|
13
|
-
- Button-only mode
|
|
14
|
-
- **Callback System**: Extensive hooks for user interaction
|
|
15
|
-
- **Styling**: Fully customizable appearance
|
|
16
|
-
- **State Management**: Clean separation of UI and business logic
|
|
17
|
-
|
|
18
|
-
### Configuration Interface
|
|
19
|
-
```typescript
|
|
20
|
-
interface AgilityAuthConfig {
|
|
21
|
-
// Callbacks
|
|
22
|
-
onSignIn?: (user: ServerUser) => void;
|
|
23
|
-
onSignOut?: () => void;
|
|
24
|
-
onButtonClick?: () => void;
|
|
25
|
-
onWebsiteSelect?: (website: WebsiteAccess) => void;
|
|
26
|
-
onLocaleSelect?: (locale: LocaleInfo) => void;
|
|
27
|
-
|
|
28
|
-
// Appearance
|
|
29
|
-
title?: string;
|
|
30
|
-
titleClasses?: string;
|
|
31
|
-
backgroundClasses?: string;
|
|
32
|
-
buttonClass?: string;
|
|
33
|
-
buttonText?: string;
|
|
34
|
-
|
|
35
|
-
// Behavior
|
|
36
|
-
showCurrentSelection?: boolean;
|
|
37
|
-
mode?: 'fullscreen' | 'footer' | 'button-only';
|
|
38
|
-
|
|
39
|
-
// OAuth Settings
|
|
40
|
-
redirectUri?: string;
|
|
41
|
-
scope?: string;
|
|
42
|
-
region?: string;
|
|
43
|
-
}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
## Architecture Plan
|
|
47
|
-
|
|
48
|
-
### Phase 1: Foundation & Models (Parallel)
|
|
49
|
-
**Duration**: 1-2 days
|
|
50
|
-
**Dependencies**: None
|
|
51
|
-
|
|
52
|
-
#### Task 1.1: Type Definitions
|
|
53
|
-
- Create comprehensive TypeScript interfaces
|
|
54
|
-
- Define component props and configuration types
|
|
55
|
-
- Export all types from main SDK index
|
|
56
|
-
|
|
57
|
-
**Files to Create:**
|
|
58
|
-
- `src/models/authComponent.ts` - Main component interfaces
|
|
59
|
-
- `src/models/authConfig.ts` - Configuration types
|
|
60
|
-
- `src/models/authState.ts` - State management types
|
|
61
|
-
|
|
62
|
-
#### Task 1.2: Core Component Structure
|
|
63
|
-
- Set up base component directory structure
|
|
64
|
-
- Create component export system
|
|
65
|
-
- Establish styling approach (CSS modules vs styled-components)
|
|
66
|
-
|
|
67
|
-
**Files to Create:**
|
|
68
|
-
- `src/components/auth/index.ts` - Main export
|
|
69
|
-
- `src/components/auth/AgilityAuth.tsx` - Root component
|
|
70
|
-
- `src/components/auth/styles/` - Styling directory
|
|
71
|
-
|
|
72
|
-
### Phase 2: Authentication Logic (Parallel with Phase 1.2)
|
|
73
|
-
**Duration**: 1-2 days
|
|
74
|
-
**Dependencies**: Phase 1.1 (Type Definitions)
|
|
75
|
-
|
|
76
|
-
#### Task 2.1: Auth Hook
|
|
77
|
-
- Extract authentication logic into custom hook
|
|
78
|
-
- Manage authentication state
|
|
79
|
-
- Handle OAuth flow and token management
|
|
80
|
-
|
|
81
|
-
**Files to Create:**
|
|
82
|
-
- `src/components/auth/hooks/useAgilityAuth.ts`
|
|
83
|
-
- `src/components/auth/hooks/useWebsiteSelection.ts`
|
|
84
|
-
|
|
85
|
-
#### Task 2.2: State Management
|
|
86
|
-
- Create context for sharing auth state
|
|
87
|
-
- Implement reducer for complex state updates
|
|
88
|
-
- Handle loading states and errors
|
|
89
|
-
|
|
90
|
-
**Files to Create:**
|
|
91
|
-
- `src/components/auth/context/AuthContext.tsx`
|
|
92
|
-
- `src/components/auth/context/AuthProvider.tsx`
|
|
93
|
-
|
|
94
|
-
### Phase 3: UI Components (Depends on Phase 1 & 2)
|
|
95
|
-
**Duration**: 2-3 days
|
|
96
|
-
**Dependencies**: Phase 1.2, Phase 2.1
|
|
97
|
-
|
|
98
|
-
#### Task 3.1: Core UI Components
|
|
99
|
-
- Authentication button component
|
|
100
|
-
- User info display component
|
|
101
|
-
- Website/locale selection dropdowns
|
|
102
|
-
- Loading and error states
|
|
103
|
-
|
|
104
|
-
**Files to Create:**
|
|
105
|
-
- `src/components/auth/components/AuthButton.tsx`
|
|
106
|
-
- `src/components/auth/components/UserInfo.tsx`
|
|
107
|
-
- `src/components/auth/components/WebsiteSelector.tsx`
|
|
108
|
-
- `src/components/auth/components/LocaleSelector.tsx`
|
|
109
|
-
- `src/components/auth/components/LoadingSpinner.tsx`
|
|
110
|
-
- `src/components/auth/components/ErrorDisplay.tsx`
|
|
111
|
-
|
|
112
|
-
#### Task 3.2: Layout Components
|
|
113
|
-
- Full-screen modal layout
|
|
114
|
-
- Footer bar layout
|
|
115
|
-
- Button-only layout
|
|
116
|
-
- Selection summary component
|
|
117
|
-
|
|
118
|
-
**Files to Create:**
|
|
119
|
-
- `src/components/auth/layouts/FullscreenLayout.tsx`
|
|
120
|
-
- `src/components/auth/layouts/FooterLayout.tsx`
|
|
121
|
-
- `src/components/auth/layouts/ButtonLayout.tsx`
|
|
122
|
-
- `src/components/auth/components/SelectionSummary.tsx`
|
|
123
|
-
|
|
124
|
-
### Phase 4: Styling & Theming (Parallel with Phase 3)
|
|
125
|
-
**Duration**: 1-2 days
|
|
126
|
-
**Dependencies**: Phase 1.2
|
|
127
|
-
|
|
128
|
-
#### Task 4.1: Base Styles
|
|
129
|
-
- Create CSS module system
|
|
130
|
-
- Define CSS custom properties for theming
|
|
131
|
-
- Responsive design implementation
|
|
132
|
-
|
|
133
|
-
**Files to Create:**
|
|
134
|
-
- `src/components/auth/styles/base.module.css`
|
|
135
|
-
- `src/components/auth/styles/themes.module.css`
|
|
136
|
-
- `src/components/auth/styles/layouts.module.css`
|
|
137
|
-
- `src/components/auth/styles/components.module.css`
|
|
138
|
-
|
|
139
|
-
#### Task 4.2: Animation System
|
|
140
|
-
- Framer Motion integration
|
|
141
|
-
- Smooth transitions between modes
|
|
142
|
-
- Loading animations
|
|
143
|
-
|
|
144
|
-
**Files to Create:**
|
|
145
|
-
- `src/components/auth/animations/transitions.ts`
|
|
146
|
-
- `src/components/auth/animations/variants.ts`
|
|
147
|
-
|
|
148
|
-
### Phase 5: Integration & Testing (Depends on Phases 3 & 4)
|
|
149
|
-
**Duration**: 1-2 days
|
|
150
|
-
**Dependencies**: Phase 3.1, Phase 3.2, Phase 4.1
|
|
151
|
-
|
|
152
|
-
#### Task 5.1: Component Integration
|
|
153
|
-
- Integrate all components into main AgilityAuth component
|
|
154
|
-
- Implement mode switching logic
|
|
155
|
-
- Handle configuration prop passing
|
|
156
|
-
|
|
157
|
-
#### Task 5.2: SDK Integration
|
|
158
|
-
- Export component from main SDK
|
|
159
|
-
- Update package.json with React peer dependencies
|
|
160
|
-
- Create usage documentation
|
|
161
|
-
|
|
162
|
-
**Files to Create:**
|
|
163
|
-
- `src/components/auth/AgilityAuth.tsx` (complete implementation)
|
|
164
|
-
- `docs/auth-component.md`
|
|
165
|
-
|
|
166
|
-
### Phase 6: Advanced Features (Optional)
|
|
167
|
-
**Duration**: 1-2 days
|
|
168
|
-
**Dependencies**: Phase 5
|
|
169
|
-
|
|
170
|
-
#### Task 6.1: Advanced Customization
|
|
171
|
-
- Custom render props support
|
|
172
|
-
- Slot-based customization
|
|
173
|
-
- Advanced theming system
|
|
174
|
-
|
|
175
|
-
#### Task 6.2: Accessibility & Performance
|
|
176
|
-
- ARIA labels and keyboard navigation
|
|
177
|
-
- Performance optimizations
|
|
178
|
-
- Bundle size optimization
|
|
179
|
-
|
|
180
|
-
## File Structure
|
|
181
|
-
```
|
|
182
|
-
src/
|
|
183
|
-
├── components/
|
|
184
|
-
│ └── auth/
|
|
185
|
-
│ ├── index.ts # Main export
|
|
186
|
-
│ ├── AgilityAuth.tsx # Root component (~100 lines)
|
|
187
|
-
│ ├── components/
|
|
188
|
-
│ │ ├── AuthButton.tsx # ~80 lines
|
|
189
|
-
│ │ ├── UserInfo.tsx # ~60 lines
|
|
190
|
-
│ │ ├── WebsiteSelector.tsx # ~90 lines
|
|
191
|
-
│ │ ├── LocaleSelector.tsx # ~80 lines
|
|
192
|
-
│ │ ├── LoadingSpinner.tsx # ~40 lines
|
|
193
|
-
│ │ ├── ErrorDisplay.tsx # ~50 lines
|
|
194
|
-
│ │ └── SelectionSummary.tsx # ~70 lines
|
|
195
|
-
│ ├── layouts/
|
|
196
|
-
│ │ ├── FullscreenLayout.tsx # ~90 lines
|
|
197
|
-
│ │ ├── FooterLayout.tsx # ~80 lines
|
|
198
|
-
│ │ └── ButtonLayout.tsx # ~40 lines
|
|
199
|
-
│ ├── hooks/
|
|
200
|
-
│ │ ├── useAgilityAuth.ts # ~100 lines
|
|
201
|
-
│ │ └── useWebsiteSelection.ts # ~80 lines
|
|
202
|
-
│ ├── context/
|
|
203
|
-
│ │ ├── AuthContext.tsx # ~60 lines
|
|
204
|
-
│ │ └── AuthProvider.tsx # ~90 lines
|
|
205
|
-
│ ├── styles/
|
|
206
|
-
│ │ ├── base.module.css
|
|
207
|
-
│ │ ├── themes.module.css
|
|
208
|
-
│ │ ├── layouts.module.css
|
|
209
|
-
│ │ └── components.module.css
|
|
210
|
-
│ └── animations/
|
|
211
|
-
│ ├── transitions.ts # ~50 lines
|
|
212
|
-
│ └── variants.ts # ~40 lines
|
|
213
|
-
├── models/
|
|
214
|
-
│ ├── authComponent.ts # Component interfaces
|
|
215
|
-
│ ├── authConfig.ts # Configuration types
|
|
216
|
-
│ └── authState.ts # State types
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
## Dependencies
|
|
220
|
-
- React 16.8+ (hooks support)
|
|
221
|
-
- Framer Motion (animations)
|
|
222
|
-
- Existing SDK authentication methods
|
|
223
|
-
|
|
224
|
-
## Success Criteria
|
|
225
|
-
1. **Modularity**: Each component < 100 lines, single responsibility
|
|
226
|
-
2. **Configurability**: Extensive customization without code changes
|
|
227
|
-
3. **Performance**: Fast loading, minimal bundle impact
|
|
228
|
-
4. **Accessibility**: WCAG 2.1 AA compliance
|
|
229
|
-
5. **Developer Experience**: Intuitive API, comprehensive TypeScript support
|
|
230
|
-
6. **Visual Polish**: Smooth animations, responsive design
|
|
231
|
-
|
|
232
|
-
## Migration Path
|
|
233
|
-
1. Existing apps can gradually adopt the component
|
|
234
|
-
2. Backward compatibility with existing auth methods
|
|
235
|
-
3. Progressive enhancement approach
|
|
236
|
-
4. Clear migration documentation
|
|
237
|
-
|
|
238
|
-
## Next Steps
|
|
239
|
-
1. Start with Phase 1 (Foundation & Models)
|
|
240
|
-
2. Create type definitions and basic structure
|
|
241
|
-
3. Implement authentication hook (Phase 2.1)
|
|
242
|
-
4. Build core UI components (Phase 3.1)
|
|
243
|
-
5. Iterate and refine based on feedback
|
package/.cursor/mocks.md
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
# Mock Test Suite Progress Tracker
|
|
2
|
-
|
|
3
|
-
## 🎯 Goal: Complete Unit Test Coverage for All SDK Components
|
|
4
|
-
|
|
5
|
-
### ✅ **COMPLETED (100% Passing)**
|
|
6
|
-
- **ModelMethods** (16/16 tests) ✅
|
|
7
|
-
- **AssetMethods** (24/24 tests) ✅
|
|
8
|
-
- **ContainerMethods** (16/16 tests) ✅
|
|
9
|
-
- **WebhookMethods** (14/14 tests) ✅
|
|
10
|
-
|
|
11
|
-
### 🎉 **MISSION ACCOMPLISHED: 103/103 TOTAL TESTS PASSING (100%)**
|
|
12
|
-
|
|
13
|
-
**📊 Complete Test Coverage:**
|
|
14
|
-
- **Unit Tests**: 70/70 passing (4 suites)
|
|
15
|
-
- **Integration Tests**: 33/33 passing (5 suites)
|
|
16
|
-
- **Total**: 103/103 passing (9 suites)
|
|
17
|
-
|
|
18
|
-
### 📋 **PENDING**
|
|
19
|
-
- **ContentMethods** - Complex (requires locale params, method signature fixes)
|
|
20
|
-
- **PageMethods** - Complex (requires locale params, missing methods)
|
|
21
|
-
- **BatchMethods** - Simple (should be quick)
|
|
22
|
-
|
|
23
|
-
### 📝 **ANALYSIS & FIXES NEEDED**
|
|
24
|
-
|
|
25
|
-
#### WebhookMethods (Currently Working)
|
|
26
|
-
- ✅ Apply mockedAxiosInstance pattern
|
|
27
|
-
- ⏳ Fix method signatures and URL patterns
|
|
28
|
-
- ⏳ Test and validate
|
|
29
|
-
|
|
30
|
-
#### ContentMethods (Major Rework Needed)
|
|
31
|
-
**Issues Found:**
|
|
32
|
-
- ❌ Missing `locale` parameter in most method calls
|
|
33
|
-
- ❌ Methods like `deleteContentItem` don't exist (should be `deleteContent`)
|
|
34
|
-
- ❌ Wrong method signatures: `publishContentItem` → `publishContent`
|
|
35
|
-
- ❌ Error message mismatches
|
|
36
|
-
- ❌ Complex batch operations with async polling
|
|
37
|
-
|
|
38
|
-
**Required Fixes:**
|
|
39
|
-
- [ ] Update all method calls to include `locale` parameter
|
|
40
|
-
- [ ] Fix method names to match actual SDK
|
|
41
|
-
- [ ] Update error message expectations
|
|
42
|
-
- [ ] Mock batch operations properly
|
|
43
|
-
|
|
44
|
-
#### PageMethods (Major Rework Needed)
|
|
45
|
-
**Issues Found:**
|
|
46
|
-
- ❌ Missing `locale` parameter in most method calls
|
|
47
|
-
- ❌ Method `getPageList` doesn't exist
|
|
48
|
-
- ❌ URL patterns include `undefined/` prefix (missing locale)
|
|
49
|
-
- ❌ Methods like `unpublishPage`, `requestApprovalPage` don't exist
|
|
50
|
-
- ❌ Error message format mismatches
|
|
51
|
-
|
|
52
|
-
**Required Fixes:**
|
|
53
|
-
- [ ] Add `locale` parameter to all method calls
|
|
54
|
-
- [ ] Remove non-existent methods from tests
|
|
55
|
-
- [ ] Fix URL pattern expectations
|
|
56
|
-
- [ ] Update error message expectations
|
|
57
|
-
|
|
58
|
-
#### BatchMethods (Should Be Simple)
|
|
59
|
-
**Expected Issues:**
|
|
60
|
-
- ⚠️ Likely just needs axios mock pattern applied
|
|
61
|
-
- ⚠️ Possible method signature fixes
|
|
62
|
-
|
|
63
|
-
### 🛠️ **PROVEN PATTERN (Use for All)**
|
|
64
|
-
|
|
65
|
-
```typescript
|
|
66
|
-
// Mock axios.create to return our controlled instance
|
|
67
|
-
const mockedAxiosInstance = {
|
|
68
|
-
get: jest.fn(),
|
|
69
|
-
post: jest.fn(),
|
|
70
|
-
put: jest.fn(),
|
|
71
|
-
delete: jest.fn(),
|
|
72
|
-
defaults: { headers: { common: {} } }
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
jest.mock('axios', () => ({
|
|
76
|
-
create: jest.fn(() => mockedAxiosInstance)
|
|
77
|
-
}));
|
|
78
|
-
|
|
79
|
-
beforeEach(() => {
|
|
80
|
-
jest.clearAllMocks();
|
|
81
|
-
mockedAxiosInstance.get.mockClear();
|
|
82
|
-
mockedAxiosInstance.post.mockClear();
|
|
83
|
-
mockedAxiosInstance.put.mockClear();
|
|
84
|
-
mockedAxiosInstance.delete.mockClear();
|
|
85
|
-
});
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### 📊 **CURRENT STATUS**
|
|
89
|
-
- **Working Tests**: 3 components (56 tests passing)
|
|
90
|
-
- **Target**: 6-7 components (estimated 100+ tests)
|
|
91
|
-
- **Next Goal**: Get WebhookMethods to 100% → BatchMethods → ContentMethods → PageMethods
|
|
92
|
-
|
|
93
|
-
### 🎯 **IMMEDIATE TASKS**
|
|
94
|
-
1. ✅ Finish WebhookMethods (in progress)
|
|
95
|
-
2. 📋 Apply pattern to BatchMethods
|
|
96
|
-
3. 📋 Tackle ContentMethods method signature issues
|
|
97
|
-
4. 📋 Tackle PageMethods method signature issues
|
|
98
|
-
|
|
99
|
-
---
|
|
100
|
-
*Last Updated: Working on WebhookMethods*
|