@eienjs/adonisjs-api-query 0.1.0

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 (68) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +43 -0
  3. package/build/api_query_request-QXOB4BN6.js +18 -0
  4. package/build/api_query_request-QXOB4BN6.js.map +1 -0
  5. package/build/chunk-HQN7LHVO.js +106 -0
  6. package/build/chunk-HQN7LHVO.js.map +1 -0
  7. package/build/chunk-MKQ3HMMA.js +198 -0
  8. package/build/chunk-MKQ3HMMA.js.map +1 -0
  9. package/build/chunk-OS75QJZN.js +159 -0
  10. package/build/chunk-OS75QJZN.js.map +1 -0
  11. package/build/chunk-PBQFWYKU.js +349 -0
  12. package/build/chunk-PBQFWYKU.js.map +1 -0
  13. package/build/chunk-XIRHVLVQ.js +10 -0
  14. package/build/chunk-XIRHVLVQ.js.map +1 -0
  15. package/build/config.stub +82 -0
  16. package/build/configure.d.ts +2 -0
  17. package/build/filters_query-ZXNA4X75.js +55 -0
  18. package/build/filters_query-ZXNA4X75.js.map +1 -0
  19. package/build/includes_query-2XNHHWJB.js +70 -0
  20. package/build/includes_query-2XNHHWJB.js.map +1 -0
  21. package/build/index.d.ts +19 -0
  22. package/build/index.js +130 -0
  23. package/build/index.js.map +1 -0
  24. package/build/metafile-esm.json +1 -0
  25. package/build/providers/api_query_provider.d.ts +42 -0
  26. package/build/providers/api_query_provider.js +30 -0
  27. package/build/providers/api_query_provider.js.map +1 -0
  28. package/build/sorts_query-LUETK3FD.js +63 -0
  29. package/build/sorts_query-LUETK3FD.js.map +1 -0
  30. package/build/src/allowed_filter.d.ts +37 -0
  31. package/build/src/allowed_include.d.ts +17 -0
  32. package/build/src/allowed_sort.d.ts +18 -0
  33. package/build/src/api_query_builder_request.d.ts +31 -0
  34. package/build/src/bindings/api_query_request.d.ts +2 -0
  35. package/build/src/bindings/filters_query.d.ts +3 -0
  36. package/build/src/bindings/includes_query.d.ts +3 -0
  37. package/build/src/bindings/sorts_query.d.ts +3 -0
  38. package/build/src/define_config.d.ts +3 -0
  39. package/build/src/enums/filter_operator.d.ts +10 -0
  40. package/build/src/enums/sort_direction.d.ts +5 -0
  41. package/build/src/exceptions/allowed_fields_must_be_called_before_allowed_includes.d.ts +6 -0
  42. package/build/src/exceptions/invalid_append_query.d.ts +5 -0
  43. package/build/src/exceptions/invalid_direction.d.ts +4 -0
  44. package/build/src/exceptions/invalid_field_query.d.ts +5 -0
  45. package/build/src/exceptions/invalid_filter_query.d.ts +7 -0
  46. package/build/src/exceptions/invalid_filter_value.d.ts +4 -0
  47. package/build/src/exceptions/invalid_include_query.d.ts +7 -0
  48. package/build/src/exceptions/invalid_query.d.ts +4 -0
  49. package/build/src/exceptions/invalid_sort_query.d.ts +7 -0
  50. package/build/src/exceptions/unknown_included_fields_query.d.ts +5 -0
  51. package/build/src/filters/filters_begin_with_strict.d.ts +8 -0
  52. package/build/src/filters/filters_callback.d.ts +7 -0
  53. package/build/src/filters/filters_ends_with_strict.d.ts +8 -0
  54. package/build/src/filters/filters_exact.d.ts +12 -0
  55. package/build/src/filters/filters_operator.d.ts +14 -0
  56. package/build/src/filters/filters_partial.d.ts +12 -0
  57. package/build/src/filters/filters_trashed.d.ts +6 -0
  58. package/build/src/includes/included_callback.d.ts +8 -0
  59. package/build/src/includes/included_count.d.ts +5 -0
  60. package/build/src/includes/included_relationship.d.ts +9 -0
  61. package/build/src/sorts/sorts_callback.d.ts +7 -0
  62. package/build/src/sorts/sorts_field.d.ts +5 -0
  63. package/build/src/types.d.ts +90 -0
  64. package/build/src/types.js +1 -0
  65. package/build/src/types.js.map +1 -0
  66. package/build/src/utils/helpers.d.ts +3 -0
  67. package/build/stubs/main.d.ts +1 -0
  68. package/package.json +143 -0
