visualvault-api 1.1.0 → 2.0.0-beta.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 (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -138
  3. package/dist/VVRestApi.cjs +2574 -0
  4. package/dist/VVRestApi.cjs.map +1 -0
  5. package/dist/VVRestApi.d.cts +375 -0
  6. package/dist/VVRestApi.d.ts +375 -0
  7. package/dist/VVRestApi.js +2544 -0
  8. package/dist/VVRestApi.js.map +1 -0
  9. package/{lib/VVRestApi/VVRestApiNodeJs → dist}/config.yml +106 -100
  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 +2594 -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 +2563 -0
  21. package/dist/index.js.map +1 -0
  22. package/package.json +47 -71
  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/StudioApi.js +0 -136
  27. package/lib/VVRestApi/VVRestApiNodeJs/VVRestApi.js +0 -1889
  28. package/lib/VVRestApi/VVRestApiNodeJs/app.js +0 -128
  29. package/lib/VVRestApi/VVRestApiNodeJs/common.js +0 -1598
  30. package/lib/VVRestApi/VVRestApiNodeJs/dts/express.d.ts +0 -125
  31. package/lib/VVRestApi/VVRestApiNodeJs/dts/node.d.ts +0 -1090
  32. package/lib/VVRestApi/VVRestApiNodeJs/log.js +0 -20
  33. package/lib/VVRestApi/VVRestApiNodeJs/public/favicon.ico +0 -0
  34. package/lib/VVRestApi/VVRestApiNodeJs/routes/scheduledscripts.js +0 -203
  35. package/lib/VVRestApi/VVRestApiNodeJs/routes/scripts.js +0 -215
  36. package/lib/VVRestApi/VVRestApiNodeJs/routes/testScheduledScripts.js +0 -131
  37. package/lib/VVRestApi/VVRestApiNodeJs/samples/SampleScheduledScript.js +0 -90
  38. package/lib/VVRestApi/VVRestApiNodeJs/samples/SendEmailScript.js +0 -51
  39. package/lib/VVRestApi/VVRestApiNodeJs/samples/fileTest.js +0 -60
  40. package/lib/VVRestApi/VVRestApiNodeJs/samples/sampleFormValidationScript.js +0 -126
  41. package/lib/VVRestApi/VVRestApiNodeJs/views/error.ejs +0 -8
  42. package/lib/VVRestApi/VVRestApiNodeJs/views/index.ejs +0 -8
@@ -0,0 +1,375 @@
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 DocumentInstanceManager {
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
+ documentInstances: DocumentInstanceManager;
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 ModelsManager {
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 ObjectsManager {
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: ModelsManager;
161
+ objects: ObjectsManager;
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 StudioApi {
209
+ constructor(sessionToken: any, studioApiConfig: any);
210
+ _httpHelper: HttpHelper;
211
+ isEnabled: any;
212
+ baseUrl: any;
213
+ workflow: WorkflowManager;
214
+ }
215
+
216
+ declare class UserNotificationsManager {
217
+ constructor(httpHelper: any);
218
+ _httpHelper: any;
219
+ forceUIRefresh(userGuid: any): Promise<any>;
220
+ }
221
+
222
+ declare class NotificationsApi {
223
+ constructor(sessionToken: any, notificationsApiConfig: any);
224
+ _httpHelper: HttpHelper;
225
+ isEnabled: any;
226
+ baseUrl: any;
227
+ users: UserNotificationsManager;
228
+ }
229
+
230
+ /**
231
+ * Helper class for form field return values
232
+ */
233
+ declare class ReturnField {
234
+ /**
235
+ * @param {string} id - Field ID
236
+ * @param {string} name - Field name
237
+ * @param {*} value - Field value
238
+ * @param {boolean} isError - Whether field has an error
239
+ * @param {string} errorMessage - Error message if any
240
+ */
241
+ constructor(id: string, name: string, value: any, isError: boolean, errorMessage: string);
242
+ /** @type {string} */ id: string;
243
+ /** @type {string} */ name: string;
244
+ /** @type {*} */ value: any;
245
+ /** @type {boolean} */ isError: boolean;
246
+ /** @type {string} */ errorMessage: string;
247
+ }
248
+ /**
249
+ * Helper class for managing form field collections
250
+ */
251
+ declare class FormFieldCollection {
252
+ /**
253
+ * @param {Array<*>} ffColl - Array of form fields
254
+ */
255
+ constructor(ffColl: Array<any>);
256
+ _ffColl: any[];
257
+ /**
258
+ * Get a form field by name
259
+ * @param {string} name - Field name to search for
260
+ * @returns {*} The field or null if not found
261
+ */
262
+ getFormFieldByName(name: string): any;
263
+ /**
264
+ * Get a form field by ID
265
+ * @param {string} id - Field ID to search for
266
+ * @returns {*} The field or null if not found
267
+ */
268
+ getFormFieldById(id: string): any;
269
+ /**
270
+ * Get the array of all form fields
271
+ * @returns {Array<*>} Array of form fields
272
+ */
273
+ getFieldArray(): Array<any>;
274
+ }
275
+
276
+ /**
277
+ * Main VisualVault API client providing access to all API managers.
278
+ */
279
+ declare class VVClient {
280
+ /**
281
+ * @param {*} sessionToken - Session token from authentication
282
+ */
283
+ constructor(sessionToken: any);
284
+ /** @type {*} */ constants: any;
285
+ /** @type {*} */ configuration: any;
286
+ /** @type {*} */ customQuery: any;
287
+ /** @type {*} */ documents: any;
288
+ /** @type {*} */ email: any;
289
+ /** @type {*} */ files: any;
290
+ /** @type {*} */ forms: any;
291
+ /** @type {*} */ groups: any;
292
+ /** @type {*} */ library: any;
293
+ /** @type {*} */ sites: any;
294
+ /** @type {*} */ users: any;
295
+ /** @type {*} */ scheduledProcess: any;
296
+ /** @type {*} */ scripts: any;
297
+ /** @type {*} */ projects: any;
298
+ /** @type {*} */ customer: any;
299
+ /** @type {*} */ customerDatabase: any;
300
+ /** @type {*} */ indexFields: any;
301
+ /** @type {*} */ outsideProcesses: any;
302
+ /** @type {*} */ securityMembers: any;
303
+ /** @type {*} */ layouts: any;
304
+ /** @type {*} */ reports: any;
305
+ yamlConfig: any;
306
+ _httpHelper: HttpHelper;
307
+ currentUser: CurrentUserManager;
308
+ _docApi: DocApi;
309
+ _formsApi: FormsApi;
310
+ _objectsApi: ObjectsApi;
311
+ _studioApi: StudioApi;
312
+ _notificationsApi: NotificationsApi;
313
+ createDocApi(sessionToken: any): Promise<void>;
314
+ createFormsApi(sessionToken: any): Promise<void>;
315
+ createObjectsApi(sessionToken: any): Promise<void>;
316
+ createStudioApi(sessionToken: any): Promise<void>;
317
+ createNotificationsApi(sessionToken: any): Promise<void>;
318
+ _convertToJwt(sessionToken: any): Promise<void>;
319
+ endsWith(source: any, suffix: any): boolean;
320
+ /**
321
+ * Get the current security token
322
+ * @returns {string} The access token
323
+ */
324
+ getSecurityToken(): string;
325
+ /**
326
+ * Check if the client is authenticated
327
+ * @returns {boolean} True if authenticated
328
+ */
329
+ isAuthenticated(): boolean;
330
+ /**
331
+ * Get the base URL
332
+ * @returns {string} The base URL
333
+ */
334
+ getBaseUrl(): string;
335
+ }
336
+ declare const Authorize_base: typeof Authorize$1;
337
+ /**
338
+ * Authentication class for obtaining VaultApi client instances.
339
+ */
340
+ declare class Authorize extends Authorize_base {
341
+ /**
342
+ * Authenticate and get a VaultApi client instance
343
+ * @param {string} clientId - OAuth client ID
344
+ * @param {string} clientSecret - OAuth client secret
345
+ * @param {string} userId - User username
346
+ * @param {string} password - User password
347
+ * @param {string} audience - OAuth audience
348
+ * @param {string} baseVaultUrl - VisualVault base URL
349
+ * @param {string} customerAlias - Customer alias
350
+ * @param {string} databaseAlias - Database alias
351
+ * @returns {Promise<VVClient>} Authenticated client instance
352
+ */
353
+ getVaultApi(clientId: string, clientSecret: string, userId: string, password: string, audience: string, baseVaultUrl: string, customerAlias: string, databaseAlias: string): Promise<VVClient>;
354
+ /**
355
+ * Get a VaultApi client from an existing JWT token
356
+ * @param {string} jwt - JWT authentication token
357
+ * @param {string} baseVaultUrl - VisualVault base URL
358
+ * @param {string} customerAlias - Customer alias
359
+ * @param {string} databaseAlias - Database alias
360
+ * @param {Date} expirationDate - Token expiration date
361
+ * @returns {Promise<VVClient>} Authenticated client instance
362
+ */
363
+ getVaultApiFromJwt(jwt: string, baseVaultUrl: string, customerAlias: string, databaseAlias: string, expirationDate: Date): Promise<VVClient>;
364
+ }
365
+ declare namespace forms {
366
+ export { ReturnField as returnField };
367
+ export { FormFieldCollection as formFieldCollection };
368
+ }
369
+ declare namespace _default {
370
+ export { VVClient as vvClient };
371
+ export { Authorize as authorize };
372
+ export { forms };
373
+ }
374
+
375
+ export { Authorize, VVClient, _default as default, forms };