totalum-api-sdk 2.0.6 → 2.0.8

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/utils.js ADDED
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UtilsService = void 0;
4
+ class UtilsService {
5
+ static getUrl(baseUrl, pattern, params) {
6
+ let url = baseUrl + pattern;
7
+ for (const key in params) {
8
+ url = url.replace(`:${key}`, params[key]);
9
+ }
10
+ return url;
11
+ }
12
+ }
13
+ exports.UtilsService = UtilsService;
package/package.json CHANGED
@@ -1,8 +1,10 @@
1
1
  {
2
2
  "name": "totalum-api-sdk",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "description": "Totalum sdk wraper of totalum api",
5
5
  "main": "./dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "files": ["dist"],
6
8
  "scripts": {
7
9
  "build": "tsc"
8
10
  },
@@ -1,186 +0,0 @@
1
- //INTERFACES
2
-
3
- export interface GoogleCalendarI {
4
- summary: string;
5
- location?: string;
6
- description?: string;
7
- start: {
8
- dateTime: string;
9
- timeZone?: string;
10
- };
11
- end: {
12
- dateTime: string;
13
- timeZone?: string;
14
- };
15
- attendees?: {email: string}[];
16
- reminders?: Reminders;
17
- }
18
-
19
- interface Reminders {
20
- useDefault: boolean;
21
- overrides?: {
22
- method: string;
23
- minutes: number;
24
- }[];
25
- }
26
-
27
- export interface GoogleCalendarEventsResponseI {
28
- accessRole: string;
29
- defaultReminders: { method: string; minutes: number }[];
30
- etag: string;
31
- items: {
32
- kind: string;
33
- etag: string;
34
- id: string;
35
- attendees?: {
36
- email: string;
37
- responseStatus: string;
38
- }[];
39
- created: string;
40
- creator: {
41
- email: string;
42
- self?: boolean;
43
- };
44
- description: string;
45
- end: {
46
- dateTime: string;
47
- timeZone: string;
48
- };
49
- eventType: string;
50
- htmlLink: string;
51
- iCalUID: string;
52
- location: string;
53
- organizer: {
54
- email: string;
55
- self?: boolean;
56
- };
57
- reminders: { useDefault: boolean };
58
- sequence: number;
59
- start: {
60
- dateTime: string;
61
- timeZone: string;
62
- };
63
- status: string;
64
- summary: string;
65
- // Additional fields can be added here
66
- }[];
67
- }
68
-
69
- export interface GoogleEmailI {
70
- to: string;
71
- subject: string;
72
- message: string;
73
- }
74
-
75
- export interface GoogleEmailResponseI {
76
- id: string;
77
- threadId: string;
78
- labelIds: string[];
79
- snippet: string;
80
- payload: {
81
- partId: string;
82
- mimeType: string;
83
- filename: string;
84
- headers: {
85
- name: string;
86
- value: string;
87
- }[];
88
- body: {
89
- size: number;
90
- data: string;
91
- };
92
- };
93
- sizeEstimate: number;
94
- historyId: string;
95
- internalDate: string;
96
- fullText: string;
97
- }
98
-
99
-
100
- export interface StructureLevels {
101
- id: string, // the id of the node
102
- typeId: string,
103
- propertyId?: string,
104
- children: Array<StructureLevels>
105
- }
106
-
107
- export interface FilterSearchQueryI {
108
- filter?: FiltersArrayI,
109
- sort?: ISearchQuerySort[],
110
- pagination?: {
111
- limit?: number,
112
- page?: number,
113
- skip?: number
114
- }
115
- }
116
-
117
- export type FilterLookupSearchQueryI = {
118
- pagination: {
119
- limit?: number;
120
- page?: number;
121
- skip?: number;
122
- };
123
- filters: FilterStructureLevelsI
124
- };
125
-
126
- export interface FilterStructureLevelsI extends StructureLevels {
127
- filters?: FiltersArrayI;
128
- children: FilterStructureLevelsI[];
129
- }
130
-
131
- export type FiltersArrayI = Array<ISearchQueryFilterOr | ISearchQueryFilterOptions>;
132
-
133
- export interface ISearchQueryFilterOr {
134
- or: ISearchQueryFilterOptions[]
135
- }
136
-
137
- export interface ISearchQuerySort {
138
- [key: string]: 1 | -1
139
- }
140
-
141
- export interface ISearchQueryFilterOptions {
142
- [key: string]: number | Date | boolean | string | PropertyQueryOptionsI
143
- }
144
-
145
- export interface PropertyQueryOptionsI {
146
- regex?: number | string,
147
- // options field is only valid for regex
148
- options?: 'i' | 'm' | 'x' | 's', //for more info check: https://www.mongodb.com/docs/manual/reference/operator/query/regex/
149
- gte?: number | Date,
150
- lte?: number | Date,
151
- gt?: number | Date,
152
- lt?: number | Date
153
- }
154
-
155
- export type fieldValuesEnabled = string | number | boolean | Date
156
-
157
-
158
- export interface DataValues {
159
- typeId: string,
160
- id: string,
161
- _id: string,
162
- properties: DataProperties,
163
- updates?: string,
164
- createdAt?: Date,
165
- updatedAt?: Date,
166
- lastUsersActions?: {
167
- [key: string]: any
168
- }
169
- }
170
-
171
- export interface DataProperties {
172
- [key: string]: fieldValuesEnabled | {name: string, previousFilename: string},
173
- }
174
-
175
-
176
- export interface AuthOptions {
177
- token?: {
178
- accessToken: string
179
- },
180
- apiKey?: {
181
- apiKey: string,
182
- apiKeyName: string,
183
- organizationId: string,
184
- },
185
- baseUrl?: string
186
- }
package/index.ts DELETED
@@ -1,64 +0,0 @@
1
- import axios from 'axios';
2
- import { ChatCompletionCreateParamsBase } from 'openai/resources/chat/completions';
3
- import { Completion, CompletionCreateParamsBase } from 'openai/resources/completions';
4
- import * as qs from 'qs';
5
- import { AuthOptions, FilterSearchQueryI, DataProperties, GoogleCalendarI } from './common/interfaces';
6
-
7
- import { OpenaiService } from './services/OpenaiService';
8
- import { UtilsService } from './utils';
9
- import { GoogleService } from './services/GoogleService';
10
- import { FilterService } from './services/FilterService';
11
- import { FilesService } from './services/FilesService';
12
- import { CrudService } from './services/CrudService';
13
-
14
-
15
-
16
-
17
- export class TotalumApiSdk {
18
- private authOptions: AuthOptions;
19
-
20
- private _baseUrl: string = 'https://api.totalum.app/';
21
- private _headers: any;
22
- public openai: OpenaiService;
23
- public files: FilesService;
24
- public google: GoogleService;
25
- public filter: FilterService;
26
- public crud:CrudService;
27
-
28
- constructor(authOptions: AuthOptions) {
29
- this.authOptions = authOptions;
30
- if (this.authOptions.token?.accessToken) {
31
- this._headers = {
32
- authorization: this.authOptions.token.accessToken
33
- }
34
- } else if (this.authOptions.apiKey?.apiKey && this.authOptions.apiKey?.organizationId) {
35
- this._headers = {
36
- 'api-key': this.authOptions.apiKey.apiKey,
37
- 'organization-id': this.authOptions.apiKey.organizationId,
38
- 'api-key-name': this.authOptions.apiKey.apiKeyName
39
- }
40
- } else {
41
- throw new Error('Error: invalid auth options')
42
- }
43
- if (this.authOptions.baseUrl) {
44
- this._baseUrl = this.authOptions.baseUrl;
45
- }
46
- this.setRequestData();
47
- }
48
-
49
- public changeBaseUrl(newBaseUrl: string) {
50
- this._baseUrl = newBaseUrl;
51
- //update services with new implementation
52
- this.setRequestData();
53
- }
54
-
55
- private setRequestData() {
56
- this.crud = new CrudService(this._baseUrl, this._headers);
57
- this.openai = new OpenaiService(this._baseUrl, this._headers);
58
- this.files = new FilesService(this._baseUrl, this._headers);
59
- this.google = new GoogleService(this._baseUrl, this._headers);
60
- this.filter = new FilterService(this._baseUrl, this._headers);
61
- }
62
-
63
-
64
- }
@@ -1,44 +0,0 @@
1
- import axios from "axios";
2
- import { FilterSearchQueryI, DataProperties } from "../common/interfaces";
3
- import { UtilsService } from "../utils";
4
- import { endpoints } from "../common/endpoints";
5
-
6
-
7
-
8
- export class CrudService {
9
-
10
- private headers: any;
11
- private baseUrl: string;
12
-
13
- constructor(baseUrl: string, headers: any) {
14
- this.headers = headers
15
- this.baseUrl = baseUrl;
16
- }
17
-
18
- public async getItemById(itemType: string, id: string) {
19
- const url = UtilsService.getUrl(this.baseUrl, endpoints.crud.getObjectById, { typeId: itemType, id });
20
- return axios.get(url, { headers: this.headers });
21
- }
22
-
23
- public getItems(itemType: string, query?: FilterSearchQueryI) {
24
- const url = UtilsService.getUrl(this.baseUrl, endpoints.crud.getObjects, { typeId: itemType });
25
- return axios.get(url, { params: query, headers: this.headers });
26
- }
27
-
28
- public async deleteItemById(itemType: string, id: string) {
29
- const url = UtilsService.getUrl(this.baseUrl, endpoints.crud.deleteObject, { typeId: itemType, id });
30
- return axios.delete(url, { headers: this.headers });
31
- }
32
-
33
- public async editItemById(itemType: string, id: string, properties: any) {
34
- const url = UtilsService.getUrl(this.baseUrl, endpoints.crud.editObjectProperties, { typeId: itemType, id });
35
- return axios.patch(url, properties, { headers: this.headers });
36
- }
37
-
38
- public async createItem(itemType: string, item: DataProperties) {
39
- const url = UtilsService.getUrl(this.baseUrl, endpoints.crud.createObject, { typeId: itemType });
40
- return axios.post(url, item, { headers: this.headers });
41
- }
42
-
43
-
44
- }
@@ -1,43 +0,0 @@
1
- import axios from "axios";
2
- import { UtilsService } from "../utils";
3
- import { endpoints } from "../common/endpoints";
4
-
5
-
6
- export class FilesService {
7
-
8
- private headers: any;
9
- private baseUrl: string;
10
-
11
- constructor(baseUrl: string, headers: any) {
12
- this.headers = headers
13
- this.baseUrl = baseUrl;
14
- }
15
-
16
-
17
- public async uploadFile(fileFormData: any) {
18
- const url = UtilsService.getUrl(this.baseUrl, endpoints.files.uploadFile);
19
- return axios.post(url, fileFormData, { headers: this.headers });
20
- }
21
-
22
- public async getDownloadUrl(fileName: string) {
23
- const url = UtilsService.getUrl(this.baseUrl, endpoints.files.getDownloadUrl, { fileName });
24
- return axios.get(url, { headers: this.headers });
25
- }
26
-
27
- public async generatePdfByTemplate(id: string, variables: { [variableName: string]: any }, name: string) {
28
- const url = UtilsService.getUrl(this.baseUrl, endpoints.pdfTemplate.generatePdfByTemplate, { id });
29
- return axios.post(url, { templateId: id, variables, name }, { headers: this.headers });
30
- }
31
-
32
-
33
- public async ocrOfImage(fileName:string) {
34
- const url = UtilsService.getUrl(this.baseUrl, endpoints.files.ocrOfImage);
35
- return axios.post(url, { fileName }, { headers: this.headers });
36
- }
37
-
38
- public async ocrOfPdf(fileName:string) {
39
- const url = UtilsService.getUrl(this.baseUrl, endpoints.files.ocrOfPdf);
40
- return axios.post(url, { fileName }, { headers: this.headers });
41
- }
42
-
43
- }
@@ -1,43 +0,0 @@
1
- import axios from "axios";
2
- import { endpoints } from "../common/endpoints";
3
- import { UtilsService } from "../utils";
4
- import { FilterLookupSearchQueryI } from "../common/interfaces";
5
-
6
-
7
-
8
- export class FilterService {
9
-
10
- private headers: any;
11
- private baseUrl: string;
12
-
13
- constructor(baseUrl: string, headers: any) {
14
- this.headers = headers
15
- this.baseUrl = baseUrl;
16
- }
17
-
18
- /*public async customMongoFilter(customMongoFilter: string, rootTypeId: string, typeIdToGet: string, options?: { variables?: any, pagination?: any, sort?: any, returnCount?: boolean }) {
19
- const url = UtilsService.getUrl(this.baseUrl, endpoints.filter.customMongoFilter, {});
20
- const body = { sort: options?.sort, variables: options?.variables, customMongoFilter, pagination: options?.pagination, rootTypeId, typeIdToGet };
21
- const params = options?.returnCount ? { returnCount: options?.returnCount } : null;
22
- return axios.post(url, body, { params: params, headers: this.headers });
23
- }*/
24
-
25
- public async lookUpFilter(idPage: string, query: FilterLookupSearchQueryI, idsOfMultipleNodesToSearch?: string[], returnCount?: boolean) {
26
- const url = UtilsService.getUrl(this.baseUrl, endpoints.filter.lookUpFilter, { idPage });
27
-
28
- const params = {
29
- query: encodeURIComponent(JSON.stringify(query)),
30
- idsOfMultipleNodesToSearch: encodeURIComponent(JSON.stringify(idsOfMultipleNodesToSearch)),
31
- returnCount: returnCount,
32
- };
33
- return axios.get(url, { params: params, headers: this.headers });
34
- }
35
-
36
- public async runCustomMongoAggregationQuery(type: string, customMongoQuery: string) {
37
- const url = UtilsService.getUrl(this.baseUrl, endpoints.filter.runCustomAggregationQuery);
38
- const body = { customMongoQuery, type };
39
- return axios.post(url, body, { headers: this.headers });
40
- }
41
-
42
-
43
- }
@@ -1,48 +0,0 @@
1
- import axios from "axios";
2
- import { endpoints } from "../common/endpoints";
3
- import { GoogleCalendarI } from "../common/interfaces";
4
- import { UtilsService } from "../utils";
5
-
6
-
7
-
8
-
9
- export class GoogleService {
10
-
11
- private headers: any;
12
- private baseUrl: string;
13
-
14
- constructor(baseUrl: string, headers: any) {
15
- this.headers = headers
16
- this.baseUrl = baseUrl;
17
- }
18
-
19
- public async getGoogleAccountEmails(accountEmail: string) {
20
-
21
- const url = UtilsService.getUrl(this.baseUrl, endpoints.googleIntegration.getEmails, {});
22
- const params = { userEmail: accountEmail };
23
- return axios.get(url, { params: params, headers: this.headers });
24
- }
25
-
26
- public async googleAccountSendEmail(accountEmail: string, body: {to: string, subject: string, message?: string, html?:string}) {
27
- const url = UtilsService.getUrl(this.baseUrl, endpoints.googleIntegration.sendEmail, {});
28
- const params = { userEmail: accountEmail };
29
- return axios.post(url, body, { params: params, headers: this.headers });
30
- }
31
-
32
- public async getGoogleCalendarEvents(accountEmail: string) {
33
-
34
- const url = UtilsService.getUrl(this.baseUrl, endpoints.googleIntegration.getCalendarEvents, {});
35
- const params = { userEmail: accountEmail };
36
- return axios.get(url, { params: params, headers: this.headers });
37
- }
38
-
39
- public async createCalendarEvent(accountEmail: string, body: GoogleCalendarI) {
40
-
41
- const url = UtilsService.getUrl(this.baseUrl, endpoints.googleIntegration.createCalendarEvent, {});
42
- const params = { userEmail: accountEmail };
43
- return axios.post(url, body, { params: params, headers: this.headers });
44
- }
45
-
46
-
47
-
48
- }
@@ -1,55 +0,0 @@
1
- import axios, { AxiosResponse } from "axios";
2
- import { Completion } from "openai/resources";
3
- import { ChatCompletionCreateParamsBase } from "openai/resources/chat/completions";
4
- import { CompletionCreateParamsBase } from "openai/resources/completions";
5
- import { UtilsService } from "../utils";
6
- import { endpoints } from "../common/endpoints";
7
-
8
-
9
- export class OpenaiService {
10
-
11
- private headers: any;
12
- private baseUrl: string;
13
-
14
- constructor(baseUrl: string, headers: any) {
15
- this.headers = headers
16
- this.baseUrl = baseUrl;
17
- }
18
-
19
- /**
20
- *
21
- * @param body the openai completion body, more info here: https://platform.openai.com/docs/api-reference/completions/create
22
- * @returns the completion provided by openai api
23
- * @deprecated use createChatCompletion instead
24
- */
25
- public async createCompletion(body: CompletionCreateParamsBase): Promise<AxiosResponse<{data:Completion}>> {
26
- const url = UtilsService.getUrl(this.baseUrl, endpoints.openai.createCompletion);
27
- const b = body;
28
- return axios.post(url, b, { headers: this.headers });
29
- }
30
-
31
- /**
32
- *
33
- * @param body the openai chat completion body, more info here: https://platform.openai.com/docs/api-reference/chat/create
34
- * @returns the chat completion provided by openai api
35
- */
36
- public async createChatCompletion(body: ChatCompletionCreateParamsBase): Promise<AxiosResponse<{data:Completion}>> {
37
-
38
- const url = UtilsService.getUrl(this.baseUrl, endpoints.openai.createChatCompletion);
39
- const b = body;
40
- return axios.post(url, b, { headers: this.headers });
41
- }
42
-
43
- /**
44
- *
45
- * @param body the openai chat completion body, more info here: https://platform.openai.com/docs/api-reference/chat/create
46
- * @returns the chat completion provided by openai api
47
- */
48
- public async generateImage(body: {prompt:string, size: '256x256' | '512x512' | '1024x1024', fileName: string}): Promise<AxiosResponse<{data:Completion}>> {
49
-
50
- const url = UtilsService.getUrl(this.baseUrl, endpoints.openai.generateImage);
51
- const b = body;
52
- return axios.post(url, b, { headers: this.headers });
53
- }
54
-
55
- }
package/tsconfig.json DELETED
@@ -1,109 +0,0 @@
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
- "declaration": true,
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
- // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */
18
- // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */
19
- // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
- // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
- // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
- // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
- // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
- // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
- // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
-
27
- /* Modules */
28
- "module": "commonjs", /* Specify what module code is generated. */
29
- // "rootDir": "./", /* Specify the root folder within your source files. */
30
- // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
31
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
- // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
- // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
- // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
- // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
- // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
- // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
- // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
39
- // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
40
- // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
41
- // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
42
- // "resolveJsonModule": true, /* Enable importing .json files. */
43
- // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
44
- // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
45
-
46
- /* JavaScript Support */
47
- // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
48
- // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
49
- // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
50
-
51
- /* Emit */
52
- // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
53
- // "declarationMap": true, /* Create sourcemaps for d.ts files. */
54
- // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
55
- // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
56
- // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
57
- // "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. */
58
- "outDir": "./dist", /* Specify an output folder for all emitted files. */
59
- // "removeComments": true, /* Disable emitting comments. */
60
- // "noEmit": true, /* Disable emitting files from a compilation. */
61
- // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
62
- // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
63
- // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
64
- // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
65
- // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
66
- // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
67
- // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
68
- // "newLine": "crlf", /* Set the newline character for emitting files. */
69
- // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
70
- // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
71
- // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
72
- // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
73
- // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
74
- // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
75
-
76
- /* Interop Constraints */
77
- // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
78
- // "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. */
79
- // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
80
- "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
81
- // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
82
- "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
83
-
84
- /* Type Checking */
85
- "strict": true, /* Enable all strict type-checking options. */
86
- // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
87
- // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
88
- // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
89
- // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
90
- "strictPropertyInitialization": false, /* Check for class properties that are declared but not set in the constructor. */
91
- // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
92
- // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
93
- // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
94
- // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
95
- // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
96
- // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
97
- // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
98
- // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
99
- // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
100
- // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
101
- // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
102
- // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
103
- // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
104
-
105
- /* Completeness */
106
- // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
107
- "skipLibCheck": true /* Skip type checking all .d.ts files. */
108
- }
109
- }
package/utils.ts DELETED
@@ -1,12 +0,0 @@
1
-
2
-
3
- export class UtilsService {
4
-
5
- static getUrl(baseUrl: string, pattern: string, params?: any): string {
6
- let url = baseUrl + pattern;
7
- for (const key in params) {
8
- url = url.replace(`:${key}`, params[key]);
9
- }
10
- return url;
11
- }
12
- }