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

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.
@@ -141,113 +141,61 @@ var init_entry = __esm({
141
141
  "src/entries/entry.ts"() {
142
142
  "use strict";
143
143
  Entry = class {
144
- constructor(data, http, workspaceSlug) {
145
- this.data = data;
144
+ constructor(raw, http, workspaceSlug) {
145
+ this.raw = raw;
146
146
  this.http = http;
147
147
  this.workspaceSlug = workspaceSlug;
148
148
  }
149
- data;
149
+ raw;
150
150
  http;
151
151
  workspaceSlug;
152
- // Expose all entry data as properties
153
- get id() {
154
- return this.data.id;
155
- }
156
152
  get title() {
157
- return this.data.title;
153
+ return this.raw.title;
158
154
  }
159
155
  get slug() {
160
- return this.data.slug;
156
+ return this.raw.slug;
161
157
  }
162
158
  get summary() {
163
- return this.data.summary;
159
+ return this.raw.summary;
164
160
  }
165
- get description() {
166
- return this.data.description;
167
- }
168
- /**
169
- * @deprecated Use field('body') or dataJson instead. Will be removed in v3.0.0
170
- */
171
- get contentMarkdown() {
172
- return this.data.contentMarkdown;
161
+ get entryType() {
162
+ return this.raw.entryType;
173
163
  }
174
- /**
175
- * Schema-driven content data (replaces contentMarkdown in v2.0.0).
176
- * Access specific fields using the field() helper method.
177
- * @since 2.0.0
178
- */
179
- get dataJson() {
180
- return this.data.dataJson;
164
+ get entryTypeInfo() {
165
+ return this.raw.entryTypeInfo;
181
166
  }
182
- get metadata() {
183
- return this.data.metadata;
167
+ get data() {
168
+ return this.raw.data;
184
169
  }
185
- get status() {
186
- return this.data.status;
170
+ get metadataJson() {
171
+ return this.raw.metadataJson;
187
172
  }
188
173
  get publishedAt() {
189
- return this.data.publishedAt;
190
- }
191
- get createdAt() {
192
- return this.data.createdAt;
193
- }
194
- get updatedAt() {
195
- return this.data.updatedAt;
196
- }
197
- get entryTypeId() {
198
- return this.data.entryTypeId;
174
+ return this.raw.publishedAt;
199
175
  }
200
- get entryType() {
201
- return this.data.entryType;
176
+ get order() {
177
+ return this.raw.order;
202
178
  }
203
- /**
204
- * Get entry assets
205
- */
206
179
  get assets() {
207
- return this.data.assets || [];
180
+ return this.raw.assets;
208
181
  }
209
- /**
210
- * Get entry collections
211
- */
212
182
  get collections() {
213
- return this.data.collections || [];
183
+ return this.raw.collections;
184
+ }
185
+ get resources() {
186
+ return this.raw.resources;
214
187
  }
215
- /**
216
- * Get a specific field value from the entry's schema-driven content (dataJson).
217
- *
218
- * @param key - Field key as defined in the entry type's schema
219
- * @returns The field value, or undefined if not present
220
- * @since 2.0.0
221
- *
222
- * @example
223
- * ```typescript
224
- * const entry = await client.entries.get('my-entry');
225
- * const body = entry.field('body'); // Get markdown body
226
- * const difficulty = entry.field('difficulty'); // Get difficulty level
227
- * const heroImage = entry.field('heroImage'); // Get hero image UUID
228
- * ```
229
- */
230
188
  field(key) {
231
- return this.data.dataJson?.[key];
189
+ return this.raw.data[key];
232
190
  }
233
- /**
234
- * Get all fields from the entry's schema-driven content.
235
- * @since 2.0.0
236
- */
237
191
  get fields() {
238
- return this.data.dataJson || {};
192
+ return this.raw.data;
239
193
  }
240
- /**
241
- * Get related entries (future)
242
- */
243
194
  async relatedEntries() {
244
195
  throw new Error("Related entries not yet implemented");
245
196
  }
246
- /**
247
- * Get raw entry data
248
- */
249
197
  toJSON() {
250
- return this.data;
198
+ return this.raw;
251
199
  }
252
200
  };
253
201
  }
package/dist/index.cjs CHANGED
@@ -869,113 +869,61 @@ var init_entry = __esm({
869
869
  "src/entries/entry.ts"() {
870
870
  "use strict";
871
871
  Entry = class {
872
- constructor(data, http, workspaceSlug) {
873
- this.data = data;
872
+ constructor(raw, http, workspaceSlug) {
873
+ this.raw = raw;
874
874
  this.http = http;
875
875
  this.workspaceSlug = workspaceSlug;
876
876
  }
877
- data;
877
+ raw;
878
878
  http;
879
879
  workspaceSlug;
880
- // Expose all entry data as properties
881
- get id() {
882
- return this.data.id;
883
- }
884
880
  get title() {
885
- return this.data.title;
881
+ return this.raw.title;
886
882
  }
887
883
  get slug() {
888
- return this.data.slug;
884
+ return this.raw.slug;
889
885
  }
890
886
  get summary() {
891
- return this.data.summary;
892
- }
893
- get description() {
894
- return this.data.description;
887
+ return this.raw.summary;
895
888
  }
896
- /**
897
- * @deprecated Use field('body') or dataJson instead. Will be removed in v3.0.0
898
- */
899
- get contentMarkdown() {
900
- return this.data.contentMarkdown;
889
+ get entryType() {
890
+ return this.raw.entryType;
901
891
  }
902
- /**
903
- * Schema-driven content data (replaces contentMarkdown in v2.0.0).
904
- * Access specific fields using the field() helper method.
905
- * @since 2.0.0
906
- */
907
- get dataJson() {
908
- return this.data.dataJson;
892
+ get entryTypeInfo() {
893
+ return this.raw.entryTypeInfo;
909
894
  }
910
- get metadata() {
911
- return this.data.metadata;
895
+ get data() {
896
+ return this.raw.data;
912
897
  }
913
- get status() {
914
- return this.data.status;
898
+ get metadataJson() {
899
+ return this.raw.metadataJson;
915
900
  }
916
901
  get publishedAt() {
917
- return this.data.publishedAt;
918
- }
919
- get createdAt() {
920
- return this.data.createdAt;
921
- }
922
- get updatedAt() {
923
- return this.data.updatedAt;
902
+ return this.raw.publishedAt;
924
903
  }
925
- get entryTypeId() {
926
- return this.data.entryTypeId;
904
+ get order() {
905
+ return this.raw.order;
927
906
  }
928
- get entryType() {
929
- return this.data.entryType;
930
- }
931
- /**
932
- * Get entry assets
933
- */
934
907
  get assets() {
935
- return this.data.assets || [];
908
+ return this.raw.assets;
936
909
  }
937
- /**
938
- * Get entry collections
939
- */
940
910
  get collections() {
941
- return this.data.collections || [];
911
+ return this.raw.collections;
912
+ }
913
+ get resources() {
914
+ return this.raw.resources;
942
915
  }
943
- /**
944
- * Get a specific field value from the entry's schema-driven content (dataJson).
945
- *
946
- * @param key - Field key as defined in the entry type's schema
947
- * @returns The field value, or undefined if not present
948
- * @since 2.0.0
949
- *
950
- * @example
951
- * ```typescript
952
- * const entry = await client.entries.get('my-entry');
953
- * const body = entry.field('body'); // Get markdown body
954
- * const difficulty = entry.field('difficulty'); // Get difficulty level
955
- * const heroImage = entry.field('heroImage'); // Get hero image UUID
956
- * ```
957
- */
958
916
  field(key) {
959
- return this.data.dataJson?.[key];
917
+ return this.raw.data[key];
960
918
  }
961
- /**
962
- * Get all fields from the entry's schema-driven content.
963
- * @since 2.0.0
964
- */
965
919
  get fields() {
966
- return this.data.dataJson || {};
920
+ return this.raw.data;
967
921
  }
968
- /**
969
- * Get related entries (future)
970
- */
971
922
  async relatedEntries() {
972
923
  throw new Error("Related entries not yet implemented");
973
924
  }
974
- /**
975
- * Get raw entry data
976
- */
977
925
  toJSON() {
978
- return this.data;
926
+ return this.raw;
979
927
  }
980
928
  };
981
929
  }
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
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';
1
+ import { M as MarvinConfig, a as MarvinClient } from './marvin-ixVRMtIS.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-ixVRMtIS.cjs';
3
3
  import { H as HttpClient } from './HttpClient-CdF3IHM1.cjs';
4
4
  export { A as AuthStrategy, B as BearerTokenAuth, a as HttpClientConfig, N as NoAuth, S as SessionAuth } from './HttpClient-CdF3IHM1.cjs';
5
5
  import { AuthToken as AuthToken$1 } from './types/index.cjs';
6
- export { GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedEntryType } from './types/index.cjs';
6
+ export { GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAssetRead, PublishedCollectionSummary, PublishedEntryType, PublishedResourceRead } from './types/index.cjs';
7
7
 
8
8
  /**
9
9
  * Authentication & User Registration
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
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';
1
+ import { M as MarvinConfig, a as MarvinClient } from './marvin-B6kWCfmU.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-B6kWCfmU.js';
3
3
  import { H as HttpClient } from './HttpClient-CdF3IHM1.js';
4
4
  export { A as AuthStrategy, B as BearerTokenAuth, a as HttpClientConfig, N as NoAuth, S as SessionAuth } from './HttpClient-CdF3IHM1.js';
5
5
  import { AuthToken as AuthToken$1 } from './types/index.js';
6
- export { GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedEntryType } from './types/index.js';
6
+ export { GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAssetRead, PublishedCollectionSummary, PublishedEntryType, PublishedResourceRead } from './types/index.js';
7
7
 
8
8
  /**
9
9
  * Authentication & User Registration
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  init_resource,
14
14
  init_workspace,
15
15
  marvin_exports
16
- } from "./chunk-SGZG7U7V.js";
16
+ } from "./chunk-CIFRKLJS.js";
17
17
  import {
18
18
  BearerTokenAuth,
19
19
  HttpClient,
@@ -1,4 +1,4 @@
1
- import { PublishedEntryType, MarvinResource, MarvinEntry, MarvinAsset, MarvinCollection, MarvinEntryType, MarvinSite, GetResourcesOptions as GetResourcesOptions$1 } from './types/index.js';
1
+ import { PublishedEntryType, MarvinResource, MarvinEntry, MarvinAsset, MarvinCollection, PublishedAssetRead, PublishedCollectionSummary, PublishedResourceRead, MarvinSite, GetResourcesOptions as GetResourcesOptions$1 } from './types/index.js';
2
2
  import { H as HttpClient } from './HttpClient-CdF3IHM1.js';
3
3
 
4
4
  /**
@@ -380,69 +380,39 @@ declare class CollectionsModule {
380
380
  }): Promise<MarvinEntry[]>;
381
381
  }
382
382
 
383
+ /**
384
+ * Entry - Rich object representing a single entry
385
+ */
386
+
383
387
  declare class Entry {
384
- private data;
388
+ private raw;
385
389
  private http;
386
390
  private workspaceSlug;
387
- constructor(data: MarvinEntry, http: MarvinHttpClient, workspaceSlug: string);
388
- get id(): string;
391
+ constructor(raw: MarvinEntry, http: MarvinHttpClient, workspaceSlug: string);
389
392
  get title(): string;
390
393
  get slug(): string;
391
- get summary(): string | undefined;
392
- get description(): string | undefined;
393
- /**
394
- * @deprecated Use field('body') or dataJson instead. Will be removed in v3.0.0
395
- */
396
- get contentMarkdown(): string | undefined;
397
- /**
398
- * Schema-driven content data (replaces contentMarkdown in v2.0.0).
399
- * Access specific fields using the field() helper method.
400
- * @since 2.0.0
401
- */
402
- get dataJson(): Record<string, unknown> | undefined;
403
- get metadata(): Record<string, unknown> | undefined;
404
- get status(): string;
405
- get publishedAt(): string | undefined;
406
- get createdAt(): string;
407
- get updatedAt(): string;
408
- get entryTypeId(): string;
409
- get entryType(): MarvinEntryType | undefined;
410
- /**
411
- * Get entry assets
412
- */
413
- get assets(): MarvinAsset[];
414
- /**
415
- * Get entry collections
416
- */
417
- get collections(): MarvinCollection[];
418
- /**
419
- * Get a specific field value from the entry's schema-driven content (dataJson).
420
- *
421
- * @param key - Field key as defined in the entry type's schema
422
- * @returns The field value, or undefined if not present
423
- * @since 2.0.0
424
- *
425
- * @example
426
- * ```typescript
427
- * const entry = await client.entries.get('my-entry');
428
- * const body = entry.field('body'); // Get markdown body
429
- * const difficulty = entry.field('difficulty'); // Get difficulty level
430
- * const heroImage = entry.field('heroImage'); // Get hero image UUID
431
- * ```
432
- */
394
+ get summary(): string | null | undefined;
395
+ get entryType(): string;
396
+ get entryTypeInfo(): {
397
+ slug: string;
398
+ renderer?: string | null;
399
+ package?: string | null;
400
+ version?: string | null;
401
+ config?: Record<string, unknown> | null;
402
+ publishable: boolean;
403
+ submittable: boolean;
404
+ routable: boolean;
405
+ } | null | undefined;
406
+ get data(): Record<string, unknown>;
407
+ get metadataJson(): Record<string, unknown> | null | undefined;
408
+ get publishedAt(): string | null | undefined;
409
+ get order(): number | null | undefined;
410
+ get assets(): PublishedAssetRead[];
411
+ get collections(): PublishedCollectionSummary[];
412
+ get resources(): PublishedResourceRead[];
433
413
  field<T = unknown>(key: string): T | undefined;
434
- /**
435
- * Get all fields from the entry's schema-driven content.
436
- * @since 2.0.0
437
- */
438
414
  get fields(): Record<string, unknown>;
439
- /**
440
- * Get related entries (future)
441
- */
442
415
  relatedEntries(): Promise<MarvinEntry[]>;
443
- /**
444
- * Get raw entry data
445
- */
446
416
  toJSON(): MarvinEntry;
447
417
  }
448
418
 
@@ -1,4 +1,4 @@
1
- import { PublishedEntryType, MarvinResource, MarvinEntry, MarvinAsset, MarvinCollection, MarvinEntryType, MarvinSite, GetResourcesOptions as GetResourcesOptions$1 } from './types/index.cjs';
1
+ import { PublishedEntryType, MarvinResource, MarvinEntry, MarvinAsset, MarvinCollection, PublishedAssetRead, PublishedCollectionSummary, PublishedResourceRead, MarvinSite, GetResourcesOptions as GetResourcesOptions$1 } from './types/index.cjs';
2
2
  import { H as HttpClient } from './HttpClient-CdF3IHM1.cjs';
3
3
 
4
4
  /**
@@ -380,69 +380,39 @@ declare class CollectionsModule {
380
380
  }): Promise<MarvinEntry[]>;
381
381
  }
382
382
 
383
+ /**
384
+ * Entry - Rich object representing a single entry
385
+ */
386
+
383
387
  declare class Entry {
384
- private data;
388
+ private raw;
385
389
  private http;
386
390
  private workspaceSlug;
387
- constructor(data: MarvinEntry, http: MarvinHttpClient, workspaceSlug: string);
388
- get id(): string;
391
+ constructor(raw: MarvinEntry, http: MarvinHttpClient, workspaceSlug: string);
389
392
  get title(): string;
390
393
  get slug(): string;
391
- get summary(): string | undefined;
392
- get description(): string | undefined;
393
- /**
394
- * @deprecated Use field('body') or dataJson instead. Will be removed in v3.0.0
395
- */
396
- get contentMarkdown(): string | undefined;
397
- /**
398
- * Schema-driven content data (replaces contentMarkdown in v2.0.0).
399
- * Access specific fields using the field() helper method.
400
- * @since 2.0.0
401
- */
402
- get dataJson(): Record<string, unknown> | undefined;
403
- get metadata(): Record<string, unknown> | undefined;
404
- get status(): string;
405
- get publishedAt(): string | undefined;
406
- get createdAt(): string;
407
- get updatedAt(): string;
408
- get entryTypeId(): string;
409
- get entryType(): MarvinEntryType | undefined;
410
- /**
411
- * Get entry assets
412
- */
413
- get assets(): MarvinAsset[];
414
- /**
415
- * Get entry collections
416
- */
417
- get collections(): MarvinCollection[];
418
- /**
419
- * Get a specific field value from the entry's schema-driven content (dataJson).
420
- *
421
- * @param key - Field key as defined in the entry type's schema
422
- * @returns The field value, or undefined if not present
423
- * @since 2.0.0
424
- *
425
- * @example
426
- * ```typescript
427
- * const entry = await client.entries.get('my-entry');
428
- * const body = entry.field('body'); // Get markdown body
429
- * const difficulty = entry.field('difficulty'); // Get difficulty level
430
- * const heroImage = entry.field('heroImage'); // Get hero image UUID
431
- * ```
432
- */
394
+ get summary(): string | null | undefined;
395
+ get entryType(): string;
396
+ get entryTypeInfo(): {
397
+ slug: string;
398
+ renderer?: string | null;
399
+ package?: string | null;
400
+ version?: string | null;
401
+ config?: Record<string, unknown> | null;
402
+ publishable: boolean;
403
+ submittable: boolean;
404
+ routable: boolean;
405
+ } | null | undefined;
406
+ get data(): Record<string, unknown>;
407
+ get metadataJson(): Record<string, unknown> | null | undefined;
408
+ get publishedAt(): string | null | undefined;
409
+ get order(): number | null | undefined;
410
+ get assets(): PublishedAssetRead[];
411
+ get collections(): PublishedCollectionSummary[];
412
+ get resources(): PublishedResourceRead[];
433
413
  field<T = unknown>(key: string): T | undefined;
434
- /**
435
- * Get all fields from the entry's schema-driven content.
436
- * @since 2.0.0
437
- */
438
414
  get fields(): Record<string, unknown>;
439
- /**
440
- * Get related entries (future)
441
- */
442
415
  relatedEntries(): Promise<MarvinEntry[]>;
443
- /**
444
- * Get raw entry data
445
- */
446
416
  toJSON(): MarvinEntry;
447
417
  }
448
418
 
@@ -3637,6 +3637,7 @@ interface EntryTypeCreate {
3637
3637
  icon?: string;
3638
3638
  color?: string;
3639
3639
  sortOrder?: number;
3640
+ isSystem?: boolean;
3640
3641
  isRendered?: boolean;
3641
3642
  schemaJson?: Record<string, unknown>;
3642
3643
  renderingJson?: Record<string, unknown>;
@@ -3637,6 +3637,7 @@ interface EntryTypeCreate {
3637
3637
  icon?: string;
3638
3638
  color?: string;
3639
3639
  sortOrder?: number;
3640
+ isSystem?: boolean;
3640
3641
  isRendered?: boolean;
3641
3642
  schemaJson?: Record<string, unknown>;
3642
3643
  renderingJson?: Record<string, unknown>;
package/dist/publish.cjs CHANGED
@@ -724,113 +724,61 @@ var MarvinHttpClient = class extends HttpClient {
724
724
 
725
725
  // src/entries/entry.ts
726
726
  var Entry = class {
727
- constructor(data, http, workspaceSlug) {
728
- this.data = data;
727
+ constructor(raw, http, workspaceSlug) {
728
+ this.raw = raw;
729
729
  this.http = http;
730
730
  this.workspaceSlug = workspaceSlug;
731
731
  }
732
- data;
732
+ raw;
733
733
  http;
734
734
  workspaceSlug;
735
- // Expose all entry data as properties
736
- get id() {
737
- return this.data.id;
738
- }
739
735
  get title() {
740
- return this.data.title;
736
+ return this.raw.title;
741
737
  }
742
738
  get slug() {
743
- return this.data.slug;
739
+ return this.raw.slug;
744
740
  }
745
741
  get summary() {
746
- return this.data.summary;
747
- }
748
- get description() {
749
- return this.data.description;
742
+ return this.raw.summary;
750
743
  }
751
- /**
752
- * @deprecated Use field('body') or dataJson instead. Will be removed in v3.0.0
753
- */
754
- get contentMarkdown() {
755
- return this.data.contentMarkdown;
744
+ get entryType() {
745
+ return this.raw.entryType;
756
746
  }
757
- /**
758
- * Schema-driven content data (replaces contentMarkdown in v2.0.0).
759
- * Access specific fields using the field() helper method.
760
- * @since 2.0.0
761
- */
762
- get dataJson() {
763
- return this.data.dataJson;
747
+ get entryTypeInfo() {
748
+ return this.raw.entryTypeInfo;
764
749
  }
765
- get metadata() {
766
- return this.data.metadata;
750
+ get data() {
751
+ return this.raw.data;
767
752
  }
768
- get status() {
769
- return this.data.status;
753
+ get metadataJson() {
754
+ return this.raw.metadataJson;
770
755
  }
771
756
  get publishedAt() {
772
- return this.data.publishedAt;
773
- }
774
- get createdAt() {
775
- return this.data.createdAt;
776
- }
777
- get updatedAt() {
778
- return this.data.updatedAt;
757
+ return this.raw.publishedAt;
779
758
  }
780
- get entryTypeId() {
781
- return this.data.entryTypeId;
759
+ get order() {
760
+ return this.raw.order;
782
761
  }
783
- get entryType() {
784
- return this.data.entryType;
785
- }
786
- /**
787
- * Get entry assets
788
- */
789
762
  get assets() {
790
- return this.data.assets || [];
763
+ return this.raw.assets;
791
764
  }
792
- /**
793
- * Get entry collections
794
- */
795
765
  get collections() {
796
- return this.data.collections || [];
766
+ return this.raw.collections;
767
+ }
768
+ get resources() {
769
+ return this.raw.resources;
797
770
  }
798
- /**
799
- * Get a specific field value from the entry's schema-driven content (dataJson).
800
- *
801
- * @param key - Field key as defined in the entry type's schema
802
- * @returns The field value, or undefined if not present
803
- * @since 2.0.0
804
- *
805
- * @example
806
- * ```typescript
807
- * const entry = await client.entries.get('my-entry');
808
- * const body = entry.field('body'); // Get markdown body
809
- * const difficulty = entry.field('difficulty'); // Get difficulty level
810
- * const heroImage = entry.field('heroImage'); // Get hero image UUID
811
- * ```
812
- */
813
771
  field(key) {
814
- return this.data.dataJson?.[key];
772
+ return this.raw.data[key];
815
773
  }
816
- /**
817
- * Get all fields from the entry's schema-driven content.
818
- * @since 2.0.0
819
- */
820
774
  get fields() {
821
- return this.data.dataJson || {};
775
+ return this.raw.data;
822
776
  }
823
- /**
824
- * Get related entries (future)
825
- */
826
777
  async relatedEntries() {
827
778
  throw new Error("Related entries not yet implemented");
828
779
  }
829
- /**
830
- * Get raw entry data
831
- */
832
780
  toJSON() {
833
- return this.data;
781
+ return this.raw;
834
782
  }
835
783
  };
836
784
 
@@ -1,6 +1,6 @@
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';
1
+ import { M as MarvinConfig, a as MarvinClient } from './marvin-ixVRMtIS.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-ixVRMtIS.cjs';
3
+ export { GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAssetRead, PublishedCollectionSummary, PublishedResourceRead } from './types/index.cjs';
4
4
  export { A as AuthStrategy, B as BearerTokenAuth, H as HttpClient, a as HttpClientConfig } from './HttpClient-CdF3IHM1.cjs';
5
5
 
6
6
  /**
package/dist/publish.d.ts CHANGED
@@ -1,6 +1,6 @@
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';
1
+ import { M as MarvinConfig, a as MarvinClient } from './marvin-B6kWCfmU.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-B6kWCfmU.js';
3
+ export { GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAssetRead, PublishedCollectionSummary, PublishedResourceRead } from './types/index.js';
4
4
  export { A as AuthStrategy, B as BearerTokenAuth, H as HttpClient, a as HttpClientConfig } from './HttpClient-CdF3IHM1.js';
5
5
 
6
6
  /**
package/dist/publish.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  init_marvin,
13
13
  init_resource,
14
14
  init_workspace
15
- } from "./chunk-SGZG7U7V.js";
15
+ } from "./chunk-CIFRKLJS.js";
16
16
  import {
17
17
  BearerTokenAuth,
18
18
  HttpClient,
@@ -19,30 +19,21 @@ interface MarvinSite {
19
19
  }
20
20
  interface MarvinEntryType {
21
21
  id: string;
22
+ groupId: string | null;
22
23
  name: string;
23
24
  slug: string;
24
- icon?: string;
25
- color?: string;
26
- description?: string;
25
+ icon?: string | null;
26
+ color?: string | null;
27
+ description?: string | null;
27
28
  sortOrder: number;
28
29
  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
- };
30
+ isRendered: boolean;
31
+ schemaJson?: Record<string, unknown> | null;
32
+ renderingJson?: Record<string, unknown> | null;
33
+ capabilitiesJson?: Record<string, unknown> | null;
34
+ createdAt?: string | null;
35
+ updateAt?: string | null;
36
+ warnings?: string[] | null;
46
37
  }
47
38
  interface MarvinAsset {
48
39
  id: string;
@@ -114,46 +105,60 @@ interface MarvinResource {
114
105
  createdAt: string;
115
106
  updatedAt: string;
116
107
  }
108
+ interface PublishedCollectionSummary {
109
+ slug: string;
110
+ name: string;
111
+ metadataJson?: Record<string, unknown> | null;
112
+ sortOrder: number;
113
+ }
114
+ interface PublishedResourceRead {
115
+ slug: string;
116
+ name: string;
117
+ resourceType: string;
118
+ description?: string | null;
119
+ url?: string | null;
120
+ externalId?: string | null;
121
+ metadataJson?: Record<string, unknown> | null;
122
+ role?: string | null;
123
+ quantity?: string | null;
124
+ unit?: string | null;
125
+ position: number;
126
+ }
127
+ interface PublishedAssetRead {
128
+ slug: string;
129
+ name: string;
130
+ mimeType: string;
131
+ assetType: string;
132
+ fileSize: number;
133
+ width?: number | null;
134
+ height?: number | null;
135
+ altText?: string | null;
136
+ description?: string | null;
137
+ publicUrl: string;
138
+ metadataJson?: Record<string, unknown> | null;
139
+ }
117
140
  interface MarvinEntry {
118
- id: string;
119
- title: string;
120
141
  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>;
138
- status: string;
139
- publishedAt?: string;
140
- createdAt: string;
141
- updatedAt: string;
142
+ title: string;
143
+ entryType: string;
142
144
  entryTypeInfo?: {
143
145
  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[];
146
+ renderer?: string | null;
147
+ package?: string | null;
148
+ version?: string | null;
149
+ config?: Record<string, unknown> | null;
150
+ publishable: boolean;
151
+ submittable: boolean;
152
+ routable: boolean;
153
+ } | null;
154
+ summary?: string | null;
155
+ data: Record<string, unknown>;
156
+ publishedAt?: string | null;
157
+ metadataJson?: Record<string, unknown> | null;
158
+ collections: PublishedCollectionSummary[];
159
+ resources: PublishedResourceRead[];
160
+ assets: PublishedAssetRead[];
161
+ order?: number | null;
157
162
  }
158
163
  interface MarvinPublishResponse<T> {
159
164
  data: T;
@@ -191,10 +196,10 @@ interface PublishedEntryType {
191
196
  config?: Record<string, unknown>;
192
197
  };
193
198
  capabilities?: {
194
- publishable?: boolean;
195
- submittable?: boolean;
196
- routable?: boolean;
197
- };
199
+ publishable: boolean;
200
+ submittable: boolean;
201
+ routable: boolean;
202
+ } | null;
198
203
  }
199
204
  interface GetResourcesOptions {
200
205
  resourceType?: string;
@@ -210,4 +215,4 @@ interface AuthToken {
210
215
  tokenType: string;
211
216
  }
212
217
 
213
- export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset, PublishedEntryType };
218
+ export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset, PublishedAssetRead, PublishedCollectionSummary, PublishedEntryType, PublishedResourceRead };
@@ -19,30 +19,21 @@ interface MarvinSite {
19
19
  }
20
20
  interface MarvinEntryType {
21
21
  id: string;
22
+ groupId: string | null;
22
23
  name: string;
23
24
  slug: string;
24
- icon?: string;
25
- color?: string;
26
- description?: string;
25
+ icon?: string | null;
26
+ color?: string | null;
27
+ description?: string | null;
27
28
  sortOrder: number;
28
29
  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
- };
30
+ isRendered: boolean;
31
+ schemaJson?: Record<string, unknown> | null;
32
+ renderingJson?: Record<string, unknown> | null;
33
+ capabilitiesJson?: Record<string, unknown> | null;
34
+ createdAt?: string | null;
35
+ updateAt?: string | null;
36
+ warnings?: string[] | null;
46
37
  }
47
38
  interface MarvinAsset {
48
39
  id: string;
@@ -114,46 +105,60 @@ interface MarvinResource {
114
105
  createdAt: string;
115
106
  updatedAt: string;
116
107
  }
108
+ interface PublishedCollectionSummary {
109
+ slug: string;
110
+ name: string;
111
+ metadataJson?: Record<string, unknown> | null;
112
+ sortOrder: number;
113
+ }
114
+ interface PublishedResourceRead {
115
+ slug: string;
116
+ name: string;
117
+ resourceType: string;
118
+ description?: string | null;
119
+ url?: string | null;
120
+ externalId?: string | null;
121
+ metadataJson?: Record<string, unknown> | null;
122
+ role?: string | null;
123
+ quantity?: string | null;
124
+ unit?: string | null;
125
+ position: number;
126
+ }
127
+ interface PublishedAssetRead {
128
+ slug: string;
129
+ name: string;
130
+ mimeType: string;
131
+ assetType: string;
132
+ fileSize: number;
133
+ width?: number | null;
134
+ height?: number | null;
135
+ altText?: string | null;
136
+ description?: string | null;
137
+ publicUrl: string;
138
+ metadataJson?: Record<string, unknown> | null;
139
+ }
117
140
  interface MarvinEntry {
118
- id: string;
119
- title: string;
120
141
  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>;
138
- status: string;
139
- publishedAt?: string;
140
- createdAt: string;
141
- updatedAt: string;
142
+ title: string;
143
+ entryType: string;
142
144
  entryTypeInfo?: {
143
145
  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[];
146
+ renderer?: string | null;
147
+ package?: string | null;
148
+ version?: string | null;
149
+ config?: Record<string, unknown> | null;
150
+ publishable: boolean;
151
+ submittable: boolean;
152
+ routable: boolean;
153
+ } | null;
154
+ summary?: string | null;
155
+ data: Record<string, unknown>;
156
+ publishedAt?: string | null;
157
+ metadataJson?: Record<string, unknown> | null;
158
+ collections: PublishedCollectionSummary[];
159
+ resources: PublishedResourceRead[];
160
+ assets: PublishedAssetRead[];
161
+ order?: number | null;
157
162
  }
158
163
  interface MarvinPublishResponse<T> {
159
164
  data: T;
@@ -191,10 +196,10 @@ interface PublishedEntryType {
191
196
  config?: Record<string, unknown>;
192
197
  };
193
198
  capabilities?: {
194
- publishable?: boolean;
195
- submittable?: boolean;
196
- routable?: boolean;
197
- };
199
+ publishable: boolean;
200
+ submittable: boolean;
201
+ routable: boolean;
202
+ } | null;
198
203
  }
199
204
  interface GetResourcesOptions {
200
205
  resourceType?: string;
@@ -210,4 +215,4 @@ interface AuthToken {
210
215
  tokenType: string;
211
216
  }
212
217
 
213
- export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset, PublishedEntryType };
218
+ export type { AssetUploadRequest, AuthToken, GetAssetsOptions, GetEntriesOptions, GetResourcesOptions, MarvinAsset, MarvinClientConfig, MarvinCollection, MarvinEntry, MarvinEntryType, MarvinPublishResponse, MarvinResource, MarvinSite, PublishedAsset, 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.23",
4
4
  "description": "Official TypeScript SDK for Marvin CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",