@bernierllc/content-storage-adapter 1.2.5 → 1.4.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/dist/ContentBatchOperations.js +1 -0
- package/dist/ContentBatchOperations.js.map +1 -1
- package/dist/ContentStorageAdapter.js +1 -0
- package/dist/ContentStorageAdapter.js.map +1 -1
- package/dist/errors/ContentStorageAdapterError.d.ts +12 -0
- package/dist/errors/ContentStorageAdapterError.d.ts.map +1 -0
- package/dist/errors/ContentStorageAdapterError.js +25 -0
- package/dist/errors/ContentStorageAdapterError.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +8 -3
- package/.eslintrc.json +0 -22
- package/CHANGELOG.md +0 -101
- package/__tests__/ContentBatchOperations.test.ts +0 -130
- package/__tests__/ContentStorageAdapter.test.ts +0 -604
- package/__tests__/mocks/MockDatabaseAdapter.test.ts +0 -97
- package/__tests__/mocks/MockDatabaseAdapter.ts +0 -85
- package/jest.config.cjs +0 -30
- package/src/ContentBatchOperations.ts +0 -72
- package/src/ContentStorageAdapter.ts +0 -476
- package/src/errors/ContentNotFoundError.ts +0 -17
- package/src/errors/DuplicateSlugError.ts +0 -17
- package/src/errors/OptimisticLockError.ts +0 -17
- package/src/index.ts +0 -33
- package/src/models/IContent.ts +0 -122
- package/src/models/IContentFilters.ts +0 -38
- package/src/models/IContentVersion.ts +0 -22
- package/tsconfig.json +0 -26
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (c) 2025 Bernier LLC
|
|
3
|
-
|
|
4
|
-
This file is licensed to the client under a limited-use license.
|
|
5
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Error thrown when optimistic locking fails
|
|
11
|
-
*/
|
|
12
|
-
export class OptimisticLockError extends Error {
|
|
13
|
-
constructor(id: string) {
|
|
14
|
-
super(`Optimistic lock failed for content ${id}: Content was modified by another user`);
|
|
15
|
-
this.name = 'OptimisticLockError';
|
|
16
|
-
}
|
|
17
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (c) 2025 Bernier LLC
|
|
3
|
-
|
|
4
|
-
This file is licensed to the client under a limited-use license.
|
|
5
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
// Main classes
|
|
10
|
-
export { ContentStorageAdapter } from './ContentStorageAdapter';
|
|
11
|
-
export { ContentBatchOperations } from './ContentBatchOperations';
|
|
12
|
-
|
|
13
|
-
// Models
|
|
14
|
-
export type {
|
|
15
|
-
IContent,
|
|
16
|
-
IContentCreateData,
|
|
17
|
-
IContentUpdateData
|
|
18
|
-
} from './models/IContent';
|
|
19
|
-
export {
|
|
20
|
-
ContentType,
|
|
21
|
-
ContentFormat,
|
|
22
|
-
ContentStatus
|
|
23
|
-
} from './models/IContent';
|
|
24
|
-
export type { IContentVersion } from './models/IContentVersion';
|
|
25
|
-
export type {
|
|
26
|
-
IContentFilters,
|
|
27
|
-
IPaginatedResult
|
|
28
|
-
} from './models/IContentFilters';
|
|
29
|
-
|
|
30
|
-
// Errors
|
|
31
|
-
export { ContentNotFoundError } from './errors/ContentNotFoundError';
|
|
32
|
-
export { OptimisticLockError } from './errors/OptimisticLockError';
|
|
33
|
-
export { DuplicateSlugError } from './errors/DuplicateSlugError';
|
package/src/models/IContent.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (c) 2025 Bernier LLC
|
|
3
|
-
|
|
4
|
-
This file is licensed to the client under a limited-use license.
|
|
5
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Content type enum
|
|
11
|
-
*/
|
|
12
|
-
export enum ContentType {
|
|
13
|
-
BLOG = 'blog',
|
|
14
|
-
ARTICLE = 'article',
|
|
15
|
-
PAGE = 'page',
|
|
16
|
-
SOCIAL = 'social'
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Content format enum
|
|
21
|
-
*/
|
|
22
|
-
export enum ContentFormat {
|
|
23
|
-
MARKDOWN = 'markdown',
|
|
24
|
-
HTML = 'html',
|
|
25
|
-
PLAINTEXT = 'plaintext'
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Content status enum
|
|
30
|
-
*/
|
|
31
|
-
export enum ContentStatus {
|
|
32
|
-
DRAFT = 'draft',
|
|
33
|
-
IN_REVIEW = 'in_review',
|
|
34
|
-
APPROVED = 'approved',
|
|
35
|
-
SCHEDULED = 'scheduled',
|
|
36
|
-
PUBLISHED = 'published',
|
|
37
|
-
ARCHIVED = 'archived'
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Core content model
|
|
42
|
-
*/
|
|
43
|
-
export interface IContent {
|
|
44
|
-
id: string;
|
|
45
|
-
userId: string;
|
|
46
|
-
|
|
47
|
-
// Content fields
|
|
48
|
-
title: string;
|
|
49
|
-
slug: string;
|
|
50
|
-
body: string;
|
|
51
|
-
excerpt?: string;
|
|
52
|
-
|
|
53
|
-
// Metadata
|
|
54
|
-
type: ContentType;
|
|
55
|
-
format: ContentFormat;
|
|
56
|
-
status: ContentStatus;
|
|
57
|
-
|
|
58
|
-
// Workflow
|
|
59
|
-
workflowStage?: string;
|
|
60
|
-
assignedTo?: string;
|
|
61
|
-
|
|
62
|
-
// AI review
|
|
63
|
-
aiReviewed: boolean;
|
|
64
|
-
aiReviewScore?: number;
|
|
65
|
-
aiProvider?: string;
|
|
66
|
-
|
|
67
|
-
// Publishing
|
|
68
|
-
publishedAt?: Date;
|
|
69
|
-
scheduledFor?: Date;
|
|
70
|
-
deletedAt?: Date;
|
|
71
|
-
|
|
72
|
-
// SEO
|
|
73
|
-
metaTitle?: string;
|
|
74
|
-
metaDescription?: string;
|
|
75
|
-
keywords?: string[];
|
|
76
|
-
|
|
77
|
-
// Analytics
|
|
78
|
-
viewCount: number;
|
|
79
|
-
shareCount: number;
|
|
80
|
-
|
|
81
|
-
// Source tracking (for commit workflow)
|
|
82
|
-
generatedFromCommit: boolean;
|
|
83
|
-
sourceCommitSha?: string;
|
|
84
|
-
sourceRepository?: string;
|
|
85
|
-
|
|
86
|
-
// Timestamps
|
|
87
|
-
createdAt: Date;
|
|
88
|
-
updatedAt: Date;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Content creation data
|
|
93
|
-
*/
|
|
94
|
-
export interface IContentCreateData {
|
|
95
|
-
userId: string;
|
|
96
|
-
title: string;
|
|
97
|
-
body: string;
|
|
98
|
-
excerpt?: string;
|
|
99
|
-
type?: ContentType;
|
|
100
|
-
format?: ContentFormat;
|
|
101
|
-
status?: ContentStatus;
|
|
102
|
-
metaTitle?: string;
|
|
103
|
-
metaDescription?: string;
|
|
104
|
-
keywords?: string[];
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Content update data
|
|
109
|
-
*/
|
|
110
|
-
export interface IContentUpdateData {
|
|
111
|
-
title?: string;
|
|
112
|
-
body?: string;
|
|
113
|
-
excerpt?: string;
|
|
114
|
-
status?: ContentStatus;
|
|
115
|
-
workflowStage?: string;
|
|
116
|
-
assignedTo?: string;
|
|
117
|
-
publishedAt?: Date;
|
|
118
|
-
scheduledFor?: Date;
|
|
119
|
-
metaTitle?: string;
|
|
120
|
-
metaDescription?: string;
|
|
121
|
-
keywords?: string[];
|
|
122
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (c) 2025 Bernier LLC
|
|
3
|
-
|
|
4
|
-
This file is licensed to the client under a limited-use license.
|
|
5
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { ContentStatus, ContentType } from './IContent';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Content query filters
|
|
13
|
-
*/
|
|
14
|
-
export interface IContentFilters {
|
|
15
|
-
userId?: string;
|
|
16
|
-
status?: ContentStatus | ContentStatus[];
|
|
17
|
-
type?: ContentType | ContentType[];
|
|
18
|
-
workflowStage?: string;
|
|
19
|
-
publishedAfter?: Date;
|
|
20
|
-
publishedBefore?: Date;
|
|
21
|
-
searchQuery?: string;
|
|
22
|
-
limit?: number;
|
|
23
|
-
offset?: number;
|
|
24
|
-
orderBy?: 'createdAt' | 'updatedAt' | 'publishedAt' | 'title';
|
|
25
|
-
orderDirection?: 'ASC' | 'DESC';
|
|
26
|
-
includeDeleted?: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Paginated results
|
|
31
|
-
*/
|
|
32
|
-
export interface IPaginatedResult<T> {
|
|
33
|
-
data: T[];
|
|
34
|
-
total: number;
|
|
35
|
-
limit: number;
|
|
36
|
-
offset: number;
|
|
37
|
-
hasMore: boolean;
|
|
38
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Copyright (c) 2025 Bernier LLC
|
|
3
|
-
|
|
4
|
-
This file is licensed to the client under a limited-use license.
|
|
5
|
-
The client may use and modify this code *only within the scope of the project it was delivered for*.
|
|
6
|
-
Redistribution or use in other products or commercial offerings is not permitted without written consent from Bernier LLC.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Content version model
|
|
11
|
-
*/
|
|
12
|
-
export interface IContentVersion {
|
|
13
|
-
id: string;
|
|
14
|
-
contentId: string;
|
|
15
|
-
versionNumber: number;
|
|
16
|
-
title: string;
|
|
17
|
-
body: string;
|
|
18
|
-
changeSummary?: string;
|
|
19
|
-
isAutosave: boolean;
|
|
20
|
-
createdAt: Date;
|
|
21
|
-
createdBy: string;
|
|
22
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "./dist",
|
|
4
|
-
"rootDir": "./src",
|
|
5
|
-
"strict": true,
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"forceConsistentCasingInFileNames": true,
|
|
9
|
-
"declaration": true,
|
|
10
|
-
"declarationMap": true,
|
|
11
|
-
"sourceMap": true,
|
|
12
|
-
"module": "commonjs",
|
|
13
|
-
"target": "ES2020",
|
|
14
|
-
"lib": ["ES2020"],
|
|
15
|
-
"noImplicitAny": true,
|
|
16
|
-
"strictNullChecks": true,
|
|
17
|
-
"strictFunctionTypes": true,
|
|
18
|
-
"noImplicitReturns": true,
|
|
19
|
-
"noFallthroughCasesInSwitch": true,
|
|
20
|
-
"allowSyntheticDefaultImports": true,
|
|
21
|
-
"resolveJsonModule": true,
|
|
22
|
-
"isolatedModules": true
|
|
23
|
-
},
|
|
24
|
-
"include": ["src/**/*"],
|
|
25
|
-
"exclude": ["node_modules", "dist", "__tests__"]
|
|
26
|
-
}
|