@storyblok/management-api-client 0.2.4 → 1.0.0-alpha.1

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.
Files changed (74) hide show
  1. package/dist/client.cjs +190 -0
  2. package/dist/client.cjs.map +1 -0
  3. package/dist/client.d.cts +624 -0
  4. package/dist/client.d.mts +624 -0
  5. package/dist/client.mjs +189 -0
  6. package/dist/client.mjs.map +1 -0
  7. package/dist/error.cjs.map +1 -1
  8. package/dist/error.d.cts +12 -2
  9. package/dist/error.d.mts +12 -2
  10. package/dist/error.mjs.map +1 -1
  11. package/dist/generated/asset_folders/types.gen.d.cts +5 -31
  12. package/dist/generated/asset_folders/types.gen.d.mts +5 -31
  13. package/dist/generated/assets/types.gen.d.cts +1 -73
  14. package/dist/generated/assets/types.gen.d.mts +1 -73
  15. package/dist/generated/component_folders/types.gen.d.cts +29 -45
  16. package/dist/generated/component_folders/types.gen.d.mts +29 -45
  17. package/dist/generated/components/types.gen.d.cts +636 -465
  18. package/dist/generated/components/types.gen.d.mts +636 -465
  19. package/dist/generated/datasource_entries/types.gen.d.cts +6 -32
  20. package/dist/generated/datasource_entries/types.gen.d.mts +6 -32
  21. package/dist/generated/datasources/types.gen.d.cts +18 -39
  22. package/dist/generated/datasources/types.gen.d.mts +18 -39
  23. package/dist/generated/internal_tags/types.gen.d.cts +28 -32
  24. package/dist/generated/internal_tags/types.gen.d.mts +28 -32
  25. package/dist/generated/presets/types.gen.d.cts +53 -58
  26. package/dist/generated/presets/types.gen.d.mts +53 -58
  27. package/dist/generated/spaces/types.gen.d.cts +1 -41
  28. package/dist/generated/spaces/types.gen.d.mts +1 -41
  29. package/dist/generated/stories/types.gen.d.cts +206 -198
  30. package/dist/generated/stories/types.gen.d.mts +206 -198
  31. package/dist/generated/users/types.gen.d.cts +13 -112
  32. package/dist/generated/users/types.gen.d.mts +13 -112
  33. package/dist/index.cjs +3 -178
  34. package/dist/index.d.cts +8 -425
  35. package/dist/index.d.mts +8 -425
  36. package/dist/index.mjs +2 -176
  37. package/dist/resources/asset-folders.cjs.map +1 -1
  38. package/dist/resources/asset-folders.mjs.map +1 -1
  39. package/dist/resources/assets.cjs +11 -2
  40. package/dist/resources/assets.cjs.map +1 -1
  41. package/dist/resources/assets.d.cts +3 -2
  42. package/dist/resources/assets.d.mts +3 -2
  43. package/dist/resources/assets.mjs +11 -2
  44. package/dist/resources/assets.mjs.map +1 -1
  45. package/dist/resources/component-folders.cjs.map +1 -1
  46. package/dist/resources/component-folders.mjs.map +1 -1
  47. package/dist/resources/components.cjs.map +1 -1
  48. package/dist/resources/components.mjs.map +1 -1
  49. package/dist/resources/datasource-entries.cjs.map +1 -1
  50. package/dist/resources/datasource-entries.mjs.map +1 -1
  51. package/dist/resources/datasources.cjs.map +1 -1
  52. package/dist/resources/datasources.mjs.map +1 -1
  53. package/dist/resources/internal-tags.cjs.map +1 -1
  54. package/dist/resources/internal-tags.mjs.map +1 -1
  55. package/dist/resources/presets.cjs.map +1 -1
  56. package/dist/resources/presets.mjs.map +1 -1
  57. package/dist/resources/spaces.cjs.map +1 -1
  58. package/dist/resources/spaces.mjs.map +1 -1
  59. package/dist/resources/stories.cjs.map +1 -1
  60. package/dist/resources/stories.d.cts +105 -0
  61. package/dist/resources/stories.d.mts +105 -0
  62. package/dist/resources/stories.mjs.map +1 -1
  63. package/dist/resources/users.cjs.map +1 -1
  64. package/dist/resources/users.mjs.map +1 -1
  65. package/package.json +13 -10
  66. package/test/GUIDE.md +59 -0
  67. package/test/setup.e2e.ts +11 -0
  68. package/test/specs/mapi-round-trip.spec.e2e.ts +520 -0
  69. package/vitest.config.e2e.ts +26 -0
  70. package/vitest.config.ts +3 -0
  71. package/dist/index.cjs.map +0 -1
  72. package/dist/index.mjs.map +0 -1
  73. package/dist/types.d.cts +0 -130
  74. package/dist/types.d.mts +0 -130
