librechat-data-provider 0.8.402 → 0.8.404
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.es.js +1 -1
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react-query/index.es.js +1 -1
- package/dist/react-query/index.es.js.map +1 -1
- package/dist/types/accessPermissions.d.ts +744 -0
- package/dist/types/actions.d.ts +118 -0
- package/dist/types/api-endpoints.d.ts +150 -0
- package/dist/types/artifacts.d.ts +97 -0
- package/dist/types/azure.d.ts +22 -0
- package/dist/types/bedrock.d.ts +1220 -0
- package/dist/types/config.d.ts +14849 -0
- package/dist/types/config.spec.d.ts +1 -0
- package/dist/types/createPayload.d.ts +5 -0
- package/dist/types/data-service.d.ts +287 -0
- package/dist/types/feedback.d.ts +36 -0
- package/dist/types/file-config.d.ts +263 -0
- package/dist/types/file-config.spec.d.ts +1 -0
- package/dist/types/generate.d.ts +597 -0
- package/dist/types/headers-helpers.d.ts +2 -0
- package/{src/index.ts → dist/types/index.d.ts} +0 -15
- package/dist/types/keys.d.ts +92 -0
- package/dist/types/mcp.d.ts +2760 -0
- package/dist/types/messages.d.ts +10 -0
- package/dist/types/models.d.ts +1547 -0
- package/dist/types/parameterSettings.d.ts +69 -0
- package/dist/types/parsers.d.ts +110 -0
- package/dist/types/permissions.d.ts +522 -0
- package/dist/types/react-query/react-query-service.d.ts +85 -0
- package/dist/types/request.d.ts +25 -0
- package/dist/types/roles.d.ts +554 -0
- package/dist/types/roles.spec.d.ts +1 -0
- package/dist/types/schemas.d.ts +5110 -0
- package/dist/types/schemas.spec.d.ts +1 -0
- package/dist/types/types/agents.d.ts +433 -0
- package/dist/types/types/assistants.d.ts +547 -0
- package/dist/types/types/files.d.ts +172 -0
- package/dist/types/types/graph.d.ts +135 -0
- package/{src/types/mcpServers.ts → dist/types/types/mcpServers.d.ts} +12 -18
- package/dist/types/types/mutations.d.ts +209 -0
- package/dist/types/types/queries.d.ts +169 -0
- package/dist/types/types/runs.d.ts +36 -0
- package/dist/types/types/web.d.ts +520 -0
- package/dist/types/types.d.ts +503 -0
- package/dist/types/utils.d.ts +12 -0
- package/package.json +5 -1
- package/babel.config.js +0 -4
- package/check_updates.sh +0 -52
- package/jest.config.js +0 -19
- package/react-query/package-lock.json +0 -292
- package/react-query/package.json +0 -10
- package/rollup.config.js +0 -74
- package/server-rollup.config.js +0 -40
- package/specs/actions.spec.ts +0 -2533
- package/specs/api-endpoints-subdir.spec.ts +0 -140
- package/specs/api-endpoints.spec.ts +0 -74
- package/specs/azure.spec.ts +0 -844
- package/specs/bedrock.spec.ts +0 -862
- package/specs/filetypes.spec.ts +0 -175
- package/specs/generate.spec.ts +0 -770
- package/specs/headers-helpers.spec.ts +0 -24
- package/specs/mcp.spec.ts +0 -147
- package/specs/openapiSpecs.ts +0 -524
- package/specs/parsers.spec.ts +0 -601
- package/specs/request-interceptor.spec.ts +0 -304
- package/specs/utils.spec.ts +0 -196
- package/src/accessPermissions.ts +0 -346
- package/src/actions.ts +0 -813
- package/src/api-endpoints.ts +0 -440
- package/src/artifacts.ts +0 -3104
- package/src/azure.ts +0 -328
- package/src/bedrock.ts +0 -425
- package/src/config.spec.ts +0 -315
- package/src/config.ts +0 -2006
- package/src/createPayload.ts +0 -46
- package/src/data-service.ts +0 -1087
- package/src/feedback.ts +0 -141
- package/src/file-config.spec.ts +0 -1248
- package/src/file-config.ts +0 -764
- package/src/generate.ts +0 -634
- package/src/headers-helpers.ts +0 -13
- package/src/keys.ts +0 -99
- package/src/mcp.ts +0 -271
- package/src/messages.ts +0 -50
- package/src/models.ts +0 -69
- package/src/parameterSettings.ts +0 -1111
- package/src/parsers.ts +0 -563
- package/src/permissions.ts +0 -188
- package/src/react-query/react-query-service.ts +0 -566
- package/src/request.ts +0 -171
- package/src/roles.spec.ts +0 -132
- package/src/roles.ts +0 -225
- package/src/schemas.spec.ts +0 -355
- package/src/schemas.ts +0 -1234
- package/src/types/agents.ts +0 -470
- package/src/types/assistants.ts +0 -654
- package/src/types/files.ts +0 -191
- package/src/types/graph.ts +0 -145
- package/src/types/mutations.ts +0 -422
- package/src/types/queries.ts +0 -208
- package/src/types/runs.ts +0 -40
- package/src/types/web.ts +0 -588
- package/src/types.ts +0 -676
- package/src/utils.ts +0 -85
- package/tsconfig.json +0 -28
- package/tsconfig.spec.json +0 -10
- /package/{src/react-query/index.ts → dist/types/react-query/index.d.ts} +0 -0
- /package/{src/types/index.ts → dist/types/types/index.d.ts} +0 -0
package/specs/filetypes.spec.ts
DELETED
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
fileConfig,
|
|
3
|
-
fullMimeTypesList,
|
|
4
|
-
codeInterpreterMimeTypesList,
|
|
5
|
-
retrievalMimeTypesList,
|
|
6
|
-
supportedMimeTypes,
|
|
7
|
-
codeInterpreterMimeTypes,
|
|
8
|
-
retrievalMimeTypes,
|
|
9
|
-
excelFileTypes,
|
|
10
|
-
excelMimeTypes,
|
|
11
|
-
fileConfigSchema,
|
|
12
|
-
mergeFileConfig,
|
|
13
|
-
mbToBytes,
|
|
14
|
-
} from '../src/file-config';
|
|
15
|
-
|
|
16
|
-
describe('MIME Type Regex Patterns', () => {
|
|
17
|
-
const unsupportedMimeTypes = ['text/x-unknown', 'application/unknown', 'image/bmp'];
|
|
18
|
-
|
|
19
|
-
// Testing general supported MIME types
|
|
20
|
-
fullMimeTypesList.forEach((mimeType) => {
|
|
21
|
-
test(`"${mimeType}" should match one of the supported regex patterns in supportedMimeTypes`, () => {
|
|
22
|
-
const matches = supportedMimeTypes.some((regex) => regex.test(mimeType));
|
|
23
|
-
expect(matches).toBeTruthy();
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
// Testing unsupported MIME types
|
|
28
|
-
unsupportedMimeTypes.forEach((mimeType) => {
|
|
29
|
-
test(`"${mimeType}" should not match any of the supported regex patterns in supportedMimeTypes`, () => {
|
|
30
|
-
const matches = supportedMimeTypes.some((regex) => regex.test(mimeType));
|
|
31
|
-
expect(matches).toBeFalsy();
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
// Testing MIME types for Code Interpreter support
|
|
36
|
-
codeInterpreterMimeTypesList.forEach((mimeType) => {
|
|
37
|
-
test(`"${mimeType}" should be supported by codeInterpreterMimeTypes`, () => {
|
|
38
|
-
const matches = codeInterpreterMimeTypes.some((regex) => regex.test(mimeType));
|
|
39
|
-
expect(matches).toBeTruthy();
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
// Testing MIME types for Retrieval support
|
|
44
|
-
retrievalMimeTypesList.forEach((mimeType) => {
|
|
45
|
-
test(`"${mimeType}" should be supported by retrievalMimeTypes`, () => {
|
|
46
|
-
const matches = retrievalMimeTypes.some((regex) => regex.test(mimeType));
|
|
47
|
-
expect(matches).toBeTruthy();
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
describe('MIME Types Exclusive to Code Interpreter', () => {
|
|
53
|
-
const exclusiveCodeInterpreterMimeTypes = codeInterpreterMimeTypesList.filter(
|
|
54
|
-
(mimeType) => !retrievalMimeTypesList.includes(mimeType),
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
exclusiveCodeInterpreterMimeTypes.forEach((mimeType) => {
|
|
58
|
-
test(`"${mimeType}" should not be supported by retrievalMimeTypes`, () => {
|
|
59
|
-
const isSupportedByRetrieval = retrievalMimeTypes.some((regex) => regex.test(mimeType));
|
|
60
|
-
expect(isSupportedByRetrieval).toBeFalsy();
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
describe('Testing Excel MIME types', () => {
|
|
66
|
-
excelFileTypes.forEach((mimeType) => {
|
|
67
|
-
test(`"${mimeType}" should match one of the supported regex patterns in supportedMimeTypes`, () => {
|
|
68
|
-
const matches = supportedMimeTypes.some((regex) => regex.test(mimeType));
|
|
69
|
-
expect(matches).toBeTruthy();
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
test('Excel MIME types should match the regex pattern in excelMimeTypes', () => {
|
|
74
|
-
const matches = excelFileTypes.every((mimeType) => excelMimeTypes.test(mimeType));
|
|
75
|
-
expect(matches).toBeTruthy();
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
describe('Testing `fileConfig`', () => {
|
|
80
|
-
describe('checkType function', () => {
|
|
81
|
-
test('should return true for supported MIME types', () => {
|
|
82
|
-
const fileTypes = ['text/csv', 'application/json', 'application/pdf', 'image/jpeg'];
|
|
83
|
-
fileTypes.forEach((fileType) => {
|
|
84
|
-
const isSupported = fileConfig.checkType(fileType);
|
|
85
|
-
expect(isSupported).toBe(true);
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
|
|
89
|
-
test('should return false for unsupported MIME types', () => {
|
|
90
|
-
const fileTypes = ['text/mamba', 'application/exe', 'no-image', ''];
|
|
91
|
-
fileTypes.forEach((fileType) => {
|
|
92
|
-
const isSupported = fileConfig.checkType(fileType);
|
|
93
|
-
expect(isSupported).toBe(false);
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
const dynamicConfigs = {
|
|
100
|
-
minimalUpdate: {
|
|
101
|
-
serverFileSizeLimit: 1024, // Increasing server file size limit
|
|
102
|
-
},
|
|
103
|
-
fullOverrideDefaultEndpoint: {
|
|
104
|
-
endpoints: {
|
|
105
|
-
default: {
|
|
106
|
-
fileLimit: 15,
|
|
107
|
-
fileSizeLimit: 30,
|
|
108
|
-
totalSizeLimit: 60,
|
|
109
|
-
supportedMimeTypes: ['^video/.*$'], // Changing to support video files
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
newEndpointAddition: {
|
|
114
|
-
endpoints: {
|
|
115
|
-
newEndpoint: {
|
|
116
|
-
fileLimit: 5,
|
|
117
|
-
fileSizeLimit: 10,
|
|
118
|
-
totalSizeLimit: 20,
|
|
119
|
-
supportedMimeTypes: ['^application/json$', '^application/xml$'],
|
|
120
|
-
},
|
|
121
|
-
},
|
|
122
|
-
},
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
describe('mergeFileConfig', () => {
|
|
126
|
-
test('merges minimal update correctly', () => {
|
|
127
|
-
const result = mergeFileConfig(dynamicConfigs.minimalUpdate);
|
|
128
|
-
expect(result.serverFileSizeLimit).toEqual(mbToBytes(1024));
|
|
129
|
-
const parsedResult = fileConfigSchema.safeParse(result);
|
|
130
|
-
expect(parsedResult.success).toBeTruthy();
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
test('overrides default endpoint with full new configuration', () => {
|
|
134
|
-
const result = mergeFileConfig(dynamicConfigs.fullOverrideDefaultEndpoint);
|
|
135
|
-
expect(result.endpoints.default.fileLimit).toEqual(15);
|
|
136
|
-
expect(result.endpoints.default.supportedMimeTypes).toEqual(
|
|
137
|
-
expect.arrayContaining([new RegExp('^video/.*$')]),
|
|
138
|
-
);
|
|
139
|
-
const parsedResult = fileConfigSchema.safeParse(result);
|
|
140
|
-
expect(parsedResult.success).toBeTruthy();
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
test('adds new endpoint configuration correctly', () => {
|
|
144
|
-
const result = mergeFileConfig(dynamicConfigs.newEndpointAddition);
|
|
145
|
-
expect(result.endpoints.newEndpoint).toBeDefined();
|
|
146
|
-
expect(result.endpoints.newEndpoint.fileLimit).toEqual(5);
|
|
147
|
-
expect(result.endpoints.newEndpoint.supportedMimeTypes).toEqual(
|
|
148
|
-
expect.arrayContaining([new RegExp('^application/json$')]),
|
|
149
|
-
);
|
|
150
|
-
const parsedResult = fileConfigSchema.safeParse(result);
|
|
151
|
-
expect(parsedResult.success).toBeTruthy();
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
test('disables an endpoint and sets numeric fields to 0 and empties supportedMimeTypes', () => {
|
|
155
|
-
const configWithDisabledEndpoint = {
|
|
156
|
-
endpoints: {
|
|
157
|
-
disabledEndpoint: {
|
|
158
|
-
disabled: true,
|
|
159
|
-
fileLimit: 15,
|
|
160
|
-
fileSizeLimit: 30,
|
|
161
|
-
totalSizeLimit: 60,
|
|
162
|
-
supportedMimeTypes: ['^video/.*$'],
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
const result = mergeFileConfig(configWithDisabledEndpoint);
|
|
168
|
-
expect(result.endpoints.disabledEndpoint).toBeDefined();
|
|
169
|
-
expect(result.endpoints.disabledEndpoint.disabled).toEqual(true);
|
|
170
|
-
expect(result.endpoints.disabledEndpoint.fileLimit).toEqual(0);
|
|
171
|
-
expect(result.endpoints.disabledEndpoint.fileSizeLimit).toEqual(0);
|
|
172
|
-
expect(result.endpoints.disabledEndpoint.totalSizeLimit).toEqual(0);
|
|
173
|
-
expect(result.endpoints.disabledEndpoint.supportedMimeTypes).toEqual([]);
|
|
174
|
-
});
|
|
175
|
-
});
|