@contentful/experience-design-system-cli 2.13.1-dev-build-005e75a.0 → 2.13.1-dev-build-7ded064.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/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_API_HOST, toApiHost } from '../host-utils.js';
|
|
2
2
|
import { getDebugLogger } from '../lib/debug-logger.js';
|
|
3
|
+
import { buildUserAgent } from '../lib/user-agent.js';
|
|
3
4
|
export const DEFAULT_HOST = DEFAULT_API_HOST;
|
|
4
5
|
// Phase-prefix constants used at the two ApiError throw sites below and
|
|
5
6
|
// imported by orchestrator.ts to identify preview-phase 422s for retry.
|
|
@@ -86,6 +87,7 @@ async function request(url, options) {
|
|
|
86
87
|
const headers = {
|
|
87
88
|
Authorization: `Bearer ${options.token}`,
|
|
88
89
|
'Content-Type': 'application/json',
|
|
90
|
+
'X-Contentful-User-Agent': buildUserAgent(),
|
|
89
91
|
};
|
|
90
92
|
const init = {
|
|
91
93
|
method: options.method ?? 'GET',
|
|
@@ -113,6 +115,7 @@ export class ImportApiClient {
|
|
|
113
115
|
return {
|
|
114
116
|
Authorization: `Bearer ${this.token}`,
|
|
115
117
|
'Content-Type': 'application/json',
|
|
118
|
+
'X-Contentful-User-Agent': buildUserAgent(),
|
|
116
119
|
};
|
|
117
120
|
}
|
|
118
121
|
async validateToken() {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* X-Contentful-User-Agent for the CLI's CMA requests, so writes are
|
|
3
|
+
* attributable to the DSI CLI as their origin. Format follows CEP-0056:
|
|
4
|
+
* `app <name>/<ver>; platform node.js/<ver>; os <name>/<ver>;`. Carries only
|
|
5
|
+
* the app/platform/os segments — no user- or content-identifying data.
|
|
6
|
+
*/
|
|
7
|
+
export declare function buildUserAgent(version?: string): string;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
const require = createRequire(import.meta.url);
|
|
3
|
+
const pkg = require('../../package.json');
|
|
4
|
+
const APP = 'contentful.experience-design-system-cli';
|
|
5
|
+
// process.platform → CEP-0056 os name, mirroring contentful-sdk-core's
|
|
6
|
+
// getNodeOS so the header parses identically to SDK-originated traffic.
|
|
7
|
+
const OS_NAMES = {
|
|
8
|
+
android: 'Android',
|
|
9
|
+
aix: 'Linux',
|
|
10
|
+
darwin: 'macOS',
|
|
11
|
+
freebsd: 'Linux',
|
|
12
|
+
linux: 'Linux',
|
|
13
|
+
openbsd: 'Linux',
|
|
14
|
+
sunos: 'Linux',
|
|
15
|
+
win32: 'Windows',
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* X-Contentful-User-Agent for the CLI's CMA requests, so writes are
|
|
19
|
+
* attributable to the DSI CLI as their origin. Format follows CEP-0056:
|
|
20
|
+
* `app <name>/<ver>; platform node.js/<ver>; os <name>/<ver>;`. Carries only
|
|
21
|
+
* the app/platform/os segments — no user- or content-identifying data.
|
|
22
|
+
*/
|
|
23
|
+
export function buildUserAgent(version = pkg.version) {
|
|
24
|
+
const parts = [`app ${APP}/${version}`, `platform node.js/${process.version}`];
|
|
25
|
+
const os = OS_NAMES[process.platform];
|
|
26
|
+
if (os)
|
|
27
|
+
parts.push(`os ${os}/${process.version}`);
|
|
28
|
+
return `${parts.join('; ')};`;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/experience-design-system-cli",
|
|
3
|
-
"version": "2.13.1-dev-build-
|
|
3
|
+
"version": "2.13.1-dev-build-7ded064.0",
|
|
4
4
|
"description": "Contentful Experiences design system import CLI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"react": "^18.3.1",
|
|
34
34
|
"react-devtools-core": "^4.19.1",
|
|
35
35
|
"react-dom": "^18.3.1",
|
|
36
|
-
"@contentful/experience-design-system-extraction": "2.13.1-dev-build-
|
|
37
|
-
"@contentful/experience-design-system-types": "2.13.1-dev-build-
|
|
36
|
+
"@contentful/experience-design-system-extraction": "2.13.1-dev-build-7ded064.0",
|
|
37
|
+
"@contentful/experience-design-system-types": "2.13.1-dev-build-7ded064.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@tsconfig/node24": "^24.0.3",
|