@centrali-io/centrali-sdk 1.8.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.js ADDED
@@ -0,0 +1,211 @@
1
+ "use strict";
2
+ /*
3
+ * Centrali TypeScript SDK
4
+ * ----------------------
5
+ * A lightweight SDK for interacting with Centrali's Data and Compute APIs,
6
+ * with support for user-provided tokens or client credentials (Client ID/Secret).
7
+ */
8
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
+ return new (P || (P = Promise))(function (resolve, reject) {
11
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
13
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
15
+ });
16
+ };
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.CentraliSDK = void 0;
22
+ exports.getAuthUrl = getAuthUrl;
23
+ exports.fetchClientToken = fetchClientToken;
24
+ exports.getRecordApiPath = getRecordApiPath;
25
+ exports.getFileUploadApiPath = getFileUploadApiPath;
26
+ exports.getComputeFunctionTriggerApiPath = getComputeFunctionTriggerApiPath;
27
+ const axios_1 = __importDefault(require("axios"));
28
+ const qs_1 = __importDefault(require("qs"));
29
+ // Helper to encode form data
30
+ function encodeFormData(data) {
31
+ return new URLSearchParams(data).toString();
32
+ }
33
+ /**
34
+ * Generate the auth server URL from the API base URL.
35
+ */
36
+ function getAuthUrl(apiBaseUrl) {
37
+ const url = new URL(apiBaseUrl);
38
+ // assume auth is hosted at auth.<api-domain>
39
+ return `${url.protocol}//auth.${url.hostname}`;
40
+ }
41
+ /**
42
+ * Retrieve an access token using the Client Credentials flow.
43
+ */
44
+ function fetchClientToken(clientId, clientSecret, apiBaseUrl) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const authUrl = getAuthUrl(apiBaseUrl);
47
+ const tokenEndpoint = `${authUrl}/token`;
48
+ const form = encodeFormData({
49
+ grant_type: 'client_credentials',
50
+ client_id: clientId,
51
+ client_secret: clientSecret,
52
+ resource: `${apiBaseUrl}/data`
53
+ });
54
+ const resp = yield axios_1.default.post(tokenEndpoint, form, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
55
+ proxy: false
56
+ });
57
+ return resp.data.access_token;
58
+ });
59
+ }
60
+ /**
61
+ * Generate Records API URL PATH.
62
+ */
63
+ function getRecordApiPath(workspaceId, recordSlug, id) {
64
+ return id ? `data/workspace/${workspaceId}/api/v1/records/slug/${recordSlug}/${id}` : `data/workspace/${workspaceId}/api/v1/records/slug/${recordSlug}`;
65
+ }
66
+ /**
67
+ * Generate File Upload API URL PATH.
68
+ * @param workspaceId
69
+ */
70
+ function getFileUploadApiPath(workspaceId) {
71
+ return `storage/ws/${workspaceId}/api/v1/files`;
72
+ }
73
+ /*
74
+ * Generate Compute Function Trigger API URL PATH.
75
+ */
76
+ function getComputeFunctionTriggerApiPath(workspaceId, functionId) {
77
+ return `data/workspace/${workspaceId}/api/v1/function-triggers/${functionId}/execute`;
78
+ }
79
+ /**
80
+ * Main Centrali SDK client.
81
+ */
82
+ class CentraliSDK {
83
+ constructor(options) {
84
+ this.token = null;
85
+ this.options = options;
86
+ this.token = options.token || null;
87
+ this.axios = axios_1.default.create(Object.assign({ baseURL: options.baseUrl, paramsSerializer: (params) => qs_1.default.stringify(params, { arrayFormat: "repeat" }), proxy: false }, options.axiosConfig));
88
+ // Attach async interceptor to fetch token on first request if needed
89
+ this.axios.interceptors.request.use((config) => __awaiter(this, void 0, void 0, function* () {
90
+ if (!this.token && this.options.clientId && this.options.clientSecret) {
91
+ this.token = yield fetchClientToken(this.options.clientId, this.options.clientSecret, this.options.baseUrl);
92
+ }
93
+ if (this.token) {
94
+ config.headers.Authorization = `Bearer ${this.token}`;
95
+ }
96
+ return config;
97
+ }), (error) => Promise.reject(error));
98
+ }
99
+ /**
100
+ * Manually set or update the bearer token for subsequent requests.
101
+ */
102
+ setToken(token) {
103
+ this.token = token;
104
+ }
105
+ /**
106
+ * Fetch Service Account token using Client Credentials flow.
107
+ */
108
+ fetchServiceAccountToken() {
109
+ return __awaiter(this, void 0, void 0, function* () {
110
+ if (!this.options.clientId || !this.options.clientSecret) {
111
+ throw new Error('Client ID and Client Secret are required to fetch Service Account token.');
112
+ }
113
+ const token = yield fetchClientToken(this.options.clientId, this.options.clientSecret, this.options.baseUrl);
114
+ return token;
115
+ });
116
+ }
117
+ /**
118
+ * Perform an HTTP request.
119
+ */
120
+ request(method, path, data, queryParams, config) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ const resp = yield this.axios.request(Object.assign({ method, url: path, data, params: queryParams }, config));
123
+ // 🔧 Normalize non-object responses
124
+ if (typeof resp.data !== 'object') {
125
+ return { data: resp.data };
126
+ }
127
+ return resp.data;
128
+ });
129
+ }
130
+ // ------------------ Data API Methods ------------------
131
+ /** Create a new record in a given recordSlug. */
132
+ createRecord(recordSlug, record) {
133
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug);
134
+ return this.request('POST', path, Object.assign({}, record));
135
+ }
136
+ /** Get the token used for authentication. */
137
+ getToken() {
138
+ return this.token;
139
+ }
140
+ /** Retrieve a record by ID. */
141
+ getRecord(recordSlug, id) {
142
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug, id);
143
+ return this.request('GET', path);
144
+ }
145
+ /** Query records with filters, pagination, etc. */
146
+ queryRecords(recordSlug, queryParams) {
147
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug);
148
+ return this.request('GET', path, null, Object.assign({}, queryParams));
149
+ }
150
+ /** Get records by Ids. */
151
+ getRecordsByIds(recordSlug, ids) {
152
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug) + '/bulk/get';
153
+ return this.request('POST', path, { ids });
154
+ }
155
+ /** Update an existing record by ID. */
156
+ updateRecord(recordSlug, id, updates) {
157
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug, id);
158
+ return this.request('PUT', path, Object.assign({}, updates));
159
+ }
160
+ /** Delete a record by ID. */
161
+ deleteRecord(recordSlug, id) {
162
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug, id);
163
+ return this.request('DELETE', path);
164
+ }
165
+ // ------------------ Compute API Methods ------------------
166
+ /** Invoke a compute function by name with given payload. */
167
+ invokeFunction(functionId, payload) {
168
+ const path = getComputeFunctionTriggerApiPath(this.options.workspaceId, functionId);
169
+ return this.request('POST', path, { data: payload });
170
+ }
171
+ // ------------------ Storage API Methods ------------------
172
+ /** Upload a file to the storage service. */
173
+ uploadFile(file_1, location_1) {
174
+ return __awaiter(this, arguments, void 0, function* (file, location, isPublic = false) {
175
+ const path = getFileUploadApiPath(this.options.workspaceId);
176
+ const formData = new FormData();
177
+ const fileName = this.options.workspaceId + Date.now() + file.name;
178
+ formData.append('file', file);
179
+ formData.append('location', location);
180
+ formData.append('fileName', fileName);
181
+ formData.append('isPublic', isPublic ? 'true' : 'false');
182
+ return this.request('POST', path, formData, undefined, {
183
+ headers: {
184
+ 'Content-Type': 'multipart/form-data',
185
+ },
186
+ });
187
+ });
188
+ }
189
+ }
190
+ exports.CentraliSDK = CentraliSDK;
191
+ /**
192
+ * Usage Example:
193
+ *
194
+ * ```ts
195
+ * import { CentraliSDK, CentraliSDKOptions } from 'centrali-sdk';
196
+ *
197
+ * const options: CentraliSDKOptions = {
198
+ * baseUrl: 'https://api.centrali.com',
199
+ * clientId: process.env.CLIENT_ID,
200
+ * clientSecret: process.env.CLIENT_SECRET,
201
+ * };
202
+ * const client = new CentraliSDK(options);
203
+ *
204
+ * // Automatic client credentials flow on first request
205
+ * const record = await client.createRecord('Customer', { email: 'jane@example.com' });
206
+ *
207
+ * // Or set a user token:
208
+ * client.setToken('<JWT_TOKEN>');
209
+ * await client.queryRecords('Product', { limit: 10 });
210
+ *```
211
+ */
package/index.ts ADDED
@@ -0,0 +1,315 @@
1
+ /*
2
+ * Centrali TypeScript SDK
3
+ * ----------------------
4
+ * A lightweight SDK for interacting with Centrali's Data and Compute APIs,
5
+ * with support for user-provided tokens or client credentials (Client ID/Secret).
6
+ */
7
+
8
+ import axios, {AxiosInstance, AxiosRequestConfig, AxiosRequestHeaders, AxiosResponse, Method} from 'axios';
9
+ import qs from 'qs';
10
+ // Helper to encode form data
11
+ function encodeFormData(data: Record<string, string>): string {
12
+ return new URLSearchParams(data).toString();
13
+ }
14
+
15
+ /**
16
+ * Options for initializing the Centrali SDK client.
17
+ */
18
+ export interface CentraliSDKOptions {
19
+ /** Base URL of the Centrali API (e.g. https://api.centrali.com) */
20
+ baseUrl: string;
21
+ workspaceId: string;
22
+ /** Optional initial bearer token for authentication */
23
+ token?: string;
24
+ /** Optional OAuth2 client credentials */
25
+ clientId?: string;
26
+ clientSecret?: string;
27
+ /** Optional custom axios config */
28
+ axiosConfig?: AxiosRequestConfig;
29
+ }
30
+
31
+ /**
32
+ * Generic API response wrapper.
33
+ */
34
+ export interface ApiResponse<T> {
35
+ data: T;
36
+ meta?: Record<string, any>;
37
+ error?: any
38
+ id?: string;
39
+ createdAt?: string;
40
+ updatedAt?: string;
41
+ }
42
+
43
+
44
+
45
+ /**
46
+ * Generate the auth server URL from the API base URL.
47
+ */
48
+ export function getAuthUrl(apiBaseUrl: string): string {
49
+ const url = new URL(apiBaseUrl);
50
+ // assume auth is hosted at auth.<api-domain>
51
+ return `${url.protocol}//auth.${url.hostname}`;
52
+ }
53
+
54
+ /**
55
+ * Retrieve an access token using the Client Credentials flow.
56
+ */
57
+ export async function fetchClientToken(
58
+ clientId: string,
59
+ clientSecret: string,
60
+ apiBaseUrl: string
61
+ ): Promise<string> {
62
+ const authUrl = getAuthUrl(apiBaseUrl);
63
+ const tokenEndpoint = `${authUrl}/token`;
64
+ const form = encodeFormData({
65
+ grant_type: 'client_credentials',
66
+ client_id: clientId,
67
+ client_secret: clientSecret,
68
+ resource: `${apiBaseUrl}/data`
69
+ });
70
+ const resp = await axios.post(
71
+ tokenEndpoint,
72
+ form,
73
+ { headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
74
+ proxy: false
75
+ }
76
+ );
77
+
78
+ return resp.data.access_token;
79
+ }
80
+
81
+ /**
82
+ * Generate Records API URL PATH.
83
+ */
84
+
85
+ export function getRecordApiPath(workspaceId: string,recordSlug: string, id?: string): string {
86
+ return id ? `data/workspace/${workspaceId}/api/v1/records/slug/${recordSlug}/${id}` : `data/workspace/${workspaceId}/api/v1/records/slug/${recordSlug}`;
87
+ }
88
+
89
+
90
+ /**
91
+ * Generate File Upload API URL PATH.
92
+ * @param workspaceId
93
+ */
94
+ export function getFileUploadApiPath(workspaceId: string): string {
95
+ return `storage/ws/${workspaceId}/api/v1/files`;
96
+ }
97
+
98
+ /*
99
+ * Generate Compute Function Trigger API URL PATH.
100
+ */
101
+ export function getComputeFunctionTriggerApiPath(workspaceId: string, functionId: string): string {
102
+ return `data/workspace/${workspaceId}/api/v1/function-triggers/${functionId}/execute`;
103
+ }
104
+
105
+ /**
106
+ * Main Centrali SDK client.
107
+ */
108
+ export class CentraliSDK {
109
+ private axios: AxiosInstance;
110
+ private token: string | null = null;
111
+ private options: CentraliSDKOptions;
112
+
113
+ constructor(options: CentraliSDKOptions) {
114
+ this.options = options;
115
+ this.token = options.token || null;
116
+ this.axios = axios.create({
117
+ baseURL: options.baseUrl,
118
+ paramsSerializer: (params: Record<string, any>): string =>
119
+ qs.stringify(params, { arrayFormat: "repeat" }),
120
+ proxy: false,
121
+ ...options.axiosConfig,
122
+ });
123
+
124
+ // Attach async interceptor to fetch token on first request if needed
125
+ this.axios.interceptors.request.use(
126
+ async (config) => {
127
+ if (!this.token && this.options.clientId && this.options.clientSecret) {
128
+ this.token = await fetchClientToken(
129
+ this.options.clientId,
130
+ this.options.clientSecret,
131
+ this.options.baseUrl
132
+ );
133
+ }
134
+ if (this.token) {
135
+ config.headers.Authorization = `Bearer ${this.token}`;
136
+ }
137
+ return config;
138
+ },
139
+ (error) => Promise.reject(error)
140
+ );
141
+ }
142
+
143
+ /**
144
+ * Manually set or update the bearer token for subsequent requests.
145
+ */
146
+ public setToken(token: string): void {
147
+ this.token = token;
148
+ }
149
+
150
+ /**
151
+ * Fetch Service Account token using Client Credentials flow.
152
+ */
153
+ public async fetchServiceAccountToken(): Promise<string> {
154
+ if (!this.options.clientId || !this.options.clientSecret) {
155
+ throw new Error('Client ID and Client Secret are required to fetch Service Account token.');
156
+ }
157
+ const token = await fetchClientToken(
158
+ this.options.clientId,
159
+ this.options.clientSecret,
160
+ this.options.baseUrl
161
+ );
162
+ return token;
163
+ }
164
+
165
+ /**
166
+ * Perform an HTTP request.
167
+ */
168
+ private async request<T>(
169
+ method: Method,
170
+ path: string,
171
+ data?: any,
172
+ queryParams?: Record<string, any>,
173
+ config?: AxiosRequestConfig
174
+ ): Promise<ApiResponse<T>> {
175
+ const resp = await this.axios.request<ApiResponse<T>>({
176
+ method,
177
+ url: path,
178
+ data,
179
+ params: queryParams,
180
+ ...config,
181
+ });
182
+
183
+ // 🔧 Normalize non-object responses
184
+ if (typeof resp.data !== 'object') {
185
+ return { data: resp.data as T };
186
+ }
187
+ return resp.data;
188
+ }
189
+
190
+ // ------------------ Data API Methods ------------------
191
+
192
+ /** Create a new record in a given recordSlug. */
193
+ public createRecord<T = any>(
194
+ recordSlug: string,
195
+ record: Record<string, any>
196
+ ): Promise<ApiResponse<T>> {
197
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug);
198
+ return this.request('POST', path, { ...record });
199
+ }
200
+
201
+ /** Get the token used for authentication. */
202
+ public getToken(): string | null {
203
+ return this.token;
204
+ }
205
+
206
+
207
+ /** Retrieve a record by ID. */
208
+ public getRecord<T = any>(
209
+ recordSlug: string,
210
+ id: string
211
+ ): Promise<ApiResponse<T>> {
212
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug, id);
213
+ return this.request('GET', path);
214
+ }
215
+
216
+ /** Query records with filters, pagination, etc. */
217
+ public queryRecords<T = any>(
218
+ recordSlug: string,
219
+ queryParams: Record<string, any>
220
+ ): Promise<ApiResponse<T>> {
221
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug);
222
+ return this.request('GET', path, null, {
223
+ ...queryParams,
224
+ });
225
+ }
226
+
227
+ /** Get records by Ids. */
228
+ public getRecordsByIds<T = any>(
229
+ recordSlug: string,
230
+ ids: string[]
231
+ ): Promise<ApiResponse<T[]>> {
232
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug) + '/bulk/get';
233
+ return this.request('POST', path, { ids });
234
+ }
235
+
236
+ /** Update an existing record by ID. */
237
+ public updateRecord<T = any>(
238
+ recordSlug: string,
239
+ id: string,
240
+ updates: Record<string, any>
241
+ ): Promise<ApiResponse<T>> {
242
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug, id);
243
+ return this.request('PUT', path, { ...updates });
244
+ }
245
+
246
+ /** Delete a record by ID. */
247
+ public deleteRecord(
248
+ recordSlug: string,
249
+ id: string
250
+ ): Promise<ApiResponse<null>> {
251
+ const path = getRecordApiPath(this.options.workspaceId, recordSlug, id);
252
+ return this.request('DELETE', path);
253
+ }
254
+
255
+ // ------------------ Compute API Methods ------------------
256
+
257
+ /** Invoke a compute function by name with given payload. */
258
+ public invokeFunction<T = any>(
259
+ functionId: string,
260
+ payload: Record<string, any>
261
+ ): Promise<ApiResponse<T>> {
262
+ const path = getComputeFunctionTriggerApiPath(this.options.workspaceId, functionId);
263
+ return this.request('POST', path, { data: payload });
264
+ }
265
+
266
+
267
+
268
+
269
+ // ------------------ Storage API Methods ------------------
270
+
271
+ /** Upload a file to the storage service. */
272
+ public async uploadFile(
273
+ file: File,
274
+ location: string,
275
+ isPublic: boolean = false
276
+ ): Promise<ApiResponse<string>> {
277
+ const path = getFileUploadApiPath(this.options.workspaceId);
278
+ const formData = new FormData();
279
+ const fileName = this.options.workspaceId + Date.now() + file.name;
280
+
281
+ formData.append('file', file);
282
+ formData.append('location', location);
283
+ formData.append('fileName', fileName);
284
+ formData.append('isPublic', isPublic ? 'true' : 'false');
285
+
286
+ return this.request<string>('POST', path, formData, undefined, {
287
+ headers: {
288
+ 'Content-Type': 'multipart/form-data',
289
+ },
290
+ });
291
+ }
292
+
293
+ }
294
+
295
+ /**
296
+ * Usage Example:
297
+ *
298
+ * ```ts
299
+ * import { CentraliSDK, CentraliSDKOptions } from 'centrali-sdk';
300
+ *
301
+ * const options: CentraliSDKOptions = {
302
+ * baseUrl: 'https://api.centrali.com',
303
+ * clientId: process.env.CLIENT_ID,
304
+ * clientSecret: process.env.CLIENT_SECRET,
305
+ * };
306
+ * const client = new CentraliSDK(options);
307
+ *
308
+ * // Automatic client credentials flow on first request
309
+ * const record = await client.createRecord('Customer', { email: 'jane@example.com' });
310
+ *
311
+ * // Or set a user token:
312
+ * client.setToken('<JWT_TOKEN>');
313
+ * await client.queryRecords('Product', { limit: 10 });
314
+ *```
315
+ */
package/package.json ADDED
@@ -0,0 +1,32 @@
1
+ {
2
+ "name": "@centrali-io/centrali-sdk",
3
+ "version": "1.8.7",
4
+ "description": "Centrali Node SDK",
5
+ "main": "dist/index.js",
6
+ "type": "commonjs",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/blueinit/centrali-sdk.git"
10
+ },
11
+ "scripts": {
12
+ "build": "tsc --project tsconfig.json",
13
+ "prepublishOnly": "npm run build",
14
+ "test": "echo \"Error: no test specified\" && exit 1"
15
+ },
16
+ "keywords": [],
17
+ "author": "Blueinit",
18
+ "license": "ISC",
19
+ "dependencies": {
20
+ "axios": "^1.12.0",
21
+ "qs": "^6.14.0"
22
+ },
23
+ "devDependencies": {
24
+ "@types/q": "^1.5.8",
25
+ "@types/qs": "^6.14.0",
26
+ "typescript": "^5.8.3"
27
+ },
28
+ "publishConfig": {
29
+ "registry": "https://registry.npmjs.org/",
30
+ "access": "public"
31
+ }
32
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,113 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ // "libReplacement": true, /* Enable lib replacement. */
18
+ // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
19
+ // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
20
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
21
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
22
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
23
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
24
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
25
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
26
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
27
+
28
+ /* Modules */
29
+ "module": "commonjs", /* Specify what module code is generated. */
30
+ // "rootDir": "./", /* Specify the root folder within your source files. */
31
+ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
32
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
33
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
34
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
35
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
36
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
37
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
38
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
39
+ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
40
+ // "rewriteRelativeImportExtensions": true, /* Rewrite '.ts', '.tsx', '.mts', and '.cts' file extensions in relative import paths to their JavaScript equivalent in output files. */
41
+ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
42
+ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
43
+ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
44
+ // "noUncheckedSideEffectImports": true, /* Check side effect imports. */
45
+ // "resolveJsonModule": true, /* Enable importing .json files. */
46
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
47
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
48
+
49
+ /* JavaScript Support */
50
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
51
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
52
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
53
+
54
+ /* Emit */
55
+ // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
56
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
57
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
58
+ // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
59
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
60
+ // "noEmit": true, /* Disable emitting files from a compilation. */
61
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
62
+ "outDir": "./dist", /* Specify an output folder for all emitted files. */
63
+ // "removeComments": true, /* Disable emitting comments. */
64
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
65
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
66
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
67
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
68
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
69
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
70
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
71
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
72
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
73
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
74
+ // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
75
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
76
+
77
+ /* Interop Constraints */
78
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
79
+ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
80
+ // "isolatedDeclarations": true, /* Require sufficient annotation on exports so other tools can trivially generate declaration files. */
81
+ // "erasableSyntaxOnly": true, /* Do not allow runtime constructs that are not part of ECMAScript. */
82
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
83
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
84
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
85
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
86
+
87
+ /* Type Checking */
88
+ "strict": true, /* Enable all strict type-checking options. */
89
+ // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
90
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
91
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
92
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
93
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
94
+ // "strictBuiltinIteratorReturn": true, /* Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'. */
95
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
96
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
97
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
98
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
99
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
100
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
101
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
102
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
103
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
104
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
105
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
106
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
107
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
108
+
109
+ /* Completeness */
110
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
111
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
112
+ }
113
+ }