@inneropen/marvin-sdk 2.0.0-next.2 → 2.0.0-next.20
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 +136 -11
- package/dist/{HttpClient-CLtgQGXH.d.cts → HttpClient-CdF3IHM1.d.cts} +49 -2
- package/dist/{HttpClient-CLtgQGXH.d.ts → HttpClient-CdF3IHM1.d.ts} +49 -2
- package/dist/chunk-TZ2TZFWP.js +1009 -0
- package/dist/chunk-WJC4X7TB.js +738 -0
- package/dist/index.cjs +565 -25
- package/dist/index.d.cts +20 -544
- package/dist/index.d.ts +20 -544
- package/dist/index.js +27 -791
- package/dist/marvin-BAslemIz.d.cts +666 -0
- package/dist/marvin-BmbMUJXh.d.ts +666 -0
- package/dist/platform.cjs +681 -42
- package/dist/platform.d.cts +968 -94
- package/dist/platform.d.ts +968 -94
- package/dist/platform.js +449 -32
- package/dist/publish.cjs +1509 -0
- package/dist/publish.d.cts +49 -0
- package/dist/publish.d.ts +49 -0
- package/dist/publish.js +75 -0
- package/dist/types/index.d.cts +46 -1
- package/dist/types/index.d.ts +46 -1
- package/package.json +18 -7
- package/dist/chunk-25F3IF6S.js +0 -396
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { M as MarvinConfig, a as MarvinClient } from './marvin-BAslemIz.cjs';
|
|
2
|
+
export { C as Collection, E as Entry, b as MarvinApiError, c as MarvinAuthError, d as MarvinCache, e as MarvinConfigError, f as MarvinError, g as MarvinNetworkError, h as MarvinNotFoundError, i as MarvinServerError, j as MarvinValidationError, P as PaginatedResponse, k as PaginationMeta, l as PaginationParams, R as Resource, W as Workspace, m as createConfigFromEnv, n as createPaginatedResponse, o as extractData, p as isPaginatedResponse, q as offsetToPage, r as pageToOffset } from './marvin-BAslemIz.cjs';
|
|
3
|
+
export { GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite } from './types/index.cjs';
|
|
4
|
+
export { A as AuthStrategy, B as BearerTokenAuth, H as HttpClient, a as HttpClientConfig } from './HttpClient-CdF3IHM1.cjs';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Publishing API Entry Point
|
|
8
|
+
*
|
|
9
|
+
* Read-only API for published content using site client tokens.
|
|
10
|
+
* Import via: import { createMarvinClient } from '@inneropen/marvin-sdk/publish'
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { createMarvinClient } from '@inneropen/marvin-sdk/publish';
|
|
15
|
+
*
|
|
16
|
+
* // Uses MARVIN_SITE_CLIENT_TOKEN from environment
|
|
17
|
+
* const marvin = createMarvinClient();
|
|
18
|
+
*
|
|
19
|
+
* // Or provide token explicitly
|
|
20
|
+
* const marvin = createMarvinClient({
|
|
21
|
+
* siteClientToken: 'your-token-here'
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* const entry = await marvin.entry('about');
|
|
25
|
+
* const projects = await marvin.projects();
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Create a Marvin Publishing API client from environment variables
|
|
31
|
+
*
|
|
32
|
+
* @param config - Optional configuration overrides
|
|
33
|
+
* @returns Configured Marvin client for read-only publishing API
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* // From environment variables (MARVIN_SITE_CLIENT_TOKEN)
|
|
38
|
+
* const marvin = createMarvinClient();
|
|
39
|
+
*
|
|
40
|
+
* // With overrides
|
|
41
|
+
* const marvin = createMarvinClient({
|
|
42
|
+
* apiUrl: 'https://marvin.example.com',
|
|
43
|
+
* siteClientToken: 'your-token-here'
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare function createMarvinClient(config?: Partial<MarvinConfig>): MarvinClient;
|
|
48
|
+
|
|
49
|
+
export { MarvinClient, MarvinConfig, createMarvinClient };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { M as MarvinConfig, a as MarvinClient } from './marvin-BmbMUJXh.js';
|
|
2
|
+
export { C as Collection, E as Entry, b as MarvinApiError, c as MarvinAuthError, d as MarvinCache, e as MarvinConfigError, f as MarvinError, g as MarvinNetworkError, h as MarvinNotFoundError, i as MarvinServerError, j as MarvinValidationError, P as PaginatedResponse, k as PaginationMeta, l as PaginationParams, R as Resource, W as Workspace, m as createConfigFromEnv, n as createPaginatedResponse, o as extractData, p as isPaginatedResponse, q as offsetToPage, r as pageToOffset } from './marvin-BmbMUJXh.js';
|
|
3
|
+
export { GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite } from './types/index.js';
|
|
4
|
+
export { A as AuthStrategy, B as BearerTokenAuth, H as HttpClient, a as HttpClientConfig } from './HttpClient-CdF3IHM1.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Publishing API Entry Point
|
|
8
|
+
*
|
|
9
|
+
* Read-only API for published content using site client tokens.
|
|
10
|
+
* Import via: import { createMarvinClient } from '@inneropen/marvin-sdk/publish'
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { createMarvinClient } from '@inneropen/marvin-sdk/publish';
|
|
15
|
+
*
|
|
16
|
+
* // Uses MARVIN_SITE_CLIENT_TOKEN from environment
|
|
17
|
+
* const marvin = createMarvinClient();
|
|
18
|
+
*
|
|
19
|
+
* // Or provide token explicitly
|
|
20
|
+
* const marvin = createMarvinClient({
|
|
21
|
+
* siteClientToken: 'your-token-here'
|
|
22
|
+
* });
|
|
23
|
+
*
|
|
24
|
+
* const entry = await marvin.entry('about');
|
|
25
|
+
* const projects = await marvin.projects();
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Create a Marvin Publishing API client from environment variables
|
|
31
|
+
*
|
|
32
|
+
* @param config - Optional configuration overrides
|
|
33
|
+
* @returns Configured Marvin client for read-only publishing API
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* // From environment variables (MARVIN_SITE_CLIENT_TOKEN)
|
|
38
|
+
* const marvin = createMarvinClient();
|
|
39
|
+
*
|
|
40
|
+
* // With overrides
|
|
41
|
+
* const marvin = createMarvinClient({
|
|
42
|
+
* apiUrl: 'https://marvin.example.com',
|
|
43
|
+
* siteClientToken: 'your-token-here'
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
declare function createMarvinClient(config?: Partial<MarvinConfig>): MarvinClient;
|
|
48
|
+
|
|
49
|
+
export { MarvinClient, MarvinConfig, createMarvinClient };
|
package/dist/publish.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Collection,
|
|
3
|
+
Entry,
|
|
4
|
+
MarvinClient,
|
|
5
|
+
Resource,
|
|
6
|
+
Workspace,
|
|
7
|
+
config_exports,
|
|
8
|
+
createConfigFromEnv,
|
|
9
|
+
init_collection,
|
|
10
|
+
init_config,
|
|
11
|
+
init_entry,
|
|
12
|
+
init_marvin,
|
|
13
|
+
init_resource,
|
|
14
|
+
init_workspace
|
|
15
|
+
} from "./chunk-TZ2TZFWP.js";
|
|
16
|
+
import {
|
|
17
|
+
BearerTokenAuth,
|
|
18
|
+
HttpClient,
|
|
19
|
+
MarvinApiError,
|
|
20
|
+
MarvinAuthError,
|
|
21
|
+
MarvinCache,
|
|
22
|
+
MarvinConfigError,
|
|
23
|
+
MarvinError,
|
|
24
|
+
MarvinNetworkError,
|
|
25
|
+
MarvinNotFoundError,
|
|
26
|
+
MarvinServerError,
|
|
27
|
+
MarvinValidationError,
|
|
28
|
+
__toCommonJS,
|
|
29
|
+
createPaginatedResponse,
|
|
30
|
+
extractData,
|
|
31
|
+
init_core,
|
|
32
|
+
isPaginatedResponse,
|
|
33
|
+
offsetToPage,
|
|
34
|
+
pageToOffset
|
|
35
|
+
} from "./chunk-WJC4X7TB.js";
|
|
36
|
+
|
|
37
|
+
// src/publish.ts
|
|
38
|
+
init_marvin();
|
|
39
|
+
init_config();
|
|
40
|
+
init_marvin();
|
|
41
|
+
init_workspace();
|
|
42
|
+
init_entry();
|
|
43
|
+
init_collection();
|
|
44
|
+
init_resource();
|
|
45
|
+
init_core();
|
|
46
|
+
function createMarvinClient(config) {
|
|
47
|
+
const { createConfigFromEnv: createConfigFromEnv2 } = (init_config(), __toCommonJS(config_exports));
|
|
48
|
+
const finalConfig = createConfigFromEnv2(config);
|
|
49
|
+
return new MarvinClient(finalConfig);
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
BearerTokenAuth,
|
|
53
|
+
Collection,
|
|
54
|
+
Entry,
|
|
55
|
+
HttpClient,
|
|
56
|
+
MarvinApiError,
|
|
57
|
+
MarvinAuthError,
|
|
58
|
+
MarvinCache,
|
|
59
|
+
MarvinClient,
|
|
60
|
+
MarvinConfigError,
|
|
61
|
+
MarvinError,
|
|
62
|
+
MarvinNetworkError,
|
|
63
|
+
MarvinNotFoundError,
|
|
64
|
+
MarvinServerError,
|
|
65
|
+
MarvinValidationError,
|
|
66
|
+
Resource,
|
|
67
|
+
Workspace,
|
|
68
|
+
createConfigFromEnv,
|
|
69
|
+
createMarvinClient,
|
|
70
|
+
createPaginatedResponse,
|
|
71
|
+
extractData,
|
|
72
|
+
isPaginatedResponse,
|
|
73
|
+
offsetToPage,
|
|
74
|
+
pageToOffset
|
|
75
|
+
};
|
package/dist/types/index.d.cts
CHANGED
|
@@ -32,6 +32,17 @@ interface MarvinEntryType {
|
|
|
32
32
|
* @since 2.0.0
|
|
33
33
|
*/
|
|
34
34
|
schemaJson?: Record<string, unknown>;
|
|
35
|
+
rendering?: {
|
|
36
|
+
renderer?: string;
|
|
37
|
+
package?: string;
|
|
38
|
+
version?: string;
|
|
39
|
+
config?: Record<string, unknown>;
|
|
40
|
+
};
|
|
41
|
+
capabilities?: {
|
|
42
|
+
publishable?: boolean;
|
|
43
|
+
submittable?: boolean;
|
|
44
|
+
routable?: boolean;
|
|
45
|
+
};
|
|
35
46
|
}
|
|
36
47
|
interface MarvinAsset {
|
|
37
48
|
id: string;
|
|
@@ -128,6 +139,16 @@ interface MarvinEntry {
|
|
|
128
139
|
publishedAt?: string;
|
|
129
140
|
createdAt: string;
|
|
130
141
|
updatedAt: string;
|
|
142
|
+
entryTypeInfo?: {
|
|
143
|
+
slug: string;
|
|
144
|
+
renderer?: string;
|
|
145
|
+
package?: string;
|
|
146
|
+
version?: string;
|
|
147
|
+
config?: Record<string, unknown>;
|
|
148
|
+
publishable?: boolean;
|
|
149
|
+
submittable?: boolean;
|
|
150
|
+
routable?: boolean;
|
|
151
|
+
};
|
|
131
152
|
entryTypeId: string;
|
|
132
153
|
entryType?: MarvinEntryType;
|
|
133
154
|
collections?: MarvinCollection[];
|
|
@@ -159,10 +180,34 @@ interface GetAssetsOptions {
|
|
|
159
180
|
limit?: number;
|
|
160
181
|
offset?: number;
|
|
161
182
|
}
|
|
183
|
+
interface PublishedEntryType {
|
|
184
|
+
slug: string;
|
|
185
|
+
name: string;
|
|
186
|
+
isRendered: boolean;
|
|
187
|
+
rendering?: {
|
|
188
|
+
renderer?: string;
|
|
189
|
+
package?: string;
|
|
190
|
+
version?: string;
|
|
191
|
+
config?: Record<string, unknown>;
|
|
192
|
+
};
|
|
193
|
+
capabilities?: {
|
|
194
|
+
publishable?: boolean;
|
|
195
|
+
submittable?: boolean;
|
|
196
|
+
routable?: boolean;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
162
199
|
interface GetResourcesOptions {
|
|
163
200
|
resourceType?: string;
|
|
164
201
|
limit?: number;
|
|
165
202
|
offset?: number;
|
|
166
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Authentication token response
|
|
206
|
+
* Used by auth.login() and auth.refresh()
|
|
207
|
+
*/
|
|
208
|
+
interface AuthToken {
|
|
209
|
+
accessToken: string;
|
|
210
|
+
tokenType: string;
|
|
211
|
+
}
|
|
167
212
|
|
|
168
|
-
export type { AssetUploadRequest, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset };
|
|
213
|
+
export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset, PublishedEntryType };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -32,6 +32,17 @@ interface MarvinEntryType {
|
|
|
32
32
|
* @since 2.0.0
|
|
33
33
|
*/
|
|
34
34
|
schemaJson?: Record<string, unknown>;
|
|
35
|
+
rendering?: {
|
|
36
|
+
renderer?: string;
|
|
37
|
+
package?: string;
|
|
38
|
+
version?: string;
|
|
39
|
+
config?: Record<string, unknown>;
|
|
40
|
+
};
|
|
41
|
+
capabilities?: {
|
|
42
|
+
publishable?: boolean;
|
|
43
|
+
submittable?: boolean;
|
|
44
|
+
routable?: boolean;
|
|
45
|
+
};
|
|
35
46
|
}
|
|
36
47
|
interface MarvinAsset {
|
|
37
48
|
id: string;
|
|
@@ -128,6 +139,16 @@ interface MarvinEntry {
|
|
|
128
139
|
publishedAt?: string;
|
|
129
140
|
createdAt: string;
|
|
130
141
|
updatedAt: string;
|
|
142
|
+
entryTypeInfo?: {
|
|
143
|
+
slug: string;
|
|
144
|
+
renderer?: string;
|
|
145
|
+
package?: string;
|
|
146
|
+
version?: string;
|
|
147
|
+
config?: Record<string, unknown>;
|
|
148
|
+
publishable?: boolean;
|
|
149
|
+
submittable?: boolean;
|
|
150
|
+
routable?: boolean;
|
|
151
|
+
};
|
|
131
152
|
entryTypeId: string;
|
|
132
153
|
entryType?: MarvinEntryType;
|
|
133
154
|
collections?: MarvinCollection[];
|
|
@@ -159,10 +180,34 @@ interface GetAssetsOptions {
|
|
|
159
180
|
limit?: number;
|
|
160
181
|
offset?: number;
|
|
161
182
|
}
|
|
183
|
+
interface PublishedEntryType {
|
|
184
|
+
slug: string;
|
|
185
|
+
name: string;
|
|
186
|
+
isRendered: boolean;
|
|
187
|
+
rendering?: {
|
|
188
|
+
renderer?: string;
|
|
189
|
+
package?: string;
|
|
190
|
+
version?: string;
|
|
191
|
+
config?: Record<string, unknown>;
|
|
192
|
+
};
|
|
193
|
+
capabilities?: {
|
|
194
|
+
publishable?: boolean;
|
|
195
|
+
submittable?: boolean;
|
|
196
|
+
routable?: boolean;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
162
199
|
interface GetResourcesOptions {
|
|
163
200
|
resourceType?: string;
|
|
164
201
|
limit?: number;
|
|
165
202
|
offset?: number;
|
|
166
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* Authentication token response
|
|
206
|
+
* Used by auth.login() and auth.refresh()
|
|
207
|
+
*/
|
|
208
|
+
interface AuthToken {
|
|
209
|
+
accessToken: string;
|
|
210
|
+
tokenType: string;
|
|
211
|
+
}
|
|
167
212
|
|
|
168
|
-
export type { AssetUploadRequest, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset };
|
|
213
|
+
export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset, PublishedEntryType };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inneropen/marvin-sdk",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.20",
|
|
4
4
|
"description": "Official TypeScript SDK for Marvin CMS",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -13,15 +13,20 @@
|
|
|
13
13
|
"require": "./dist/index.cjs"
|
|
14
14
|
},
|
|
15
15
|
"./publish": {
|
|
16
|
-
"types": "./dist/
|
|
17
|
-
"import": "./dist/
|
|
18
|
-
"require": "./dist/
|
|
16
|
+
"types": "./dist/publish.d.ts",
|
|
17
|
+
"import": "./dist/publish.js",
|
|
18
|
+
"require": "./dist/publish.cjs"
|
|
19
19
|
},
|
|
20
20
|
"./platform": {
|
|
21
21
|
"types": "./dist/platform.d.ts",
|
|
22
22
|
"import": "./dist/platform.js",
|
|
23
23
|
"require": "./dist/platform.cjs"
|
|
24
24
|
},
|
|
25
|
+
"./core": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js",
|
|
28
|
+
"require": "./dist/index.cjs"
|
|
29
|
+
},
|
|
25
30
|
"./types": {
|
|
26
31
|
"types": "./dist/types/index.d.ts",
|
|
27
32
|
"import": "./dist/types/index.js",
|
|
@@ -60,12 +65,15 @@
|
|
|
60
65
|
},
|
|
61
66
|
"homepage": "https://github.com/inneropen/marvin-sdk#readme",
|
|
62
67
|
"scripts": {
|
|
63
|
-
"build": "tsup src/index.ts src/platform.ts src/types/index.ts --format esm,cjs --dts --clean",
|
|
64
|
-
"dev": "tsup src/index.ts src/platform.ts src/types/index.ts --format esm,cjs --dts --watch",
|
|
68
|
+
"build": "tsup src/index.ts src/publish.ts src/platform.ts src/types/index.ts --format esm,cjs --dts --clean",
|
|
69
|
+
"dev": "tsup src/index.ts src/publish.ts src/platform.ts src/types/index.ts --format esm,cjs --dts --watch",
|
|
65
70
|
"generate:types": "openapi-typescript http://localhost:8080/openapi.json -o src/generated/schema.ts",
|
|
66
71
|
"typecheck": "tsc --noEmit",
|
|
67
72
|
"prepare": "npm run build",
|
|
68
|
-
"prepublishOnly": "npm run build"
|
|
73
|
+
"prepublishOnly": "npm run build",
|
|
74
|
+
"docs:serve": "mkdocs serve",
|
|
75
|
+
"docs:build": "mkdocs build",
|
|
76
|
+
"docs:deploy": "mkdocs gh-deploy"
|
|
69
77
|
},
|
|
70
78
|
"peerDependencies": {
|
|
71
79
|
"typescript": "^5.0.0"
|
|
@@ -81,5 +89,8 @@
|
|
|
81
89
|
"openapi-typescript": "^7.13.0",
|
|
82
90
|
"semantic-release": "^25.0.5",
|
|
83
91
|
"tsup": "^8.5.1"
|
|
92
|
+
},
|
|
93
|
+
"dependencies": {
|
|
94
|
+
"mkdocs": "^0.0.1"
|
|
84
95
|
}
|
|
85
96
|
}
|