@inneropen/marvin-sdk 2.0.0-next.22 → 2.0.0-next.24

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.
@@ -4,81 +4,54 @@
4
4
  * TypeScript types for the Marvin publishing API responses.
5
5
  */
6
6
  interface MarvinSite {
7
- id: string;
8
- name: string;
9
- slug: string;
10
- title?: string;
11
- tagline?: string;
12
- description?: string;
13
- canonicalUrl?: string;
14
- logo?: string;
15
- favicon?: string;
16
- locale?: string;
17
- timezone?: string;
18
- metadata?: Record<string, unknown>;
7
+ workspace: {
8
+ slug: string;
9
+ name: string;
10
+ };
11
+ site: {
12
+ title?: string | null;
13
+ tagline?: string | null;
14
+ description?: string | null;
15
+ canonicalUrl?: string | null;
16
+ logo?: string | null;
17
+ favicon?: string | null;
18
+ locale: string;
19
+ timezone: string;
20
+ contactEmail?: string | null;
21
+ social?: Record<string, unknown> | null;
22
+ metadataJson?: Record<string, unknown> | null;
23
+ };
19
24
  }
20
25
  interface MarvinEntryType {
21
26
  id: string;
27
+ groupId: string | null;
22
28
  name: string;
23
29
  slug: string;
24
- icon?: string;
25
- color?: string;
26
- description?: string;
30
+ icon?: string | null;
31
+ color?: string | null;
32
+ description?: string | null;
27
33
  sortOrder: number;
28
34
  isSystem: boolean;
29
- /**
30
- * Schema definition for this entry type (schema-driven content model).
31
- * Defines what fields exist, their types, and validation rules.
32
- * @since 2.0.0
33
- */
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
+ isRendered: boolean;
36
+ schemaJson?: Record<string, unknown> | null;
37
+ renderingJson?: Record<string, unknown> | null;
38
+ capabilitiesJson?: Record<string, unknown> | null;
39
+ createdAt?: string | null;
40
+ updateAt?: string | null;
41
+ warnings?: string[] | null;
46
42
  }
47
43
  interface MarvinAsset {
48
- id: string;
49
- slug: string;
50
- name: string;
51
- originalFilename: string;
52
- filename: string;
53
- extension: string;
54
- mimeType: string;
55
- assetType: 'image' | 'document' | 'video' | 'audio' | 'archive' | 'svg' | 'other';
56
- fileSize: number;
57
- checksum: string;
58
- width?: number;
59
- height?: number;
60
- orientation?: number;
61
- storageProvider: string;
62
- storageKey: string;
63
- publicUrl?: string;
64
- altText?: string;
65
- description?: string;
66
- metadata?: Record<string, unknown>;
67
- uploadedBy: string;
68
- createdAt: string;
69
- updatedAt: string;
70
- }
71
- interface PublishedAsset {
72
44
  slug: string;
73
45
  name: string;
74
46
  mimeType: string;
75
47
  assetType: string;
76
48
  fileSize: number;
77
- width?: number;
78
- height?: number;
79
- altText?: string;
80
- description?: string;
49
+ width?: number | null;
50
+ height?: number | null;
51
+ altText?: string | null;
52
+ description?: string | null;
81
53
  publicUrl: string;
54
+ metadataJson?: Record<string, unknown> | null;
82
55
  }
