@inneropen/marvin-sdk 2.0.0-next.14 → 2.0.0-next.16
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-BX5Gqd0w.d.cts → HttpClient-CdF3IHM1.d.cts} +41 -2
- package/dist/{HttpClient-BX5Gqd0w.d.ts → HttpClient-CdF3IHM1.d.ts} +41 -2
- package/dist/chunk-GJNOYXUQ.js +980 -0
- package/dist/{chunk-BVHNN2PW.js → chunk-WJC4X7TB.js} +274 -8
- package/dist/index.cjs +356 -11
- package/dist/index.d.cts +20 -610
- package/dist/index.d.ts +20 -610
- package/dist/index.js +21 -880
- package/dist/marvin-Bx5k6tsF.d.cts +654 -0
- package/dist/marvin-g7dayc83.d.ts +654 -0
- package/dist/platform.cjs +396 -42
- package/dist/platform.d.cts +124 -15
- package/dist/platform.d.ts +124 -15
- package/dist/platform.js +251 -37
- package/dist/publish.cjs +1487 -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 +9 -1
- package/dist/types/index.d.ts +9 -1
- package/package.json +11 -6
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { M as MarvinConfig, a as MarvinClient } from './marvin-Bx5k6tsF.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-Bx5k6tsF.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-g7dayc83.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-g7dayc83.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-GJNOYXUQ.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
|
@@ -164,5 +164,13 @@ interface GetResourcesOptions {
|
|
|
164
164
|
limit?: number;
|
|
165
165
|
offset?: number;
|
|
166
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Authentication token response
|
|
169
|
+
* Used by auth.login() and auth.refresh()
|
|
170
|
+
*/
|
|
171
|
+
interface AuthToken {
|
|
172
|
+
accessToken: string;
|
|
173
|
+
tokenType: string;
|
|
174
|
+
}
|
|
167
175
|
|
|
168
|
-
export type { AssetUploadRequest, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset };
|
|
176
|
+
export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -164,5 +164,13 @@ interface GetResourcesOptions {
|
|
|
164
164
|
limit?: number;
|
|
165
165
|
offset?: number;
|
|
166
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Authentication token response
|
|
169
|
+
* Used by auth.login() and auth.refresh()
|
|
170
|
+
*/
|
|
171
|
+
interface AuthToken {
|
|
172
|
+
accessToken: string;
|
|
173
|
+
tokenType: string;
|
|
174
|
+
}
|
|
167
175
|
|
|
168
|
-
export type { AssetUploadRequest, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset };
|
|
176
|
+
export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset };
|
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.16",
|
|
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,8 +65,8 @@
|
|
|
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",
|