@@ -0,0 +1,7 @@
1
+ import { InvalidQuery } from './invalid_query.js';
2
+ export declare class InvalidFilterQuery extends InvalidQuery {
3
+ readonly unknownFilters: string[];
4
+ readonly allowedFilters: string[];
5
+ constructor(unknownFilters: string[], allowedFilters: string[]);
6
+ static filtersNotAllowed(unknownFilters: string[], allowedFilters: string[]): InvalidFilterQuery;
7
+ }
@@ -0,0 +1,4 @@
1
+ import { Exception } from '@adonisjs/core/exceptions';
2
+ export declare class InvalidFilterValue extends Exception {
3
+ static make(value: unknown): InvalidFilterValue;
4
+ }
@@ -0,0 +1,7 @@
1
+ import { InvalidQuery } from './invalid_query.js';
2
+ export declare class InvalidIncludeQuery extends InvalidQuery {
3
+ readonly unknownIncludes: string[];
4
+ readonly allowedIncludes: string[];
5
+ constructor(unknownIncludes: string[], allowedIncludes: string[]);
6
+ static includesNotAllowed(unknownIncludes: string[], allowedIncludes: string[]): InvalidIncludeQuery;
7
+ }
@@ -0,0 +1,4 @@
1
+ import { Exception } from '@adonisjs/core/exceptions';
2
+ export declare abstract class InvalidQuery extends Exception {
3
+ static readonly code = "E_INVALID_QUERY_EXCEPTION";
4
+ }
@@ -0,0 +1,7 @@
1
+ import { InvalidQuery } from './invalid_query.js';
2
+ export declare class InvalidSortQuery extends InvalidQuery {
3
+ readonly unknownSorts: string[];
4
+ readonly allowedSorts: string[];
5
+ constructor(unknownSorts: string[], allowedSorts: string[]);
6
+ static sortsNotAllowed(unknownSorts: string[], allowedSorts: string[]): InvalidSortQuery;
7
+ }
@@ -0,0 +1,5 @@
1
+ import { InvalidQuery } from './invalid_query.js';
2
+ export declare class UnknownIncludedFieldsQuery extends InvalidQuery {
3
+ readonly unknownFields: string[];
4
+ constructor(unknownFields: string[]);
5
+ }
@@ -0,0 +1,8 @@
1
+ import { type DialectContract } from '@adonisjs/lucid/types/database';
2
+ import { type LucidModel } from '@adonisjs/lucid/types/model';
3
+ import { type StrictValuesWithoutRaw } from '@adonisjs/lucid/types/querybuilder';
4
+ import { type Filter } from '../types.js';
5
+ import { FiltersPartial } from './filters_partial.js';
6
+ export declare class FiltersBeginWithStrict<Model extends LucidModel> extends FiltersPartial<Model> implements Filter<Model> {
7
+ protected getWhereRawParameters(value: StrictValuesWithoutRaw, property: string, dialect: DialectContract['name']): [string, string[]];
8
+ }
@@ -0,0 +1,7 @@
1
+ import { type LucidModel, type ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
2
+ import { type Filter } from '../types.js';
3
+ export declare class FiltersCallback<Model extends LucidModel> implements Filter<Model> {
4
+ private callback;
5
+ constructor(callback: (query: ModelQueryBuilderContract<Model>, value: unknown, property: string) => void);
6
+ handle(query: ModelQueryBuilderContract<Model, InstanceType<Model>>, value: unknown, property: string): void;
7
+ }
@@ -0,0 +1,8 @@
1
+ import { type DialectContract } from '@adonisjs/lucid/types/database';
2
+ import { type LucidModel } from '@adonisjs/lucid/types/model';
3
+ import { type StrictValuesWithoutRaw } from '@adonisjs/lucid/types/querybuilder';
4
+ import { type Filter } from '../types.js';
5
+ import { FiltersPartial } from './filters_partial.js';
6
+ export declare class FiltersEndsWithStrict<Model extends LucidModel> extends FiltersPartial<Model> implements Filter<Model> {
7
+ protected getWhereRawParameters(value: StrictValuesWithoutRaw, property: string, dialect: DialectContract['name']): [string, string[]];
8
+ }
@@ -0,0 +1,12 @@
1
+ import { type LucidModel, type ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
2
+ import { type StrictValuesWithoutRaw } from '@adonisjs/lucid/types/querybuilder';
3
+ import { type Filter } from '../types.js';
4
+ export declare class FiltersExact<Model extends LucidModel> implements Filter<Model> {
5
+ protected addRelationConstraint: boolean;
6
+ protected relationConstraints: string[];
7
+ constructor(addRelationConstraint?: boolean);
8
+ handle(query: ModelQueryBuilderContract<Model, InstanceType<Model>>, value: StrictValuesWithoutRaw | null, property: string): void;
9
+ protected qualifyColumn(query: ModelQueryBuilderContract<Model, InstanceType<Model>>, column: string): string;
10
+ protected isRelationProperty(query: ModelQueryBuilderContract<Model, InstanceType<Model>>, property: string): boolean;
11
+ protected withRelationConstraint(query: ModelQueryBuilderContract<Model, InstanceType<Model>>, value: StrictValuesWithoutRaw | null, property: string): void;
12
+ }
@@ -0,0 +1,14 @@
1
+ import { type LucidModel, type ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
2
+ import { type StrictValuesWithoutRaw } from '@adonisjs/lucid/types/querybuilder';
3
+ import { FilterOperator } from '../enums/filter_operator.js';
4
+ import { type Filter } from '../types.js';
5
+ import { FiltersExact } from './filters_exact.js';
6
+ export declare class FiltersOperator<Model extends LucidModel> extends FiltersExact<Model> implements Filter<Model> {
7
+ protected $addRelationConstraint: boolean;
8
+ protected $filterOperator: FilterOperator;
9
+ protected $boolean: 'and' | 'or';
10
+ constructor($addRelationConstraint: boolean, $filterOperator: FilterOperator, $boolean: 'and' | 'or');
11
+ handle(query: ModelQueryBuilderContract<Model, InstanceType<Model>>, value: StrictValuesWithoutRaw, property: string): void;
12
+ protected getDynamicFilterOperator(value: string): FilterOperator;
13
+ protected removeDynamicFilterOperatorFromValue(value: string, filterOperator: FilterOperator): string;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { type DialectContract } from '@adonisjs/lucid/types/database';
2
+ import { type LucidModel, type ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
3
+ import { type StrictValuesWithoutRaw } from '@adonisjs/lucid/types/querybuilder';
4
+ import { type Filter } from '../types.js';
5
+ import { FiltersExact } from './filters_exact.js';
6
+ export declare class FiltersPartial<Model extends LucidModel> extends FiltersExact<Model> implements Filter<Model> {
7
+ handle(query: ModelQueryBuilderContract<Model, InstanceType<Model>>, value: StrictValuesWithoutRaw | null, property: string): void;
8
+ protected getDatabaseDialect(query: ModelQueryBuilderContract<Model, InstanceType<Model>>): DialectContract['name'];
9
+ protected getWhereRawParameters(value: StrictValuesWithoutRaw | null, property: string, dialect: DialectContract['name']): [string, string[]];
10
+ protected static escapeLike(value: string): string;
11
+ protected static maybeSpecifyEscapeChar(dialect: DialectContract['name']): string;
12
+ }
@@ -0,0 +1,6 @@
1
+ import { type LucidModel, type ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
2
+ import { type StrictValuesWithoutRaw } from '@adonisjs/lucid/types/querybuilder';
3
+ import { type Filter } from '../types.js';
4
+ export declare class FiltersTrashed<Model extends LucidModel> implements Filter<Model> {
5
+ handle(query: ModelQueryBuilderContract<Model, InstanceType<Model>>, value: StrictValuesWithoutRaw, _property: string): void;
6
+ }
@@ -0,0 +1,8 @@
1
+ import { type LucidModel, type ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
2
+ import { type ModelRelations } from '@adonisjs/lucid/types/relations';
3
+ import { type Include } from '../types.js';
4
+ export declare class IncludedCallback<ParentModel extends LucidModel, RelatedModel extends LucidModel> implements Include<ParentModel> {
5
+ readonly callback: (query: ModelRelations<RelatedModel, ParentModel>['builder'] | ModelRelations<RelatedModel, ParentModel>['subQuery']) => void;
6
+ constructor(callback: (query: ModelRelations<RelatedModel, ParentModel>['builder'] | ModelRelations<RelatedModel, ParentModel>['subQuery']) => void);
7
+ handle(query: ModelQueryBuilderContract<ParentModel, InstanceType<ParentModel>>, include: string): void;
8
+ }
@@ -0,0 +1,5 @@
1
+ import { type LucidModel, type ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
2
+ import { type Include } from '../types.js';
3
+ export declare class IncludedCount<ParentModel extends LucidModel> implements Include<ParentModel> {
4
+ handle(query: ModelQueryBuilderContract<ParentModel, InstanceType<ParentModel>>, count: string): void;
5
+ }
@@ -0,0 +1,9 @@
1
+ import { type LucidModel, type ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
2
+ import { Collection } from 'collect.js';
3
+ import { type Include } from '../types.js';
4
+ export declare class IncludedRelationship<ParentModel extends LucidModel> implements Include<ParentModel> {
5
+ static getIndividualRelationshipPathsFromInclude(include: string): Collection<string>;
6
+ getRequestedFieldsForRelatedTable?: (relationship: string) => string[];
7
+ handle(query: ModelQueryBuilderContract<ParentModel, InstanceType<ParentModel>>, relationship: string): void;
8
+ private buildNestedQuery;
9
+ }
@@ -0,0 +1,7 @@
1
+ import { type LucidModel, type ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
2
+ import { type Sort } from '../types.js';
3
+ export declare class SortsCallback<Model extends LucidModel> implements Sort<Model> {
4
+ private readonly _callback;
5
+ constructor(_callback: (query: ModelQueryBuilderContract<Model>, descending: boolean, property: string) => void);
6
+ handle(query: ModelQueryBuilderContract<Model>, descending: boolean, property: string): void;
7
+ }
@@ -0,0 +1,5 @@
1
+ import { type LucidModel, type ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
2
+ import { type Sort } from '../types.js';
3
+ export declare class SortsField<Model extends LucidModel> implements Sort<Model> {
4
+ handle(query: ModelQueryBuilderContract<Model>, descending: boolean, property: string): void;
5
+ }
@@ -0,0 +1,90 @@
1
+ import { type LucidModel, type ModelAttributes, type ModelQueryBuilderContract } from '@adonisjs/lucid/types/model';
2
+ import { type StrictValuesWithoutRaw } from '@adonisjs/lucid/types/querybuilder';
3
+ export interface ApiQueryConfigParameters {
4
+ include?: string;
5
+ filter?: string;
6
+ sort?: string;
7
+ fields?: string;
8
+ append?: string;
9
+ }
10
+ export interface ApiQueryConfig {
11
+ /**
12
+ * By default the package will use the `include`, `filter`, `sort`
13
+ * and `fields` query parameters as described in the readme.
14
+ *
15
+ * You can customize these query string parameters here.
16
+ */
17
+ parameters?: ApiQueryConfigParameters;
18
+ /**
19
+ * Related model counts are included using the relationship name suffixed with this string.
20
+ * For example: GET /users?include=postsCount
21
+ */
22
+ countSuffix?: string;
23
+ /**
24
+ * Related model exists are included using the relationship name suffixed with this string.
25
+ * For example: GET /users?include=postsExists
26
+ */
27
+ existsSuffix?: string;
28
+ /**
29
+ * By default the package will throw an `InvalidFilterQuery` exception when a filter in the
30
+ * URL is not allowed in the `allowedFilters()` method.
31
+ */
32
+ disableInvalidFilterQueryException?: boolean;
33
+ /**
34
+ * By default the package will throw an `InvalidSortQuery` exception when a sort in the
35
+ * URL is not allowed in the `allowedSorts()` method.
36
+ */
37
+ disableInvalidSortQueryException?: boolean;
38
+ /**
39
+ * By default the package will throw an `InvalidIncludeQuery` exception when an include in the
40
+ * URL is not allowed in the `allowedIncludes()` method.
41
+ */
42
+ disableInvalidIncludesQueryException?: boolean;
43
+ /**
44
+ * By default, the package expects relationship names to be camel case plural when using fields[relationship].
45
+ * For example, fetching the id and name for a userOwner relation would look like this:
46
+ * GET /users?fields[userOwner]=id,name
47
+ *
48
+ * Set this to `true` if you don't want that and keep the requested relationship names as-is and allows you to
49
+ * request the fields using a snake case relationship name:
50
+ * GET /users?fields[user_owner]=id,name
51
+ */
52
+ convertRelationNamesToSnakeCasePlural?: boolean;
53
+ /**
54
+ * By default, the package expects relationship names to be camel case plural when using fields[relationship].
55
+ * For example, fetching the id and name for a userOwner relation would look like this:
56
+ * GET /users?fields[userOwner]=id,name
57
+ *
58
+ * Set this to one of `snake_case`, `camelCase` or `none` if you want to enable table name resolution in addition to the relation name resolution
59
+ * GET /users?include=top_orders&fields[orders]=id,name
60
+ */
61
+ convertRelationTableNameStrategy?: 'snake_case' | 'camelCase' | 'none' | false;
62
+ /**
63
+ * By default, the package expects the field names to match the database names
64
+ * For example, fetching the field named firstName would look like this:
65
+ * GET /users?fields=firstName
66
+ *
67
+ * Set this to `true` if you want to convert the firstName into first_name for the underlying query
68
+ */
69
+ convertFieldNamesToSnakeCase?: boolean;
70
+ }
71
+ export type ResolvedApiQueryConfig = Required<ApiQueryConfig> & {
72
+ parameters: Required<ApiQueryConfigParameters>;
73
+ };
74
+ export interface Sort<Model extends LucidModel> {
75
+ handle(query: ModelQueryBuilderContract<Model, InstanceType<Model>>, descending: boolean, property: string): void;
76
+ }
77
+ export interface Filter<Model extends LucidModel> {
78
+ handle(query: ModelQueryBuilderContract<Model, InstanceType<Model>>, value: StrictValuesWithoutRaw | null, property: string): void;
79
+ }
80
+ export interface Include<ParentModel extends LucidModel> {
81
+ handle(query: ModelQueryBuilderContract<ParentModel, InstanceType<ParentModel>>, include: string): void;
82
+ }
83
+ export type ExtractKeys<T> = T extends object ? {
84
+ [K in keyof T & string]: K;
85
+ }[keyof T & string] : never;
86
+ export type ExtractKeysWithSort<T> = T extends object ? {
87
+ [K in keyof T & string]: `-${K}`;
88
+ }[keyof T & string] : never;
89
+ export type SortUnionKeyParams<Model extends LucidModel> = ExtractKeys<ModelAttributes<InstanceType<Model>>> | ExtractKeysWithSort<ModelAttributes<InstanceType<Model>>>;
90
+ export type HintedString<KnownValues> = KnownValues extends string ? (string & {}) | KnownValues : never;
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,3 @@
1
+ export declare const substrReplace: (str: string, replace: string, start: number, length?: number) => string;
2
+ export declare const strBeforeLast: (subject: string, search: string) => string;
3
+ export declare const strAfterLast: (subject: string, search: string) => string;
@@ -0,0 +1 @@
1
+ export declare const stubsRoot: string;
package/package.json ADDED
@@ -0,0 +1,143 @@
1
+ {
2
+ "name": "@eienjs/adonisjs-api-query",
3
+ "description": "Easily build Lucid queries from API requests",
4
+ "version": "0.1.0",
5
+ "type": "module",
6
+ "module": "./build/index.js",
7
+ "types": "./build/index.d.ts",
8
+ "files": [
9
+ "build",
10
+ "!build/bin",
11
+ "!build/tests"
12
+ ],
13
+ "exports": {
14
+ ".": "./build/index.js",
15
+ "./types": "./build/src/types.js",
16
+ "./api_query_provider": "./build/providers/api_query_provider.js"
17
+ },
18
+ "devDependencies": {
19
+ "@adonisjs/assembler": "^7.8.2",
20
+ "@adonisjs/core": "^6.17.2",
21
+ "@adonisjs/lucid": "^21.6.0",
22
+ "@commitlint/cli": "^19.8.0",
23
+ "@commitlint/config-conventional": "^19.8.0",
24
+ "@japa/assert": "^4.0.1",
25
+ "@japa/file-system": "^2.3.2",
26
+ "@japa/runner": "^4.2.0",
27
+ "@nodecfdi/eslint-config": "^3.0.0",
28
+ "@nodecfdi/prettier-config": "^1.4.1",
29
+ "@nodecfdi/tsconfig": "^1.7.4",
30
+ "@poppinss/hooks": "^7.2.5",
31
+ "@swc/core": "^1.11.8",
32
+ "@types/luxon": "^3.4.2",
33
+ "@types/node": "^22.13.9",
34
+ "adonis-lucid-soft-deletes": "^2.1.0",
35
+ "auto-changelog": "^2.5.0",
36
+ "better-sqlite3": "^11.8.1",
37
+ "c8": "^10.1.3",
38
+ "del-cli": "^6.0.0",
39
+ "eslint": "^9.22.0",
40
+ "husky": "^9.1.7",
41
+ "is-in-ci": "^1.0.0",
42
+ "luxon": "^3.5.0",
43
+ "native-copyfiles": "^0.3.2",
44
+ "np": "^10.2.0",
45
+ "prettier": "^3.5.3",
46
+ "ts-node-maintained": "^10.9.5",
47
+ "tsup": "^8.4.0",
48
+ "typescript": "~5.7.3"
49
+ },
50
+ "dependencies": {
51
+ "collect.js": "^4.36.1"
52
+ },
53
+ "peerDependencies": {
54
+ "@adonisjs/core": "^6.17.2",
55
+ "@adonisjs/lucid": "^21.6.0"
56
+ },
57
+ "author": "Fernando Isidro <luffynando@gmail.com>",
58
+ "license": "MIT",
59
+ "homepage": "https://github.com/eienjs/adonisjs-api-query",
60
+ "repository": {
61
+ "type": "git",
62
+ "url": "git+https://github.com/eienjs/adonisjs-api-query.git"
63
+ },
64
+ "bugs": {
65
+ "url": "https://github.com/eienjs/adonisjs-api-query/issues"
66
+ },
67
+ "keywords": [
68
+ "adonisjs",
69
+ "lucid",
70
+ "api",
71
+ "query",
72
+ "builder",
73
+ "filters",
74
+ "filter",
75
+ "sort",
76
+ "includes"
77
+ ],
78
+ "engines": {
79
+ "node": ">=20.6.0"
80
+ },
81
+ "c8": {
82
+ "reporter": [
83
+ "text",
84
+ "lcov"
85
+ ],
86
+ "exclude": [
87
+ "bin/**",
88
+ "tests/**"
89
+ ]
90
+ },
91
+ "commitlint": {
92
+ "extends": [
93
+ "@commitlint/config-conventional"
94
+ ]
95
+ },
96
+ "prettier": "@nodecfdi/prettier-config/pkg",
97
+ "publishConfig": {
98
+ "access": "public",
99
+ "tag": "latest"
100
+ },
101
+ "auto-changelog": {
102
+ "template": "keepachangelog",
103
+ "hideCredit": true
104
+ },
105
+ "np": {
106
+ "message": "chore(release): :tada: %s",
107
+ "tag": "latest",
108
+ "branch": "main",
109
+ "testScript": "test"
110
+ },
111
+ "tsup": {
112
+ "entry": [
113
+ "index.ts",
114
+ "src/types.ts",
115
+ "providers/api_query_provider.ts"
116
+ ],
117
+ "outDir": "./build",
118
+ "clean": true,
119
+ "format": "esm",
120
+ "dts": false,
121
+ "sourcemap": true,
122
+ "target": "esnext"
123
+ },
124
+ "scripts": {
125
+ "clean": "del-cli build",
126
+ "copy:templates": "copyfiles \"stubs/**/*.stub\" build --up 1",
127
+ "changelog": "auto-changelog -p && git add CHANGELOG.md",
128
+ "typecheck": "tsc --noEmit",
129
+ "lint": "eslint . --fix",
130
+ "lint:check": "eslint .",
131
+ "format": "prettier --write .",
132
+ "format:check": "prettier --check .",
133
+ "test": "node --import ts-node-maintained/register/esm --enable-source-maps bin/test.ts",
134
+ "test:coverage": "c8 pnpm run test",
135
+ "tool:code": "pnpm run lint:check && pnpm run format:check && pnpm run typecheck",
136
+ "tool:build": "pnpm run tool:code && pnpm run test",
137
+ "prebuild": "pnpm run tool:code && pnpm run clean",
138
+ "build": "tsup-node --metafile && tsc --emitDeclarationOnly --declaration",
139
+ "postbuild": "pnpm run copy:templates",
140
+ "release": "np",
141
+ "version": "pnpm run build && pnpm run changelog"
142
+ }
143
+ }