83
56
  interface AssetUploadRequest {
84
57
  slug: string;
@@ -88,72 +61,101 @@ interface AssetUploadRequest {
88
61
  metadata?: Record<string, unknown>;
89
62
  }
90
63
  interface MarvinCollection {
91
- id: string;
92
- name: string;
93
64
  slug: string;
94
- description?: string;
95
- icon?: string;
96
- color?: string;
97
- sortOrder: number;
65
+ name: string;
66
+ description?: string | null;
98
67
  isSmart: boolean;
99
- smartRules?: Record<string, unknown>;
100
- createdAt: string;
101
- updatedAt: string;
102
- entryCount?: number;
103
- entries?: MarvinEntry[];
68
+ smartRules?: Record<string, unknown> | null;
69
+ metadataJson?: Record<string, unknown> | null;
70
+ entryCount: number;
71
+ entries: MarvinEntryListItem[];
104
72
  }
105
73
  interface MarvinResource {
106
- id: string;
74
+ slug: string;
107
75
  name: string;
76
+ resourceType: string;
77
+ description?: string | null;
78
+ url?: string | null;
79
+ externalId?: string | null;
80
+ metadataJson?: Record<string, unknown> | null;
81
+ entries: string[];
82
+ }
83
+ interface PublishedCollectionSummary {
108
84
  slug: string;
109
- resourceType?: string;
110
- description?: string;
111
- externalId?: string;
112
- url?: string;
113
- metadata?: Record<string, unknown>;
114
- createdAt: string;
115
- updatedAt: string;
85
+ name: string;
86
+ metadataJson?: Record<string, unknown> | null;
87
+ sortOrder: number;
116
88
  }
117
- interface MarvinEntry {
118
- id: string;
119
- title: string;
89
+ interface PublishedResourceRead {
120
90
  slug: string;
121
- summary?: string;
122
- description?: string;
123
- /**
124
- * Schema-driven content data structured according to entry type's schemaJson.
125
- * @since 2.0.0
126
- */
127
- dataJson?: Record<string, unknown>;
128
- /**
129
- * @deprecated Use dataJson instead. Will be removed in v3.0.0
130
- * @since 1.x
131
- */
132
- contentMarkdown?: string;
133
- /**
134
- * Custom non-schema metadata (API keys, external IDs, CMS-specific config).
135
- * For content fields, use dataJson instead.
136
- */
137
- metadata?: Record<string, unknown>;
91
+ name: string;
92
+ resourceType: string;
93
+ description?: string | null;
94
+ url?: string | null;
95
+ externalId?: string | null;
96
+ metadataJson?: Record<string, unknown> | null;
97
+ role?: string | null;
98
+ quantity?: string | null;
99
+ unit?: string | null;
100
+ position: number;
101
+ }
102
+ interface PublishedAssetRead {
103
+ slug: string;
104
+ name: string;
105
+ mimeType: string;
106
+ assetType: string;
107
+ fileSize: number;
108
+ width?: number | null;
109
+ height?: number | null;
110
+ altText?: string | null;
111
+ description?: string | null;
112
+ publicUrl: string;
113
+ metadataJson?: Record<string, unknown> | null;
114
+ }
115
+ interface MarvinEntryListItem {
116
+ slug: string;
117
+ title: string;
118
+ entryType: string;
119
+ entryTypeInfo?: {
120
+ slug: string;
121
+ renderer?: string | null;
122
+ package?: string | null;
123
+ version?: string | null;
124
+ config?: Record<string, unknown> | null;
125
+ publishable: boolean;
126
+ submittable: boolean;
127
+ routable: boolean;
128
+ } | null;
129
+ summary?: string | null;
130
+ publishedAt?: string | null;
138
131
  status: string;
139
- publishedAt?: string;
140
- createdAt: string;
141
- updatedAt: string;
132
+ collections: string[];
133
+ assetSlugs: string[];
134
+ resourceSlugs: string[];
135
+ order?: number | null;
136
+ }
137
+ interface MarvinEntry {
138
+ slug: string;
139
+ title: string;
140
+ entryType: string;
142
141
  entryTypeInfo?: {
143
142
  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
- };
152
- entryTypeId: string;
153
- entryType?: MarvinEntryType;
154
- collections?: MarvinCollection[];
155
- assets?: MarvinAsset[];
156
- resources?: MarvinResource[];
143
+ renderer?: string | null;
144
+ package?: string | null;
145
+ version?: string | null;
146
+ config?: Record<string, unknown> | null;
147
+ publishable: boolean;
148
+ submittable: boolean;
149
+ routable: boolean;
150
+ } | null;
151
+ summary?: string | null;
152
+ data: Record<string, unknown>;
153
+ publishedAt?: string | null;
154
+ metadataJson?: Record<string, unknown> | null;
155
+ collections: PublishedCollectionSummary[];
156
+ resources: PublishedResourceRead[];
157
+ assets: PublishedAssetRead[];
158
+ order?: number | null;
157
159
  }
158
160
  interface MarvinPublishResponse<T> {
159
161
  data: T;
@@ -191,23 +193,19 @@ interface PublishedEntryType {
191
193
  config?: Record<string, unknown>;
192
194
  };
193
195
  capabilities?: {
194
- publishable?: boolean;
195
- submittable?: boolean;
196
- routable?: boolean;
197
- };
196
+ publishable: boolean;
197
+ submittable: boolean;
198
+ routable: boolean;
199
+ } | null;
198
200
  }
199
201
  interface GetResourcesOptions {
200
202
  resourceType?: string;
201
203
  limit?: number;
202
204
  offset?: number;
203
205
  }
204
- /**
205
- * Authentication token response
206
- * Used by auth.login() and auth.refresh()
207
- */
208
206
  interface AuthToken {
209
207
  accessToken: string;
210
208
  tokenType: string;
211
209
  }
212
210
 
213
- export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset, PublishedEntryType };
211
+ export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryListItem, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAssetRead, PublishedCollectionSummary, PublishedEntryType, PublishedResourceRead };
@@ -4,81 +4,54 @@
4
4
  * TypeScript types for the Marvin publishing API responses.
