bruce-models 7.1.98 → 7.1.100

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.
@@ -64,7 +64,8 @@ export declare namespace Api {
64
64
  EntityHistoricDataSeries = "entityhistoricdataseries",
65
65
  EntityHistoricDataAnalysis = "entityhistoricdataanalysis",
66
66
  EntityHistoricDataPage = "entityhistoricdatapage",
67
- AccountLimits = "accountlimits"
67
+ AccountLimits = "accountlimits",
68
+ WorkflowType = "workflowtype"
68
69
  }
69
70
  let DEFAULT_CACHE_DURATION: number;
70
71
  let TEMPLATE_ACCOUNT_ID: string;
@@ -117,4 +117,5 @@ export * from "./util/math-utils";
117
117
  export * from "./util/object-utils";
118
118
  export * from "./util/path-utils";
119
119
  export * from "./util/url-utils";
120
- export declare const VERSION = "7.1.98";
120
+ export * from "./workflow/workflow-type";
121
+ export declare const VERSION = "7.1.100";
@@ -2,15 +2,103 @@ import { Api } from "../api/api";
2
2
  import { BruceApi } from "../api/bruce-api";
3
3
  import { PendingAction } from "../server/pending-action";
4
4
  export declare namespace ExportNsx {
5
+ interface IAccountBackupParams {
6
+ "ClientFileDownloadConcurrency"?: number;
7
+ "TilesetDownloadConcurrency"?: number;
8
+ "ReusePreviousBackupFileBodies"?: boolean;
9
+ "BaseBackup.StorePath"?: string;
10
+ [key: string]: any;
11
+ }
5
12
  interface IAccountBackupRes extends PendingAction.IAction {
6
13
  URL: string;
7
14
  }
15
+ interface IAccountBackupCompletionReport {
16
+ Message?: string;
17
+ "Account.ID"?: string;
18
+ "Created.UTC"?: string;
19
+ FileName?: string;
20
+ StorePath?: string;
21
+ "Size.Bytes"?: number;
22
+ "Download.URL"?: string;
23
+ }
24
+ interface IAccountBackupStats {
25
+ Counts?: any;
26
+ Timing?: any;
27
+ DatabaseBackedExport?: any;
28
+ RawConceptExport?: any;
29
+ TilesetFileExport?: any;
30
+ BaseAwareReuse?: {
31
+ Enabled?: boolean;
32
+ Strategy?: string;
33
+ BaseFound?: boolean;
34
+ "Base.StorePath"?: string;
35
+ "Base.Bytes"?: number;
36
+ Fallback?: string;
37
+ [key: string]: any;
38
+ };
39
+ [key: string]: any;
40
+ }
41
+ interface IAccountBackupPendingActionResult extends IAccountBackupCompletionReport {
42
+ RawConceptCounts?: any;
43
+ TilesetFiles?: any;
44
+ Report?: IAccountBackupCompletionReport;
45
+ Stats?: IAccountBackupStats;
46
+ }
47
+ interface IParsedAccountBackupResult {
48
+ accountId?: string;
49
+ createdUtc?: string;
50
+ fileName?: string;
51
+ storePath?: string;
52
+ sizeBytes?: number;
53
+ downloadUrl?: string;
54
+ message?: string;
55
+ report?: IAccountBackupCompletionReport;
56
+ stats?: IAccountBackupStats;
57
+ raw: IAccountBackupPendingActionResult | null;
58
+ }
59
+ interface IAccountBackupListRes {
60
+ files: string[];
61
+ nsxFiles: string[];
62
+ }
63
+ interface IDeleteAccountBackupRes {
64
+ Deleted: boolean;
65
+ FileName: string;
66
+ StorePath: string;
67
+ }
8
68
  /**
9
69
  * Starts a whole-account NSX backup export job.
10
70
  * The generated NSX file is stored in the account's configured backup file store.
11
71
  */
12
72
  function AccountBackup(params?: {
13
73
  api?: BruceApi.Api;
74
+ backup?: IAccountBackupParams;
14
75
  req?: Api.IReqParams;
15
76
  }): Promise<IAccountBackupRes>;
77
+ /**
78
+ * Returns available account backup files, including whole-account NSX backups.
79
+ */
80
+ function GetAccountBackupList(params?: {
81
+ api?: BruceApi.Api;
82
+ req?: Api.IReqParams;
83
+ }): Promise<IAccountBackupListRes>;
84
+ /**
85
+ * Downloads a saved whole-account NSX backup file.
86
+ */
87
+ function DownloadAccountBackup(params: {
88
+ api?: BruceApi.Api;
89
+ fileName: string;
90
+ req?: Api.IReqParams;
91
+ }): Promise<Blob | string | any>;
92
+ /**
93
+ * Deletes a saved whole-account NSX backup file.
94
+ */
95
+ function DeleteAccountBackup(params: {
96
+ api?: BruceApi.Api;
97
+ fileName: string;
98
+ req?: Api.IReqParams;
99
+ }): Promise<IDeleteAccountBackupRes>;
100
+ /**
101
+ * Parses the completed Pending Action result from running AccountBackup.
102
+ */
103
+ function ParseAccountBackupResult(paResult: string | Object | PendingAction.IAction<any>): IParsedAccountBackupResult;
16
104
  }
