resora 0.1.6 → 0.1.7

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/dist/index.d.cts CHANGED
@@ -165,11 +165,11 @@ interface Cursor {
165
165
  }
166
166
  interface Config {
167
167
  /**
168
- * @description The directory where resource files are stored. This is the location where the generated resource files will be saved. It should be a valid path on the file system.
168
+ * @description The directory where resource files are stored. This is the location where the generated resource files will be saved. It should be a valid path on the file system relative to the project root.
169
169
  */
170
170
  resourcesDir: string;
171
171
  /**
172
- * @description The directory where stub files are stored. Stub files are templates used for generating resource files. This should also be a valid path on the file system where the stub templates are located.
172
+ * @description The directory where stub files are stored. Stub files are templates used for generating resource files. This should also be a valid path on the file system relative to the project root where the stub templates are located.
173
173
  */
174
174
  stubsDir: string;
175
175
  /**
@@ -189,12 +189,45 @@ interface Config {
189
189
  */
190
190
  collection: string;
191
191
  };
192
+ /**
193
+ * @description This option allows you to specify the case style that should be used for the keys in API responses returned by the resources.
194
+ */
195
+ preferredCase: 'camel' | 'snake' | 'pascal' | 'kebab';
196
+ /**
197
+ * @description This option allows you to specify the extra properties that should be included in the response body when a resource is paginated. You can choose to include either 'meta', 'links', or both, or you can provide custom property names for these extras.
198
+ */
199
+ paginatedExtras: ['meta', 'links'] | {
200
+ meta?: string | undefined;
201
+ links?: string | undefined;
202
+ };
203
+ /**
204
+ * @description This option allows you to specify the property names that should be used for pagination links in the response body when a resource is paginated. You can provide custom property names for the pagination links, and if not specified, the default property names will be used.
205
+ */
206
+ paginatedLinks: {
207
+ first?: string | undefined;
208
+ last?: string | undefined;
209
+ prev?: string | undefined;
210
+ next?: string | undefined;
211
+ };
212
+ /**
213
+ * @description This option allows you to specify the property names that should be used for pagination metadata in the response body when a resource is paginated. You can provide custom property names for properties, and if not specified, the default property names will be used.
214
+ */
215
+ paginatedMeta: {
216
+ to?: string | undefined;
217
+ from?: string | undefined;
218
+ links?: string | undefined;
219
+ path?: string | undefined;
220
+ total?: string | undefined;
221
+ per_page?: string | undefined;
222
+ last_page?: string | undefined;
223
+ current_page?: string | undefined;
224
+ };
192
225
  }
193
226
  //#endregion
194
227
  //#region src/cli/CliApp.d.ts
195
228
  declare class CliApp {
196
229
  command: Command;
197
- private config;
230
+ protected config: Config;
198
231
  constructor(config?: Partial<Config>);
199
232
  /**
200
233
  * Initialize Resora by creating a default config file in the current directory
package/dist/index.d.mts CHANGED
@@ -165,11 +165,11 @@ interface Cursor {
165
165
  }
166
166
  interface Config {
167
167
  /**
168
- * @description The directory where resource files are stored. This is the location where the generated resource files will be saved. It should be a valid path on the file system.
168
+ * @description The directory where resource files are stored. This is the location where the generated resource files will be saved. It should be a valid path on the file system relative to the project root.
169
169
  */
170
170
  resourcesDir: string;
171
171
  /**
172
- * @description The directory where stub files are stored. Stub files are templates used for generating resource files. This should also be a valid path on the file system where the stub templates are located.
172
+ * @description The directory where stub files are stored. Stub files are templates used for generating resource files. This should also be a valid path on the file system relative to the project root where the stub templates are located.
173
173
  */
174
174
  stubsDir: string;
175
175
  /**
@@ -189,12 +189,45 @@ interface Config {
189
189
  */
190
190
  collection: string;
191
191
  };
192
+ /**
193
+ * @description This option allows you to specify the case style that should be used for the keys in API responses returned by the resources.
194
+ */
195
+ preferredCase: 'camel' | 'snake' | 'pascal' | 'kebab';
196
+ /**
197
+ * @description This option allows you to specify the extra properties that should be included in the response body when a resource is paginated. You can choose to include either 'meta', 'links', or both, or you can provide custom property names for these extras.
198
+ */
199
+ paginatedExtras: ['meta', 'links'] | {
200
+ meta?: string | undefined;
201
+ links?: string | undefined;
202
+ };
203
+ /**
204
+ * @description This option allows you to specify the property names that should be used for pagination links in the response body when a resource is paginated. You can provide custom property names for the pagination links, and if not specified, the default property names will be used.
205
+ */
206
+ paginatedLinks: {
207
+ first?: string | undefined;
208
+ last?: string | undefined;
209
+ prev?: string | undefined;
210
+ next?: string | undefined;
211
+ };
212
+ /**
213
+ * @description This option allows you to specify the property names that should be used for pagination metadata in the response body when a resource is paginated. You can provide custom property names for properties, and if not specified, the default property names will be used.
214
+ */
215
+ paginatedMeta: {
216
+ to?: string | undefined;
217
+ from?: string | undefined;
218
+ links?: string | undefined;
219
+ path?: string | undefined;
220
+ total?: string | undefined;
221
+ per_page?: string | undefined;
222
+ last_page?: string | undefined;
223
+ current_page?: string | undefined;
224
+ };
192
225
  }
193
226
  //#endregion
194
227
  //#region src/cli/CliApp.d.ts
195
228
  declare class CliApp {
196
229
  command: Command;
197
- private config;
230
+ protected config: Config;
198
231
  constructor(config?: Partial<Config>);
199
232
  /**
200
233
  * Initialize Resora by creating a default config file in the current directory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resora",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "A structured API response layer for Node.js and TypeScript with automatic JSON responses, collection support, and pagination handling.",
5
5
  "keywords": [
6
6
  "api",