5
5
  */
6
6
  interface MarvinSite {
7
- id: string;
8
- name: string;
9
- slug: string;
10
- title?: string;
11
- tagline?: string;
12
- description?: string;
13
- canonicalUrl?: string;
14
- logo?: string;
15
- favicon?: string;
16
- locale?: string;
17
- timezone?: string;
18
- metadata?: Record<string, unknown>;
7
+ workspace: {
8
+ slug: string;
9
+ name: string;
10
+ };
11
+ site: {
12
+ title?: string | null;
13
+ tagline?: string | null;
14
+ description?: string | null;
15
+ canonicalUrl?: string | null;
16
+ logo?: string | null;
17
+ favicon?: string | null;
18
+ locale: string;
19
+ timezone: string;
20
+ contactEmail?: string | null;
21
+ social?: Record<string, unknown> | null;
22
+ metadataJson?: Record<string, unknown> | null;
23
+ };
19
24
  }
20
25
  interface MarvinEntryType {
21
26
  id: string;
27
+ groupId: string | null;
22
28
  name: string;
23
29
  slug: string;
24
- icon?: string;
25
- color?: string;
26
- description?: string;
30
+ icon?: string | null;
31
+ color?: string | null;
32
+ description?: string | null;
27
33
  sortOrder: number;
28
34
  isSystem: boolean;
29
- /**
30
- * Schema definition for this entry type (schema-driven content model).
31
- * Defines what fields exist, their types, and validation rules.
32
- * @since 2.0.0
33
- */
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
+ isRendered: boolean;
36
+ schemaJson?: Record<string, unknown> | null;
37
+ renderingJson?: Record<string, unknown> | null;
38
+ capabilitiesJson?: Record<string, unknown> | null;
39
+ createdAt?: string | null;
40
+ updateAt?: string | null;
41
+ warnings?: string[] | null;
46
42
  }
47
43
  interface MarvinAsset {
48
- id: string;
49
- slug: string;
50
- name: string;
51
- originalFilename: string;
52
- filename: string;
53
- extension: string;
54
- mimeType: string;
55
- assetType: 'image' | 'document' | 'video' | 'audio' | 'archive' | 'svg' | 'other';
56
- fileSize: number;
57
- checksum: string;
58
- width?: number;
59
- height?: number;
60
- orientation?: number;
61
- storageProvider: string;
62
- storageKey: string;
63
- publicUrl?: string;
64
- altText?: string;
65
- description?: string;
66
- metadata?: Record<string, unknown>;
67
- uploadedBy: string;
68
- createdAt: string;
69
- updatedAt: string;
70
- }
71
- interface PublishedAsset {
72
44
  slug: string;
73
45
  name: string;
74
46
  mimeType: string;
75
47
  assetType: string;
76
48
  fileSize: number;
77
- width?: number;
78
- height?: number;
79
- altText?: string;
80
- description?: string;
49
+ width?: number | null;
50
+ height?: number | null;
51
+ altText?: string | null;
52
+ description?: string | null;
81
53
  publicUrl: string;
54
+ metadataJson?: Record<string, unknown> | null;
82
55
  }
