visualvault-api 1.2.0 → 2.0.0-beta.2

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 (45) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +23 -140
  3. package/dist/VVRestApi.cjs +2552 -0
  4. package/dist/VVRestApi.cjs.map +1 -0
  5. package/dist/VVRestApi.d.cts +386 -0
  6. package/dist/VVRestApi.d.ts +386 -0
  7. package/dist/VVRestApi.js +2522 -0
  8. package/dist/VVRestApi.js.map +1 -0
  9. package/{lib/VVRestApi/VVRestApiNodeJs → dist}/config.yml +3 -3
  10. package/dist/constants.cjs +45 -0
  11. package/dist/constants.cjs.map +1 -0
  12. package/dist/constants.d.cts +48 -0
  13. package/dist/constants.d.ts +48 -0
  14. package/dist/constants.js +20 -0
  15. package/dist/constants.js.map +1 -0
  16. package/dist/index.cjs +2572 -0
  17. package/dist/index.cjs.map +1 -0
  18. package/dist/index.d.cts +2 -0
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +2541 -0
  21. package/dist/index.js.map +1 -0
  22. package/package.json +46 -70
  23. package/lib/VVRestApi/VVRestApiNodeJs/DocApi.js +0 -66
  24. package/lib/VVRestApi/VVRestApiNodeJs/FormsApi.js +0 -51
  25. package/lib/VVRestApi/VVRestApiNodeJs/NotificationsApi.js +0 -39
  26. package/lib/VVRestApi/VVRestApiNodeJs/ObjectsApi.js +0 -138
  27. package/lib/VVRestApi/VVRestApiNodeJs/StudioApi.js +0 -156
  28. package/lib/VVRestApi/VVRestApiNodeJs/VVRestApi.js +0 -1974
  29. package/lib/VVRestApi/VVRestApiNodeJs/app.js +0 -128
  30. package/lib/VVRestApi/VVRestApiNodeJs/common.js +0 -1598
  31. package/lib/VVRestApi/VVRestApiNodeJs/dts/express.d.ts +0 -125
  32. package/lib/VVRestApi/VVRestApiNodeJs/dts/node.d.ts +0 -1090
  33. package/lib/VVRestApi/VVRestApiNodeJs/files/237de37cf014ee1199a400d49e26e066.js +0 -51
  34. package/lib/VVRestApi/VVRestApiNodeJs/files/437833dc404aed118b0e644bf02b9c8a.js +0 -1
  35. package/lib/VVRestApi/VVRestApiNodeJs/log.js +0 -20
  36. package/lib/VVRestApi/VVRestApiNodeJs/public/favicon.ico +0 -0
  37. package/lib/VVRestApi/VVRestApiNodeJs/routes/scheduledscripts.js +0 -203
  38. package/lib/VVRestApi/VVRestApiNodeJs/routes/scripts.js +0 -215
  39. package/lib/VVRestApi/VVRestApiNodeJs/routes/testScheduledScripts.js +0 -131
  40. package/lib/VVRestApi/VVRestApiNodeJs/samples/SampleScheduledScript.js +0 -90
  41. package/lib/VVRestApi/VVRestApiNodeJs/samples/SendEmailScript.js +0 -51
  42. package/lib/VVRestApi/VVRestApiNodeJs/samples/fileTest.js +0 -60
  43. package/lib/VVRestApi/VVRestApiNodeJs/samples/sampleFormValidationScript.js +0 -126
  44. package/lib/VVRestApi/VVRestApiNodeJs/views/error.ejs +0 -8
  45. package/lib/VVRestApi/VVRestApiNodeJs/views/index.ejs +0 -8