@@ -15,18 +15,16 @@ type DatasourceEntry = {
15
15
  /**
16
16
  * The numeric ID of the datasource
17
17
  */
18
- datasource_id: number;
18
+ datasource_id?: number;
19
19
  /**
20
20
  * Given value in the requested dimension
21
21
  */
22
22
  dimension_value?: string;
23
23
  };
24
- type DatasourceEntryCreate = DatasourceEntryCreate2;
25
- type DatasourceEntryUpdate = DatasourceEntryUpdate2;
26
24
  /**
27
25
  * Input for creating a datasource entry.
28
26
  */
29
- type DatasourceEntryCreate2 = {
27
+ type DatasourceEntryCreate = {
30
28
  /**
31
29
  * The key name of the datasource entry
32
30
  */
@@ -47,7 +45,7 @@ type DatasourceEntryCreate2 = {
47
45
  /**
48
46
  * Input for updating a datasource entry.
49
47
  */
50
- type DatasourceEntryUpdate2 = {
48
+ type DatasourceEntryUpdate = {
51
49
  /**
52
50
  * The key name of the datasource entry
53
51
  */
@@ -97,17 +95,9 @@ type ListData = {
97
95
  };
98
96
  url: '/v1/spaces/{space_id}/datasource_entries';
99
97
  };
100
- type ListResponses = {
101
- /**
102
- * List of datasource entries
103
- */
104
- 200: {
105
- datasource_entries?: Array<DatasourceEntry>;
106
- };
107
- };
108
98
  type CreateData = {
109
99
  body: {
110
- datasource_entry?: DatasourceEntryCreate2;
100
+ datasource_entry?: DatasourceEntryCreate;
111
101
  };
112
102
  path: {
113
103
  /**
@@ -118,25 +108,9 @@ type CreateData = {
118
108
  query?: never;
119
109
  url: '/v1/spaces/{space_id}/datasource_entries';
120
110
  };
121
- type CreateResponses = {
122
- /**
123
- * Datasource entry created
124
- */
125
- 201: {
126
- datasource_entry?: DatasourceEntry;
127
- };
128
- };
129
- type GetResponses = {
130
- /**
131
- * Datasource entry details
132
- */
133
- 200: {
134
- datasource_entry?: DatasourceEntry;
135
- };
136
- };
137
111
  type UpdateData = {
138
112
  body: {
139
- datasource_entry?: DatasourceEntryUpdate2;
113
+ datasource_entry?: DatasourceEntryUpdate;
140
114
  };
141
115
  path: {
142
116
  /**
@@ -152,5 +126,5 @@ type UpdateData = {
152
126
  url: '/v1/spaces/{space_id}/datasource_entries/{datasource_entry_id}';
153
127
  };
154
128
  //#endregion
155
- export { CreateData, CreateResponses, DatasourceEntry, DatasourceEntryCreate, DatasourceEntryUpdate, GetResponses, ListData, ListResponses, UpdateData };
129
+ export { CreateData, DatasourceEntry, ListData, UpdateData };
156
130
  //# sourceMappingURL=types.gen.d.cts.map
@@ -15,18 +15,16 @@ type DatasourceEntry = {
15
15
  /**
16
16
  * The numeric ID of the datasource
17
17
  */
18
- datasource_id: number;
18
+ datasource_id?: number;
19
19
  /**
20
20
  * Given value in the requested dimension
21
21
  */
22
22
  dimension_value?: string;
23
23
  };
24
- type DatasourceEntryCreate = DatasourceEntryCreate2;
25
- type DatasourceEntryUpdate = DatasourceEntryUpdate2;
26
24
  /**
27
25
  * Input for creating a datasource entry.
28
26
  */
29
- type DatasourceEntryCreate2 = {
27
+ type DatasourceEntryCreate = {
30
28
  /**
31
29
  * The key name of the datasource entry
32
30
  */
@@ -47,7 +45,7 @@ type DatasourceEntryCreate2 = {
47
45
  /**
48
46
  * Input for updating a datasource entry.
49
47
  */
50
- type DatasourceEntryUpdate2 = {
48
+ type DatasourceEntryUpdate = {
51
49
  /**
52
50
  * The key name of the datasource entry
53
51
  */
@@ -97,17 +95,9 @@ type ListData = {
97
95
  };
98
96
  url: '/v1/spaces/{space_id}/datasource_entries';
99
97
  };
100
- type ListResponses = {
101
- /**
102
- * List of datasource entries
103
- */
104
- 200: {
105
- datasource_entries?: Array<DatasourceEntry>;
106
- };
107
- };
108
98
  type CreateData = {
109
99
  body: {
110
- datasource_entry?: DatasourceEntryCreate2;
100
+ datasource_entry?: DatasourceEntryCreate;
111
101
  };
112
102
  path: {
113
103
  /**
@@ -118,25 +108,9 @@ type CreateData = {
118
108
  query?: never;
119
109
  url: '/v1/spaces/{space_id}/datasource_entries';
120
110
  };
121
- type CreateResponses = {
122
- /**
123
- * Datasource entry created
124
- */
125
- 201: {
126
- datasource_entry?: DatasourceEntry;
127
- };
128
- };
129
- type GetResponses = {
130
- /**
131
- * Datasource entry details
132
- */
133
- 200: {
134
- datasource_entry?: DatasourceEntry;
135
- };
136
- };
137
111
  type UpdateData = {
138
112
  body: {
139
- datasource_entry?: DatasourceEntryUpdate2;
113
+ datasource_entry?: DatasourceEntryUpdate;
140
114
  };
141
115
  path: {
142
116
  /**
@@ -152,5 +126,5 @@ type UpdateData = {
152
126
  url: '/v1/spaces/{space_id}/datasource_entries/{datasource_entry_id}';
153
127
  };
154
128
  //#endregion
155
- export { CreateData, CreateResponses, DatasourceEntry, DatasourceEntryCreate, DatasourceEntryUpdate, GetResponses, ListData, ListResponses, UpdateData };
129
+ export { CreateData, DatasourceEntry, ListData, UpdateData };
156
130
  //# sourceMappingURL=types.gen.d.mts.map
@@ -50,12 +50,10 @@ type Datasource = {
50
50
  */
51
51
  updated_at: string;
52
52
  };
53
- type DatasourceCreate = DatasourceCreate2;
54
- type DatasourceUpdate = DatasourceUpdate2;
55
53
  /**
56
54
  * Input for creating a datasource.
57
55
  */
58
- type DatasourceCreate2 = {
56
+ type DatasourceCreate = {
59
57
  /**
60
58
  * The complete name provided for a datasource
61
59
  */
@@ -81,7 +79,7 @@ type DatasourceCreate2 = {
81
79
  /**
82
80
  * Input for updating a datasource.
83
81
  */
84
- type DatasourceUpdate2 = {
82
+ type DatasourceUpdate = {
85
83
  /**
86
84
  * The complete name provided for a datasource
87
85
  */
@@ -90,6 +88,19 @@ type DatasourceUpdate2 = {
90
88
  * Slug of a datasource
91
89
  */
92
90
  slug?: string;
91
+ /**
92
+ * Dimensions to update along with the datasource
93
+ */
94
+ dimensions_attributes?: Array<{
95
+ /**
96
+ * The complete name provided for the datasource dimension
97
+ */
98
+ name: string;
99
+ /**
100
+ * The value provided for the datasource dimension (e.g., a language code)
101
+ */
102
+ entry_value: string;
103
+ }>;
93
104
  };
94
105
  type ListData = {
95
106
  body?: never;
@@ -119,17 +130,9 @@ type ListData = {
119
130
  };
120
131
  url: '/v1/spaces/{space_id}/datasources';
121
132
  };
122
- type ListResponses = {
123
- /**
124
- * List of datasources
125
- */
126
- 200: {
127
- datasources?: Array<Datasource>;
128
- };
129
- };
130
133
  type CreateData = {
131
134
  body: {
132
- datasource?: DatasourceCreate2;
135
+ datasource?: DatasourceCreate;
133
136
  };
134
137
  path: {
135
138
  /**
@@ -140,25 +143,9 @@ type CreateData = {
140
143
  query?: never;
141
144
  url: '/v1/spaces/{space_id}/datasources';
142
145
  };
143
- type CreateResponses = {
144
- /**
145
- * Datasource created
146
- */
147
- 201: {
148
- datasource?: Datasource;
149
- };
150
- };
151
- type GetResponses = {
152
- /**
153
- * Datasource details
154
- */
155
- 200: {
156
- datasource?: Datasource;
157
- };
158
- };
159
146
  type UpdateData = {
160
147
  body: {
161
- datasource?: DatasourceUpdate2;
148
+ datasource?: DatasourceUpdate;
162
149
  };
163
150
  path: {
164
151
  /**
@@ -173,14 +160,6 @@ type UpdateData = {
173
160
  query?: never;
174
161
  url: '/v1/spaces/{space_id}/datasources/{datasource_id}';
175
162
  };
176
- type UpdateResponses = {
177
- /**
178
- * Datasource updated
179
- */
180
- 200: {
181
- datasource?: Datasource;
182
- };
183
- };
184
163
  //#endregion
185
- export { CreateData, CreateResponses, Datasource, DatasourceCreate, DatasourceUpdate, GetResponses, ListData, ListResponses, UpdateData, UpdateResponses };
164
+ export { CreateData, Datasource, ListData, UpdateData };
186
165
  //# sourceMappingURL=types.gen.d.cts.map
@@ -50,12 +50,10 @@ type Datasource = {
50
50
  */
51
51
  updated_at: string;
52
52
  };
53
- type DatasourceCreate = DatasourceCreate2;
54
- type DatasourceUpdate = DatasourceUpdate2;
55
53
  /**
56
54
  * Input for creating a datasource.
57
55
  */
58
- type DatasourceCreate2 = {
56
+ type DatasourceCreate = {
59
57
  /**
60
58
  * The complete name provided for a datasource
61
59
  */
@@ -81,7 +79,7 @@ type DatasourceCreate2 = {
81
79
  /**
82
80
  * Input for updating a datasource.
83
81
  */
84
- type DatasourceUpdate2 = {
82
+ type DatasourceUpdate = {
85
83
  /**
86
84
  * The complete name provided for a datasource
87
85
  */
@@ -90,6 +88,19 @@ type DatasourceUpdate2 = {
90
88
  * Slug of a datasource
91
89
  */
92
90
  slug?: string;
91
+ /**
92
+ * Dimensions to update along with the datasource
93
+ */
94
+ dimensions_attributes?: Array<{
95
+ /**
96
+ * The complete name provided for the datasource dimension
97
+ */
98
+ name: string;
99
+ /**
100
+ * The value provided for the datasource dimension (e.g., a language code)
101
+ */
102
+ entry_value: string;
103
+ }>;
93
104
  };
94
105
  type ListData = {
95
106
  body?: never;
@@ -119,17 +130,9 @@ type ListData = {
119
130
  };
120
131
  url: '/v1/spaces/{space_id}/datasources';
121
132
  };
122
- type ListResponses = {
123
- /**
124
- * List of datasources
125
- */
126
- 200: {
127
- datasources?: Array<Datasource>;
128
- };
129
- };
130
133
  type CreateData = {
131
134
  body: {
132
- datasource?: DatasourceCreate2;
135
+ datasource?: DatasourceCreate;
133
136
  };
134
137
  path: {
135
138
  /**
@@ -140,25 +143,9 @@ type CreateData = {
140
143
  query?: never;
141
144
  url: '/v1/spaces/{space_id}/datasources';
142
145
  };
143
- type CreateResponses = {
144
- /**
145
- * Datasource created
146
- */
147
- 201: {
148
- datasource?: Datasource;
149
- };
150
- };
151
- type GetResponses = {
152
- /**
153
- * Datasource details
154
- */
155
- 200: {
156
- datasource?: Datasource;
157
- };
158
- };
159
146
  type UpdateData = {
160
147
  body: {
161
- datasource?: DatasourceUpdate2;
148
+ datasource?: DatasourceUpdate;
162
149
  };
163
150
  path: {
164
151
  /**
@@ -173,14 +160,6 @@ type UpdateData = {
173
160
  query?: never;
174
161
  url: '/v1/spaces/{space_id}/datasources/{datasource_id}';
175
162
  };
176
- type UpdateResponses = {
177
- /**
178
- * Datasource updated
179
- */
180
- 200: {
181
- datasource?: Datasource;
182
- };
183
- };
184
163
  //#endregion
185
- export { CreateData, CreateResponses, Datasource, DatasourceCreate, DatasourceUpdate, GetResponses, ListData, ListResponses, UpdateData, UpdateResponses };
164
+ export { CreateData, Datasource, ListData, UpdateData };
186
165
  //# sourceMappingURL=types.gen.d.mts.map
@@ -1,23 +1,39 @@
1
1
  //#region src/generated/internal_tags/types.gen.d.ts
2
- type InternalTag = {
2
+ /**
3
+ * Input for creating an internal tag.
4
+ */
5
+ type InternalTagCreate = {
3
6
  /**
4
7
  * Name of the internal tag
5
8
  */
6
9
  name: string;
7
10
  /**
8
- * Numeric ID of the internal tag
11
+ * The object type of an internal tag. Can be `asset` or `component`
9
12
  */
10
- readonly id?: number;
13
+ object_type?: 'asset' | 'component';
14
+ };
15
+ /**
16
+ * Input for updating an internal tag.
17
+ */
18
+ type InternalTagUpdate = {
11
19
  /**
12
- * The object type of an internal tag (where does the internal tag belong to). Can be `asset` or `component`
20
+ * Name of the internal tag
21
+ */
22
+ name?: string;
23
+ /**
24
+ * The object type of an internal tag. Can be `asset` or `component`
13
25
  */
14
26
  object_type?: 'asset' | 'component';
15
27
  };
16
- type InternalTagWritable = {
28
+ type InternalTag = {
17
29
  /**
18
30
  * Name of the internal tag
19
31
  */
20
32
  name: string;
33
+ /**
34
+ * Numeric ID of the internal tag
35
+ */
36
+ readonly id?: number;
21
37
  /**
22
38
  * The object type of an internal tag (where does the internal tag belong to). Can be `asset` or `component`
23
39
  */
@@ -51,16 +67,10 @@ type ListData = {
51
67
  };
52
68
  url: '/v1/spaces/{space_id}/internal_tags';
53
69
  };
54
- type ListResponses = {
55
- /**
56
- * List of internal tags
57
- */
58
- 200: {
59
- internal_tags?: Array<InternalTag>;
60
- };
61
- };
62
70
  type CreateData = {
63
- body: InternalTagWritable;
71
+ body: {
72
+ internal_tag?: InternalTagCreate;
73
+ };
64
74
  path: {
65
75
  /**
66
76
  * The ID of the Storyblok space (can be integer or string)
@@ -70,16 +80,10 @@ type CreateData = {
70
80
  query?: never;
71
81
  url: '/v1/spaces/{space_id}/internal_tags';
72
82
  };
73
- type CreateResponses = {
74
- /**
75
- * Internal tag created
76
- */
77
- 201: {
78
- internal_tag?: InternalTag;
79
- };
80
- };
81
83
  type UpdateData = {
82
- body: InternalTagWritable;
84
+ body: {
85
+ internal_tag?: InternalTagUpdate;
86
+ };
83
87
  path: {
84
88
  /**
85
89
  * The ID of the Storyblok space (can be integer or string)
@@ -93,14 +97,6 @@ type UpdateData = {
93
97
  query?: never;
94
98
  url: '/v1/spaces/{space_id}/internal_tags/{internal_tag_id}';
95
99
  };
96
- type UpdateResponses = {
97
- /**
98
- * Internal tag updated
99
- */
100
- 200: {
101
- internal_tag?: InternalTag;
102
- };
103
- };
104
100
  //#endregion
105
- export { CreateData, CreateResponses, InternalTag, ListData, ListResponses, UpdateData, UpdateResponses };
101
+ export { CreateData, InternalTag, ListData, UpdateData };
106
102
  //# sourceMappingURL=types.gen.d.cts.map
@@ -1,23 +1,39 @@
1
1
  //#region src/generated/internal_tags/types.gen.d.ts
2
- type InternalTag = {
2
+ /**
3
+ * Input for creating an internal tag.
4
+ */
5
+ type InternalTagCreate = {
3
6
  /**
4
7
  * Name of the internal tag
5
8
  */
6
9
  name: string;
7
10
  /**
8
- * Numeric ID of the internal tag
11
+ * The object type of an internal tag. Can be `asset` or `component`
9
12
  */
10
- readonly id?: number;
13
+ object_type?: 'asset' | 'component';
14
+ };
15
+ /**
16
+ * Input for updating an internal tag.
17
+ */
18
+ type InternalTagUpdate = {
11
19
  /**
12
- * The object type of an internal tag (where does the internal tag belong to). Can be `asset` or `component`
20
+ * Name of the internal tag
21
+ */
22
+ name?: string;
23
+ /**
24
+ * The object type of an internal tag. Can be `asset` or `component`
13
25
  */
14
26
  object_type?: 'asset' | 'component';
15
27
  };
16
- type InternalTagWritable = {
28
+ type InternalTag = {
17
29
  /**
18
30
  * Name of the internal tag
19
31
  */
20
32
  name: string;
33
+ /**
34
+ * Numeric ID of the internal tag
35
+ */
36
+ readonly id?: number;
21
37
  /**
22
38
  * The object type of an internal tag (where does the internal tag belong to). Can be `asset` or `component`
23
39
  */
@@ -51,16 +67,10 @@ type ListData = {
51
67
  };
52
68
  url: '/v1/spaces/{space_id}/internal_tags';
53
69
  };
54
- type ListResponses = {
55
- /**
56
- * List of internal tags
57
- */
58
- 200: {
59
- internal_tags?: Array<InternalTag>;
60
- };
61
- };
62
70
  type CreateData = {
63
- body: InternalTagWritable;
71
+ body: {
72
+ internal_tag?: InternalTagCreate;
73
+ };
64
74
  path: {
65
75
  /**
66
76
  * The ID of the Storyblok space (can be integer or string)
@@ -70,16 +80,10 @@ type CreateData = {
70
80
  query?: never;
71
81
  url: '/v1/spaces/{space_id}/internal_tags';
72
82
  };
73
- type CreateResponses = {
74
- /**
75
- * Internal tag created
76
- */
77
- 201: {
78
- internal_tag?: InternalTag;
79
- };
80
- };
81
83
  type UpdateData = {
82
- body: InternalTagWritable;
84
+ body: {
85
+ internal_tag?: InternalTagUpdate;
86
+ };
83
87
  path: {
84
88
  /**
85
89
  * The ID of the Storyblok space (can be integer or string)
@@ -93,14 +97,6 @@ type UpdateData = {
93
97
  query?: never;
94
98
  url: '/v1/spaces/{space_id}/internal_tags/{internal_tag_id}';
95
99
  };
96
- type UpdateResponses = {
97
- /**
98
- * Internal tag updated
99
- */
100
- 200: {
101
- internal_tag?: InternalTag;
102
- };
103
- };
104
100
  //#endregion
105
- export { CreateData, CreateResponses, InternalTag, ListData, ListResponses, UpdateData, UpdateResponses };
101
+ export { CreateData, InternalTag, ListData, UpdateData };
106
102
  //# sourceMappingURL=types.gen.d.mts.map