83
56
  interface AssetUploadRequest {
84
57
  slug: string;
@@ -88,72 +61,101 @@ interface AssetUploadRequest {
88
61
  metadata?: Record<string, unknown>;
89
62
  }
90
63
  interface MarvinCollection {
91
- id: string;
92
- name: string;
93
64
  slug: string;
94
- description?: string;
95
- icon?: string;
96
- color?: string;
97
- sortOrder: number;
65
+ name: string;
66
+ description?: string | null;
98
67
  isSmart: boolean;
99
- smartRules?: Record<string, unknown>;
100
- createdAt: string;
101
- updatedAt: string;
102
- entryCount?: number;
103
- entries?: MarvinEntry[];
68
+ smartRules?: Record<string, unknown> | null;
69
+ metadataJson?: Record<string, unknown> | null;
70
+ entryCount: number;
71
+ entries: MarvinEntryListItem[];
104
72
  }
105
73
  interface MarvinResource {
106
- id: string;
74
+ slug: string;
107
75
  name: string;
76
+ resourceType: string;
77
+ description?: string | null;
78
+ url?: string | null;
79
+ externalId?: string | null;
80
+ metadataJson?: Record<string, unknown> | null;
81
+ entries: string[];
82
+ }
83
+ interface PublishedCollectionSummary {
108
84
  slug: string;
109
- resourceType?: string;
110
- description?: string;
111
- externalId?: string;
112
- url?: string;
113
- metadata?: Record<string, unknown>;
114
- createdAt: string;
115
- updatedAt: string;
85
+ name: string;
86
+ metadataJson?: Record<string, unknown> | null;
87
+ sortOrder: number;
116
88
  }
117
- interface MarvinEntry {
118
- id: string;
119
- title: string;
89
+ interface PublishedResourceRead {
120
90
  slug: string;
121
- summary?: string;
122
- description?: string;
123
- /**
124
- * Schema-driven content data structured according to entry type's schemaJson.
125
- * @since 2.0.0
126
- */
127
- dataJson?: Record<string, unknown>;
128
- /**
129
- * @deprecated Use dataJson instead. Will be removed in v3.0.0
130
- * @since 1.x
131
- */
132
- contentMarkdown?: string;
133
- /**
134
- * Custom non-schema metadata (API keys, external IDs, CMS-specific config).
135
- * For content fields, use dataJson instead.
136
- */
137
- metadata?: Record<string, unknown>;
91
+ name: string;
92
+ resourceType: string;
93
+ description?: string | null;
94
+ url?: string | null;
95
+ externalId?: string | null;
96
+ metadataJson?: Record<string, unknown> | null;
97
+ role?: string | null;
98
+ quantity?: string | null;
99
+ unit?: string | null;
100
+ position: number;
101
+ }
102
+ interface PublishedAssetRead {
103
+ slug: string;
104
+ name: string;
105
+ mimeType: string;
106
+ assetType: string;
107
+ fileSize: number;
108
+ width?: number | null;
109
+ height?: number | null;
110
+ altText?: string | null;
111
+ description?: string | null;
112
+ publicUrl: string;
113
+ metadataJson?: Record<string, unknown> | null;
114
+ }
115
+ interface MarvinEntryListItem {
116
+ slug: string;
117
+ title: string;
118
+ entryType: string;
119
+ entryTypeInfo?: {
120
+ slug: string;
121
+ renderer?: string | null;
122
+ package?: string | null;
123
+ version?: string | null;
124
+ config?: Record<string, unknown> | null;
125
+ publishable: boolean;
126
+ submittable: boolean;
127
+ routable: boolean;
128
+ } | null;
129
+ summary?: string | null;
130
+ publishedAt?: string | null;
138
131
  status: string;
139
- publishedAt?: string;
140
- createdAt: string;
141
- updatedAt: string;
132
+ collections: string[];
133
+ assetSlugs: string[];
134
+ resourceSlugs: string[];
135
+ order?: number | null;
136
+ }
137
+ interface MarvinEntry {
138
+ slug: string;
139
+ title: string;
140
+ entryType: string;
142
141
  entryTypeInfo?: {
143
142
  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
- };
152
- entryTypeId: string;
153
- entryType?: MarvinEntryType;
154
- collections?: MarvinCollection[];
155
- assets?: MarvinAsset[];
156
- resources?: MarvinResource[];
143
+ renderer?: string | null;
144
+ package?: string | null;
145
+ version?: string | null;
146
+ config?: Record<string, unknown> | null;
147
+ publishable: boolean;
148
+ submittable: boolean;
149
+ routable: boolean;
150
+ } | null;
151
+ summary?: string | null;
152
+ data: Record<string, unknown>;
153
+ publishedAt?: string | null;
154
+ metadataJson?: Record<string, unknown> | null;
155
+ collections: PublishedCollectionSummary[];
156
+ resources: PublishedResourceRead[];
157
+ assets: PublishedAssetRead[];
158
+ order?: number | null;
157
159
  }
158
160
  interface MarvinPublishResponse<T> {
159
161
  data: T;
@@ -191,23 +193,19 @@ interface PublishedEntryType {
191
193
  config?: Record<string, unknown>;
192
194
  };
193
195
  capabilities?: {
194
- publishable?: boolean;
195
- submittable?: boolean;
196
- routable?: boolean;
197
- };
196
+ publishable: boolean;
197
+ submittable: boolean;
198
+ routable: boolean;
199
+ } | null;
198
200
  }
199
201
  interface GetResourcesOptions {
200
202
  resourceType?: string;
201
203
  limit?: number;
202
204
  offset?: number;
203
205
  }
204
- /**
205
- * Authentication token response
206
- * Used by auth.login() and auth.refresh()
207
- */
208
206
  interface AuthToken {
209
207
  accessToken: string;
210
208
  tokenType: string;
211
209
  }
212
210
 
213
- export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset, PublishedEntryType };
211
+ export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryListItem, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAssetRead, PublishedCollectionSummary, PublishedEntryType, PublishedResourceRead };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inneropen/marvin-sdk",
3
- "version": "2.0.0-next.22",
3
+ "version": "2.0.0-next.24",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",