@@ -0,0 +1,386 @@
1
+ declare class HttpHelper {
2
+ constructor(sessionToken: any, yamlConfig: any);
3
+ _sessionToken: any;
4
+ _config: any;
5
+ _maxRetries: number;
6
+ doVvClientRequest(url: any, options: any, params: any, data: any, buffer: any): Promise<any>;
7
+ __doVvClientCallRequest(url: any, options: any, params: any, data: any, buffer: any, retries?: number): any;
8
+ __makeRequest(url: any, options: any): Promise<string>;
9
+ __makePostStreamRequest(url: any, options: any, buffer: any): Promise<string>;
10
+ httpGet(url: any, params: any): Promise<string>;
11
+ httpGetStream(url: any, params: any): Promise<any>;
12
+ httpPost(url: any, params: any, data: any): Promise<string>;
13
+ httpPostStream(url: any, params: any, data: any, buffer: any): Promise<string>;
14
+ httpPut(url: any, params: any, data: any): Promise<string>;
15
+ httpPutStream(url: any, params: any, data: any, buffer: any): Promise<string>;
16
+ httpDelete(url: any, params: any): Promise<string>;
17
+ __acquireRefreshToken(): Promise<void>;
18
+ request(httpVerb: any, url: any, params: any, data: any): Promise<any>;
19
+ getUrl(resourceUrl: any): any;
20
+ __getRetryDelay(retryTime: any): number;
21
+ }
22
+
23
+ declare class SessionToken {
24
+ isAuthenticated: boolean;
25
+ apiUrl: any;
26
+ baseUrl: any;
27
+ authenticationUrl: any;
28
+ customerAlias: any;
29
+ databaseAlias: any;
30
+ expirationDate: Date;
31
+ accessToken: any;
32
+ tokenType: string;
33
+ refreshToken: any;
34
+ expiresIn: number;
35
+ clientId: any;
36
+ clientSecret: any;
37
+ userId: any;
38
+ password: any;
39
+ audience: any;
40
+ createCopy(): SessionToken;
41
+ convertToJwt(jwt: any): void;
42
+ }
43
+
44
+ declare class Authorize$1 {
45
+ jsyaml: any;
46
+ fs: any;
47
+ acquireSecurityToken(clientId: any, clientSecret: any, userId: any, password: any, audience: any, baseUrl: any, apiUrl: any, customerAlias: any, databaseAlias: any, authenticationUrl: any): Promise<SessionToken>;
48
+ acquireJwt(jwt: any, baseUrl: any, apiUrl: any, authenticationUrl: any, customerAlias: any, databaseAlias: any): Promise<SessionToken>;
49
+ reacquireSecurityToken(sessionToken: any): Promise<SessionToken>;
50
+ acquireRefreshToken(sessionToken: any): Promise<any>;
51
+ __getToken(clientId: any, clientSecret: any, userId: any, password: any, audience: any, baseUrl: any, customerAlias: any, databaseAlias: any, authenticationUrl: any): Promise<SessionToken>;
52
+ __getJwt(jwt: any, baseUrl: any, customerAlias: any, databaseAlias: any, authenticationUrl: any): Promise<SessionToken>;
53
+ endsWith(source: any, suffix: any): boolean;
54
+ }
55
+
56
+ declare class CurrentUserManager {
57
+ constructor(httpHelper: any);
58
+ _httpHelper: any;
59
+ /**
60
+ * Gets the currently authenticated user's information.
61
+ * @param {Object} [params] - Optional query parameters.
62
+ * @returns {Promise<string>} A promise that resolves with the current user's information as a JSON string.
63
+ */
64
+ getCurrentUser(params?: any): Promise<string>;
65
+ }
66
+
67
+ declare class DocumentManager {
68
+ constructor(httpHelper: any);
69
+ _httpHelper: any;
70
+ GetRevision(documentRevisionId: any): Promise<any>;
71
+ getDocumentOcrStatus(documentRevisionId: any): Promise<any>;
72
+ updateDocumentOcrStatus(documentRevisionId: any, data: any): Promise<any>;
73
+ search(criteriaList: any, searchFolders: any, excludeFolders: any, sortBy: any, sortDirection?: string, page?: number, take?: number, archiveType?: number, roleSecurity?: boolean): Promise<any>;
74
+ }
75
+
76
+ declare class DocApi {
77
+ constructor(sessionToken: any, docApiConfig: any);
78
+ _httpHelper: HttpHelper;
79
+ isEnabled: any;
80
+ baseUrl: any;
81
+ roleSecurity: any;
82
+ documents: DocumentManager;
83
+ }
84
+
85
+ declare class FormInstanceManager {
86
+ constructor(httpHelper: any);
87
+ _httpHelper: any;
88
+ postForm(params: any, data: any, formTemplateRevisionId: any): Promise<any>;
89
+ postFormRevision(params: any, data: any, formTemplateRevisionId: any, formId: any): Promise<any>;
90
+ }
91
+
92
+ declare class FormsApi {
93
+ constructor(sessionToken: any, formsApiConfig: any);
94
+ _httpHelper: HttpHelper;
95
+ isEnabled: any;
96
+ baseUrl: any;
97
+ formInstances: FormInstanceManager;
98
+ }
99
+
100
+ declare class ModelManager {
101
+ constructor(httpHelper: any);
102
+ _httpHelper: any;
103
+ /**
104
+ * Retrieves a list of available models
105
+ * @param {object} params - Optional URL parameters to include in the request
106
+ */
107
+ getModels(params: object): Promise<any>;
108
+ /**
109
+ * Retrieves a specific model by its ID
110
+ * @param {string} modelId - The ID (Guid) for the requested model
111
+ * @param {object} params - Optional URL parameters to include in the request
112
+ */
113
+ getModelById(modelId: string, params: object): Promise<any>;
114
+ }
115
+
116
+ declare class ObjectManager {
117
+ constructor(httpHelper: any);
118
+ _httpHelper: any;
119
+ /**
120
+ * Retrieves a specific object by its ID
121
+ * @param {string} objectId - The ID (Guid) for the requested object
122
+ * @param {object} params - Optional URL parameters to include in the request
123
+ */
124
+ getObject(objectId: string, params: object): Promise<any>;
125
+ /**
126
+ * Retrieves a paged list of objects associated with a given model
127
+ * @param {string} modelId - The ID (Guid) for the requested model to search
128
+ * @param {object} data - Data to send in the request body
129
+ * @param {object} params - Optional URL parameters to include in the request
130
+ */
131
+ getObjectsByModelId(modelId: string, data: object, params: object): Promise<any>;
132
+ /**
133
+ * Creates a new object adhering to a given model
134
+ * @param {string} modelId - The ID (Guid) used to create a new object for that model
135
+ * @param {object} data - Data to send in the request body
136
+ * @param {object} params - Optional URL parameters to include in the request
137
+ */
138
+ createObject(modelId: string, data: object, params: object): Promise<any>;
139
+ /**
140
+ * Updates an existing object by its ID (Guid) and revision ID (Guid)
141
+ * @param {string} objectId - The ID (Guid) for the requested object to update
142
+ * @param {string} objectRevisionId - The revision ID (Guid) for the requested object to update
143
+ * @param {object} data - Data to send in the request body
144
+ * @param {object} params - Optional URL parameters to include in the request
145
+ */
146
+ updateObject(objectId: string, objectRevisionId: string, data: object, params: object): Promise<any>;
147
+ /**
148
+ * Deletes an existing object by its ID (Guid)
149
+ * @param {string} objectId - The ID (Guid) for the requested object to delete
150
+ * @param {object} params - Optional URL parameters to include in the request
151
+ */
152
+ deleteObject(objectId: string, params: object): Promise<any>;
153
+ }
154
+
155
+ declare class ObjectsApi {
156
+ constructor(sessionToken: any, objectsApiConfig: any);
157
+ _httpHelper: HttpHelper;
158
+ isEnabled: any;
159
+ baseUrl: any;
160
+ models: ModelManager;
161
+ objects: ObjectManager;
162
+ }
163
+
164
+ declare class WorkflowManager {
165
+ constructor(httpHelper: any);
166
+ _httpHelper: any;
167
+ getWorkflow(workflowId: any): Promise<any>;
168
+ getWorkflowByName(workflowName: any): Promise<any>;
169
+ getWorkflowVariables(params: any, workflowId: any): Promise<any>;
170
+ /**
171
+ * Triggers workflow
172
+ * @param {string} workflowId
173
+ * @param {number} workflowRevision
174
+ * @param {string} objectId
175
+ * @param {object[]} workflowVariables - workflow values to be submitted to the workflow
176
+ * * @param {string} workflowVariables[].name = name of variable
177
+ * * @param {*} workflowVariables[].value - value to be passed
178
+ * * @param {number} workflowVariables[].dataType - Text: 1, Number: 2, Date: 3, Boolean: 4
179
+ */
180
+ triggerWorkflow(workflowId: string, workflowRevision: number, objectId: string, workflowVariables: {
181
+ name: string;
182
+ value: any;
183
+ dataType: number;
184
+ }): Promise<any>;
185
+ /**
186
+ * Terminates the workflow instance
187
+ * @param {string} workflowId
188
+ * @param {string} instanceId
189
+ * @returns
190
+ */
191
+ terminateWorkflow(workflowId: string, instanceId: string): Promise<any>;
192
+ /**
193
+ * Returns workflow history for an object under the provided workflow
194
+ * @param {string} workflowId
195
+ * @param {string} objectId
196
+ * @returns
197
+ */
198
+ GetWorkflowHistoryForObject(objectId: string, workflowId: string): Promise<any>;
199
+ /**
200
+ * Returns the running workflow, if any, for an object under the provided workflow
201
+ * @param {string} workflowId
202
+ * @param {string} objectId
203
+ * @returns
204
+ */
205
+ GetRunningWorkflowForObject(objectId: string, workflowId: string): Promise<any>;
206
+ }
207
+
208
+ declare class RolesAndPermissionsManager {
209
+ constructor(httpHelper: any);
210
+ _httpHelper: any;
211
+ /**
212
+ * Retrieves available features for the requesting user
213
+ * @param {object} params - Optional URL parameters to include in the request
214
+ */
215
+ getUserFeatures(params: object): Promise<any>;
216
+ }
217
+
218
+ declare class StudioApi {
219
+ constructor(sessionToken: any, studioApiConfig: any);
220
+ _httpHelper: HttpHelper;
221
+ isEnabled: any;
222
+ baseUrl: any;
223
+ workflow: WorkflowManager;
224
+ permissions: RolesAndPermissionsManager;
225
+ }
226
+
227
+ declare class UserNotificationsManager {
228
+ constructor(httpHelper: any);
229
+ _httpHelper: any;
230
+ forceUIRefresh(userGuid: any): Promise<any>;
231
+ }
232
+
233
+ declare class NotificationsApi {
234
+ constructor(sessionToken: any, notificationsApiConfig: any);
235
+ _httpHelper: HttpHelper;
236
+ isEnabled: any;
237
+ baseUrl: any;
238
+ users: UserNotificationsManager;
239
+ }
240
+
241
+ /**
242
+ * Helper class for form field return values
243
+ */
244
+ declare class ReturnField {
245
+ /**
246
+ * @param {string} id - Field ID
247
+ * @param {string} name - Field name
248
+ * @param {*} value - Field value
249
+ * @param {boolean} isError - Whether field has an error
250
+ * @param {string} errorMessage - Error message if any
251
+ */
252
+ constructor(id: string, name: string, value: any, isError: boolean, errorMessage: string);
253
+ /** @type {string} */ id: string;
254
+ /** @type {string} */ name: string;
255
+ /** @type {*} */ value: any;
256
+ /** @type {boolean} */ isError: boolean;
257
+ /** @type {string} */ errorMessage: string;
258
+ }
259
+ /**
260
+ * Helper class for managing form field collections
261
+ */
262
+ declare class FormFieldCollection {
263
+ /**
264
+ * @param {Array<*>} ffColl - Array of form fields
265
+ */
266
+ constructor(ffColl: Array<any>);
267
+ _ffColl: any[];
268
+ /**
269
+ * Get a form field by name
270
+ * @param {string} name - Field name to search for
271
+ * @returns {*} The field or null if not found
272
+ */
273
+ getFormFieldByName(name: string): any;
274
+ /**
275
+ * Get a form field by ID
276
+ * @param {string} id - Field ID to search for
277
+ * @returns {*} The field or null if not found
278
+ */
279
+ getFormFieldById(id: string): any;
280
+ /**
281
+ * Get the array of all form fields
282
+ * @returns {Array<*>} Array of form fields
283
+ */
284
+ getFieldArray(): Array<any>;
285
+ }
286
+
287
+ /**
288
+ * Main VisualVault API client providing access to all API managers.
289
+ */
290
+ declare class VVClient {
291
+ /**
292
+ * @param {*} sessionToken - Session token from authentication
293
+ */
294
+ constructor(sessionToken: any);
295
+ /** @type {*} */ constants: any;
296
+ /** @type {*} */ configuration: any;
297
+ /** @type {*} */ customQuery: any;
298
+ /** @type {*} */ documents: any;
299
+ /** @type {*} */ email: any;
300
+ /** @type {*} */ files: any;
301
+ /** @type {*} */ forms: any;
302
+ /** @type {*} */ groups: any;
303
+ /** @type {*} */ library: any;
304
+ /** @type {*} */ sites: any;
305
+ /** @type {*} */ users: any;
306
+ /** @type {*} */ scheduledProcess: any;
307
+ /** @type {*} */ scripts: any;
308
+ /** @type {*} */ projects: any;
309
+ /** @type {*} */ customer: any;
310
+ /** @type {*} */ customerDatabase: any;
311
+ /** @type {*} */ indexFields: any;
312
+ /** @type {*} */ outsideProcesses: any;
313
+ /** @type {*} */ securityMembers: any;
314
+ /** @type {*} */ layouts: any;
315
+ /** @type {*} */ reports: any;
316
+ yamlConfig: any;
317
+ _httpHelper: HttpHelper;
318
+ currentUser: CurrentUserManager;
319
+ docApi: DocApi;
320
+ formsApi: FormsApi;
321
+ objectsApi: ObjectsApi;
322
+ studioApi: StudioApi;
323
+ notificationsApi: NotificationsApi;
324
+ createDocApi(sessionToken: any): Promise<void>;
325
+ createFormsApi(sessionToken: any): Promise<void>;
326
+ createObjectsApi(sessionToken: any): Promise<void>;
327
+ createStudioApi(sessionToken: any): Promise<void>;
328
+ createNotificationsApi(sessionToken: any): Promise<void>;
329
+ _convertToJwt(sessionToken: any): Promise<void>;
330
+ endsWith(source: any, suffix: any): boolean;
331
+ /**
332
+ * Get the current security token
333
+ * @returns {string} The access token
334
+ */
335
+ getSecurityToken(): string;
336
+ /**
337
+ * Check if the client is authenticated
338
+ * @returns {boolean} True if authenticated
339
+ */
340
+ isAuthenticated(): boolean;
341
+ /**
342
+ * Get the base URL
343
+ * @returns {string} The base URL
344
+ */
345
+ getBaseUrl(): string;
346
+ }
347
+ declare const Authorize_base: typeof Authorize$1;
348
+ /**
349
+ * Authentication class for obtaining VaultApi client instances.
350
+ */
351
+ declare class Authorize extends Authorize_base {
352
+ /**
353
+ * Authenticate and get a VaultApi client instance
354
+ * @param {string} clientId - OAuth client ID
355
+ * @param {string} clientSecret - OAuth client secret
356
+ * @param {string} userId - User username
357
+ * @param {string} password - User password
358
+ * @param {string} audience - OAuth audience
359
+ * @param {string} baseVaultUrl - VisualVault base URL
360
+ * @param {string} customerAlias - Customer alias
361
+ * @param {string} databaseAlias - Database alias
362
+ * @returns {Promise<VVClient>} Authenticated client instance
363
+ */
364
+ getVaultApi(clientId: string, clientSecret: string, userId: string, password: string, audience: string, baseVaultUrl: string, customerAlias: string, databaseAlias: string): Promise<VVClient>;
365
+ /**
366
+ * Get a VaultApi client from an existing JWT token
367
+ * @param {string} jwt - JWT authentication token
368
+ * @param {string} baseVaultUrl - VisualVault base URL
369
+ * @param {string} customerAlias - Customer alias
370
+ * @param {string} databaseAlias - Database alias
371
+ * @param {Date} expirationDate - Token expiration date
372
+ * @returns {Promise<VVClient>} Authenticated client instance
373
+ */
374
+ getVaultApiFromJwt(jwt: string, baseVaultUrl: string, customerAlias: string, databaseAlias: string, expirationDate: Date): Promise<VVClient>;
375
+ }
376
+ declare namespace forms {
377
+ export { ReturnField as returnField };
378
+ export { FormFieldCollection as formFieldCollection };
379
+ }
380
+ declare namespace _default {
381
+ export { VVClient as vvClient };
382
+ export { Authorize as authorize };
383
+ export { forms };
384
+ }
385
+
386
+ export { Authorize, VVClient, _default as default, forms };