@@ -9,14 +9,14 @@ export declare namespace PendingAction {
9
9
  /**
10
10
  * Describes a pending action record.
11
11
  */
12
- interface IAction {
12
+ interface IAction<TResult = string> {
13
13
  ID: number;
14
14
  "CreatedBy.Application": string;
15
15
  "Created"?: string;
16
16
  "Updated"?: string;
17
17
  "Completed"?: string;
18
18
  "CreatedByUser.ID": string;
19
- Result: string;
19
+ Result: TResult;
20
20
  Progress: number;
21
21
  Description: string;
22
22
  Status: EStatus;
@@ -30,6 +30,12 @@ export declare namespace PendingAction {
30
30
  Complete = "COMPLETE",
31
31
  Failed = "FAILED"
32
32
  }
33
+ /**
34
+ * Available server-side Pending Action result encodings.
35
+ */
36
+ enum EResultFormat {
37
+ JSON = "JSON"
38
+ }
33
39
  /**
34
40
  * Describes a pending action message record.
35
41
  */
@@ -55,12 +61,13 @@ export declare namespace PendingAction {
55
61
  * @param params
56
62
  * @returns
57
63
  */
58
- function Get(params: {
64
+ function Get<TResult = string>(params: {
59
65
  api?: BruceApi.Api;
60
66
  actionId: number;
67
+ result?: EResultFormat;
61
68
  req?: Api.IReqParams;
62
69
  }): Promise<{
63
- action: IAction;
70
+ action: IAction<TResult>;
64
71
  }>;
65
72
  /**
66
73
  * Returns a list of pending action records by their IDs.
@@ -134,15 +141,16 @@ export declare namespace PendingAction {
134
141
  * });
135
142
  * // Action will resolve as null if it was disposed early.
136
143
  */
137
- function OnCompletion(params: {
144
+ function OnCompletion<TResult = string>(params: {
138
145
  api?: BruceApi.Api;
139
146
  actionId: number;
140
147
  interval?: number;
141
148
  isDisposed?: () => boolean;
142
149
  onMessage?: (message: IMessage) => void;
150
+ result?: EResultFormat;
143
151
  req?: Api.IReqParams;
144
152
  }): Promise<{
145
- action: IAction | null;
153
+ action: IAction<TResult> | null;
146
154
  messages: IMessage[];
147
155
  }>;
148
156
  }
@@ -0,0 +1,158 @@
1
+ import { Api } from "../api/api";
2
+ import { BruceApi } from "../api/bruce-api";
3
+ type WorkflowTypeId = number | string;
4
+ type WorkflowStatusId = number | string;
5
+ /**
6
+ * Describes the "Workflow Type" concept within Nextspace.
7
+ * The API names this record Workflow Item Type.
8
+ */
9
+ export declare namespace WorkflowType {
10
+ /**
11
+ * Describes a workflow type record.
12
+ */
13
+ interface IType {
14
+ ID?: number;
15
+ DisplayName?: string;
16
+ Description?: string;
17
+ Color?: string;
18
+ "Default.Status.ID"?: number;
19
+ "Default.Queue.ID"?: number;
20
+ "Default.EntityType.ID"?: string;
21
+ StatusSettingsDiagram?: any;
22
+ [key: string]: any;
23
+ }
24
+ /**
25
+ * Describes a workflow status record returned by workflow type status calls.
26
+ */
27
+ interface IStatus {
28
+ ID?: number;
29
+ Type?: string;
30
+ DisplayName?: string;
31
+ Description?: string;
32
+ Color?: string;
33
+ IsEnd?: boolean;
34
+ "NextStatus.ID"?: number[];
35
+ [key: string]: any;
36
+ }
37
+ type IBruceWorkflowItemType = IType;
38
+ /**
39
+ * Gets a workflow type by ID.
40
+ * @param params
41
+ */
42
+ function Get(params: {
43
+ api?: BruceApi.Api;
44
+ workflowTypeId: WorkflowTypeId;
45
+ req?: Api.IReqParams;
46
+ }): Promise<{
47
+ workflowType: IType;
48
+ }>;
49
+ /**
50
+ * Gets all workflow types.
51
+ * @param params
52
+ */
53
+ function GetList(params?: {
54
+ api?: BruceApi.Api;
55
+ req?: Api.IReqParams;
56
+ }): Promise<{
57
+ workflowTypes: IType[];
58
+ }>;
59
+ /**
60
+ * Creates or updates a workflow type.
61
+ * This calls: POST workflow/type/{workflow_type_id} where 0 creates new.
62
+ * @param params
63
+ */
64
+ function Update(params: {
65
+ api?: BruceApi.Api;
66
+ workflowType: IType;
67
+ req?: Api.IReqParams;
68
+ }): Promise<{
69
+ workflowType: IType;
70
+ }>;
71
+ /**
72
+ * Deletes a workflow type by ID.
73
+ * @param params
74
+ */
75
+ function Delete(params: {
76
+ api?: BruceApi.Api;
77
+ workflowTypeId: WorkflowTypeId;
78
+ req?: Api.IReqParams;
79
+ }): Promise<void>;
80
+ /**
81
+ * Gets the workflow statuses enabled for a workflow type.
82
+ * @param params
83
+ */
84
+ function GetStatuses(params: {
85
+ api?: BruceApi.Api;
86
+ workflowTypeId: WorkflowTypeId;
87
+ req?: Api.IReqParams;
88
+ }): Promise<{
89
+ statuses: IStatus[];
90
+ }>;
91
+ /**
92
+ * Adds statuses to the list enabled for a workflow type.
93
+ * @param params
94
+ */
95
+ function AddStatuses(params: {
96
+ api?: BruceApi.Api;
97
+ workflowTypeId: WorkflowTypeId;
98
+ workflowStatusIds: WorkflowStatusId[];
99
+ req?: Api.IReqParams;
100
+ }): Promise<void>;
101
+ /**
102
+ * Removes statuses from the list enabled for a workflow type.
103
+ * @param params
104
+ */
105
+ function RemoveStatuses(params: {
106
+ api?: BruceApi.Api;
107
+ workflowTypeId: WorkflowTypeId;
108
+ workflowStatusIds: WorkflowStatusId[];
109
+ req?: Api.IReqParams;
110
+ }): Promise<void>;
111
+ /**
112
+ * Normalizes response from workflow type get/update endpoints.
113
+ */
114
+ function ParseResponse(response: IType | {
115
+ WorkflowType?: IType;
116
+ WorkflowItemType?: IType;
117
+ BruceWorkflowItemType?: IType;
118
+ Result?: IType | string;
119
+ } | string | any): IType;
120
+ /**
121
+ * Normalizes response from workflow type list endpoints.
122
+ */
123
+ function ParseListResponse(response: Api.IList<IType> | IType[] | {
124
+ WorkflowTypes?: IType[];
125
+ WorkflowItemTypes?: IType[];
126
+ BruceWorkflowItemTypes?: IType[];
127
+ Result?: Api.IList<IType> | IType[] | string;
128
+ } | string | any): IType[];
129
+ /**
130
+ * Normalizes response from workflow type status list endpoints.
131
+ */
132
+ function ParseStatusListResponse(response: Api.IList<IStatus> | IStatus[] | {
133
+ Statuses?: IStatus[];
134
+ WorkflowStatuses?: IStatus[];
135
+ WorkflowItemStatuses?: IStatus[];
136
+ BruceWorkflowItemStatuses?: IStatus[];
137
+ Result?: Api.IList<IStatus> | IStatus[] | string;
138
+ } | string | any): IStatus[];
139
+ /**
140
+ * Returns cache identifier for a workflow type by ID.
141
+ * @param id
142
+ * @returns
143
+ */
144
+ function GetCacheKey(id: WorkflowTypeId): string;
145
+ /**
146
+ * Returns cache identifier for the workflow type list.
147
+ * @returns
148
+ */
149
+ function GetListCacheKey(): string;
150
+ /**
151
+ * Returns cache identifier for the statuses enabled for a workflow type.
152
+ * @param workflowTypeId
153
+ * @returns
154
+ */
155
+ function GetStatusesCacheKey(workflowTypeId: WorkflowTypeId): string;
156
+ }
157
+ export import WorkflowItemType = WorkflowType;
158
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bruce-models",
3
- "version": "7.1.98",
3
+ "version": "7.1.100",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "main": "dist/bruce-models.umd.js",