@inneropen/marvin-sdk 2.0.0-next.20 → 2.0.0-next.21
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 +43 -3
- package/dist/platform.cjs +18 -10
- package/dist/platform.js +18 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -160,10 +160,11 @@ Everything starts with the **Workspace**:
|
|
|
160
160
|
const workspace = await marvin.getWorkspace();
|
|
161
161
|
|
|
162
162
|
// Access workspace modules
|
|
163
|
-
workspace.entries
|
|
163
|
+
workspace.entries // Entries module
|
|
164
164
|
workspace.collections // Collections module
|
|
165
|
-
workspace.assets
|
|
166
|
-
workspace.
|
|
165
|
+
workspace.assets // Assets module
|
|
166
|
+
workspace.renderers // Renderers module (entry type rendering metadata)
|
|
167
|
+
workspace.site // Site configuration (cached)
|
|
167
168
|
```
|
|
168
169
|
|
|
169
170
|
### Modular Structure
|
|
@@ -177,6 +178,7 @@ The SDK is organized into focused modules:
|
|
|
177
178
|
├── entries/ → Entries module
|
|
178
179
|
├── collections/ → Collections module
|
|
179
180
|
├── assets/ → Assets module
|
|
181
|
+
├── renderers/ → Renderers module (entry type rendering metadata)
|
|
180
182
|
├── auth/ → Authentication (future)
|
|
181
183
|
├── types/ → TypeScript types
|
|
182
184
|
└── utils/ → Cache & utilities
|
|
@@ -686,6 +688,43 @@ Methods:
|
|
|
686
688
|
- `resource.entries()` - Get entries that reference this resource
|
|
687
689
|
- `resource.toJSON()` - Get raw resource data
|
|
688
690
|
|
|
691
|
+
### Renderers Module
|
|
692
|
+
|
|
693
|
+
#### `renderers.list()`
|
|
694
|
+
|
|
695
|
+
Get all entry types with their rendering and capability metadata.
|
|
696
|
+
|
|
697
|
+
**Returns:** `PublishedEntryType[]`
|
|
698
|
+
|
|
699
|
+
```ts
|
|
700
|
+
interface PublishedEntryType {
|
|
701
|
+
slug: string;
|
|
702
|
+
name: string;
|
|
703
|
+
isRendered: boolean;
|
|
704
|
+
rendering?: {
|
|
705
|
+
renderer?: string;
|
|
706
|
+
package?: string;
|
|
707
|
+
version?: string;
|
|
708
|
+
config?: Record<string, unknown>;
|
|
709
|
+
};
|
|
710
|
+
capabilities?: {
|
|
711
|
+
publishable?: boolean;
|
|
712
|
+
submittable?: boolean;
|
|
713
|
+
routable?: boolean;
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
**Example:**
|
|
719
|
+
|
|
720
|
+
```ts
|
|
721
|
+
const workspace = await marvin.getWorkspace();
|
|
722
|
+
const renderers = await workspace.renderers.list();
|
|
723
|
+
|
|
724
|
+
const rendered = renderers.filter(r => r.isRendered);
|
|
725
|
+
console.log(`${rendered.length} entry types have renderers`);
|
|
726
|
+
```
|
|
727
|
+
|
|
689
728
|
## Backend API Endpoints
|
|
690
729
|
|
|
691
730
|
The SDK uses these Marvin publishing API endpoints:
|
|
@@ -704,6 +743,7 @@ The SDK uses these Marvin publishing API endpoints:
|
|
|
704
743
|
| `/api/publish/{workspace}/resources` | GET | List resources | ✅ Implemented |
|
|
705
744
|
| `/api/publish/{workspace}/resources/{slug}` | GET | Get resource | ✅ Implemented |
|
|
706
745
|
| `/api/publish/{workspace}/resources/{slug}/entries` | GET | Resource entries | ✅ Implemented |
|
|
746
|
+
| `/api/publish/{workspace}/entry-types` | GET | List entry types (renderers) | ✅ Implemented |
|
|
707
747
|
|
|
708
748
|
**Query Parameters:**
|
|
709
749
|
|
package/dist/platform.cjs
CHANGED
|
@@ -962,6 +962,12 @@ var WorkspacesModule = class {
|
|
|
962
962
|
};
|
|
963
963
|
|
|
964
964
|
// src/platform/invites.ts
|
|
965
|
+
function getEnv(key) {
|
|
966
|
+
if (typeof process !== "undefined" && process.env) {
|
|
967
|
+
return process.env[key];
|
|
968
|
+
}
|
|
969
|
+
return void 0;
|
|
970
|
+
}
|
|
965
971
|
var InvitesModule = class {
|
|
966
972
|
constructor(http) {
|
|
967
973
|
this.http = http;
|
|
@@ -1010,16 +1016,18 @@ var InvitesModule = class {
|
|
|
1010
1016
|
*/
|
|
1011
1017
|
getInvitationUrl(token, baseUrl) {
|
|
1012
1018
|
let base = baseUrl;
|
|
1013
|
-
if (!base
|
|
1014
|
-
base =
|
|
1015
|
-
if (!base
|
|
1016
|
-
const apiUrl =
|
|
1017
|
-
if (apiUrl
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1019
|
+
if (!base) {
|
|
1020
|
+
base = getEnv("MARVIN_FRONTEND_URL");
|
|
1021
|
+
if (!base) {
|
|
1022
|
+
const apiUrl = getEnv("MARVIN_API_URL");
|
|
1023
|
+
if (apiUrl) {
|
|
1024
|
+
if (apiUrl.includes(":8080")) {
|
|
1025
|
+
base = apiUrl.replace(":8080", ":4321");
|
|
1026
|
+
} else if (apiUrl.includes(":3000")) {
|
|
1027
|
+
base = apiUrl.replace(":3000", ":4321");
|
|
1028
|
+
} else {
|
|
1029
|
+
base = apiUrl;
|
|
1030
|
+
}
|
|
1023
1031
|
}
|
|
1024
1032
|
}
|
|
1025
1033
|
}
|
package/dist/platform.js
CHANGED
|
@@ -517,6 +517,12 @@ var WorkspacesModule = class {
|
|
|
517
517
|
};
|
|
518
518
|
|
|
519
519
|
// src/platform/invites.ts
|
|
520
|
+
function getEnv(key) {
|
|
521
|
+
if (typeof process !== "undefined" && process.env) {
|
|
522
|
+
return process.env[key];
|
|
523
|
+
}
|
|
524
|
+
return void 0;
|
|
525
|
+
}
|
|
520
526
|
var InvitesModule = class {
|
|
521
527
|
constructor(http) {
|
|
522
528
|
this.http = http;
|
|
@@ -565,16 +571,18 @@ var InvitesModule = class {
|
|
|
565
571
|
*/
|
|
566
572
|
getInvitationUrl(token, baseUrl) {
|
|
567
573
|
let base = baseUrl;
|
|
568
|
-
if (!base
|
|
569
|
-
base =
|
|
570
|
-
if (!base
|
|
571
|
-
const apiUrl =
|
|
572
|
-
if (apiUrl
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
574
|
+
if (!base) {
|
|
575
|
+
base = getEnv("MARVIN_FRONTEND_URL");
|
|
576
|
+
if (!base) {
|
|
577
|
+
const apiUrl = getEnv("MARVIN_API_URL");
|
|
578
|
+
if (apiUrl) {
|
|
579
|
+
if (apiUrl.includes(":8080")) {
|
|
580
|
+
base = apiUrl.replace(":8080", ":4321");
|
|
581
|
+
} else if (apiUrl.includes(":3000")) {
|
|
582
|
+
base = apiUrl.replace(":3000", ":4321");
|
|
583
|
+
} else {
|
|
584
|
+
base = apiUrl;
|
|
585
|
+
}
|
|
578
586
|
}
|
|
579
587
|
}
|
|
580
588
|
}
|