@bernierllc/contentful-cma-client 1.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.
- package/.eslintrc.cjs +34 -0
- package/README.md +441 -0
- package/dist/ContentfulCMAClient.d.ts +119 -0
- package/dist/ContentfulCMAClient.js +538 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +12 -0
- package/dist/types.d.ts +39 -0
- package/dist/types.js +9 -0
- package/jest.config.cjs +31 -0
- package/package.json +44 -0
- package/src/ContentfulCMAClient.ts +694 -0
- package/src/__tests__/ContentfulCMAClient.test.ts +841 -0
- package/src/index.ts +16 -0
- package/src/types.ts +51 -0
- package/tsconfig.json +29 -0
package/src/index.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
export { ContentfulCMAClient } from './ContentfulCMAClient';
|
|
10
|
+
export {
|
|
11
|
+
CMAQueryOptions,
|
|
12
|
+
CMAEntryCreateOptions,
|
|
13
|
+
CMAEntryUpdateOptions,
|
|
14
|
+
CMAAssetCreateOptions,
|
|
15
|
+
CMABulkOperationResult
|
|
16
|
+
} from './types';
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
* Query options for CMA operations
|
|
11
|
+
*/
|
|
12
|
+
export interface CMAQueryOptions {
|
|
13
|
+
skip?: number;
|
|
14
|
+
limit?: number;
|
|
15
|
+
order?: string;
|
|
16
|
+
locale?: string;
|
|
17
|
+
content_type?: string;
|
|
18
|
+
[key: string]: string | number | undefined;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Options for creating entries
|
|
23
|
+
*/
|
|
24
|
+
export interface CMAEntryCreateOptions {
|
|
25
|
+
entryId?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Options for updating entries
|
|
30
|
+
*/
|
|
31
|
+
export interface CMAEntryUpdateOptions {
|
|
32
|
+
locale?: string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Options for creating assets
|
|
37
|
+
*/
|
|
38
|
+
export interface CMAAssetCreateOptions {
|
|
39
|
+
assetId?: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Result of bulk operations
|
|
44
|
+
*/
|
|
45
|
+
export interface CMABulkOperationResult<T> {
|
|
46
|
+
successful: T[];
|
|
47
|
+
failed: Array<{
|
|
48
|
+
item: unknown;
|
|
49
|
+
error: string;
|
|
50
|
+
}>;
|
|
51
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["ES2020"],
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"rootDir": "./src",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"noImplicitAny": true,
|
|
11
|
+
"strictNullChecks": true,
|
|
12
|
+
"strictFunctionTypes": true,
|
|
13
|
+
"strictBindCallApply": true,
|
|
14
|
+
"strictPropertyInitialization": true,
|
|
15
|
+
"noImplicitThis": true,
|
|
16
|
+
"alwaysStrict": true,
|
|
17
|
+
"noUnusedLocals": true,
|
|
18
|
+
"noUnusedParameters": true,
|
|
19
|
+
"noImplicitReturns": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"esModuleInterop": true,
|
|
22
|
+
"skipLibCheck": true,
|
|
23
|
+
"forceConsistentCasingInFileNames": true,
|
|
24
|
+
"resolveJsonModule": true,
|
|
25
|
+
"moduleResolution": "node"
|
|
26
|
+
},
|
|
27
|
+
"include": ["src/**/*"],
|
|
28
|
+
"exclude": ["node_modules", "dist", "**/*.test.ts", "**/__tests__/**"]
|
|
29
|
+
}
|