@jumoo/processing 17.4.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.
- package/dist/api/client/client.gen.d.ts +2 -0
- package/dist/api/client/client.gen.js +235 -0
- package/dist/api/client/index.d.ts +8 -0
- package/dist/api/client/index.js +6 -0
- package/dist/api/client/types.gen.d.ts +117 -0
- package/dist/api/client/types.gen.js +2 -0
- package/dist/api/client/utils.gen.d.ts +33 -0
- package/dist/api/client/utils.gen.js +230 -0
- package/dist/api/client.gen.d.ts +12 -0
- package/dist/api/client.gen.js +4 -0
- package/dist/api/core/auth.gen.d.ts +18 -0
- package/dist/api/core/auth.gen.js +14 -0
- package/dist/api/core/bodySerializer.gen.d.ts +25 -0
- package/dist/api/core/bodySerializer.gen.js +57 -0
- package/dist/api/core/params.gen.d.ts +43 -0
- package/dist/api/core/params.gen.js +100 -0
- package/dist/api/core/pathSerializer.gen.d.ts +33 -0
- package/dist/api/core/pathSerializer.gen.js +106 -0
- package/dist/api/core/queryKeySerializer.gen.d.ts +18 -0
- package/dist/api/core/queryKeySerializer.gen.js +92 -0
- package/dist/api/core/serverSentEvents.gen.d.ts +71 -0
- package/dist/api/core/serverSentEvents.gen.js +133 -0
- package/dist/api/core/types.gen.d.ts +78 -0
- package/dist/api/core/types.gen.js +2 -0
- package/dist/api/core/utils.gen.d.ts +19 -0
- package/dist/api/core/utils.gen.js +87 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +4 -0
- package/dist/api/sdk.gen.d.ts +39 -0
- package/dist/api/sdk.gen.js +118 -0
- package/dist/api/types.gen.d.ts +547 -0
- package/dist/api/types.gen.js +18 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +8 -0
- package/dist/exports.d.ts +6 -0
- package/dist/exports.js +6 -0
- package/dist/external/signalr/index.d.ts +4 -0
- package/dist/external/signalr/index.js +4 -0
- package/dist/hey-api.d.ts +11 -0
- package/dist/hey-api.js +14 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +12 -0
- package/dist/lang/files/en.d.ts +22 -0
- package/dist/lang/files/en.js +21 -0
- package/dist/lang/manifest.d.ts +1 -0
- package/dist/lang/manifest.js +11 -0
- package/dist/pipeline/components/background.element.d.ts +23 -0
- package/dist/pipeline/components/background.element.js +88 -0
- package/dist/pipeline/components/index.d.ts +6 -0
- package/dist/pipeline/components/index.js +6 -0
- package/dist/pipeline/components/pipeline-list.element.d.ts +32 -0
- package/dist/pipeline/components/pipeline-list.element.js +178 -0
- package/dist/pipeline/components/pipeline-table.element.d.ts +19 -0
- package/dist/pipeline/components/pipeline-table.element.js +149 -0
- package/dist/pipeline/components/process-error.element.d.ts +16 -0
- package/dist/pipeline/components/process-error.element.js +93 -0
- package/dist/pipeline/components/progress.element.d.ts +14 -0
- package/dist/pipeline/components/progress.element.js +177 -0
- package/dist/pipeline/components/progress.step.element.d.ts +15 -0
- package/dist/pipeline/components/progress.step.element.js +48 -0
- package/dist/pipeline/index.d.ts +8 -0
- package/dist/pipeline/index.js +8 -0
- package/dist/pipeline/modal/errors/error-modal.element.d.ts +13 -0
- package/dist/pipeline/modal/errors/error-modal.element.js +129 -0
- package/dist/pipeline/modal/errors/error-modal.token.d.ts +10 -0
- package/dist/pipeline/modal/errors/error-modal.token.js +8 -0
- package/dist/pipeline/modal/errors/index.d.ts +1 -0
- package/dist/pipeline/modal/errors/index.js +2 -0
- package/dist/pipeline/modal/errors/manifest.d.ts +1 -0
- package/dist/pipeline/modal/errors/manifest.js +7 -0
- package/dist/pipeline/modal/index.d.ts +2 -0
- package/dist/pipeline/modal/index.js +3 -0
- package/dist/pipeline/modal/manifest.d.ts +1 -0
- package/dist/pipeline/modal/manifest.js +8 -0
- package/dist/pipeline/modal/pipeline-modal.element.d.ts +20 -0
- package/dist/pipeline/modal/pipeline-modal.element.js +151 -0
- package/dist/pipeline/modal/pipeline-modal.token.d.ts +39 -0
- package/dist/pipeline/modal/pipeline-modal.token.js +38 -0
- package/dist/pipeline/pipeline.context.d.ts +53 -0
- package/dist/pipeline/pipeline.context.js +260 -0
- package/dist/pipeline/pipeline.element.d.ts +74 -0
- package/dist/pipeline/pipeline.element.js +260 -0
- package/dist/pipeline/pipeline.repository.d.ts +20 -0
- package/dist/pipeline/pipeline.repository.js +41 -0
- package/dist/pipeline/pipeline.source.d.ts +76 -0
- package/dist/pipeline/pipeline.source.js +79 -0
- package/dist/pipeline/pipelines.context.d.ts +12 -0
- package/dist/pipeline/pipelines.context.js +33 -0
- package/dist/pipeline/steps/index.d.ts +2 -0
- package/dist/pipeline/steps/index.js +2 -0
- package/dist/pipeline/steps/interfaces.d.ts +10 -0
- package/dist/pipeline/steps/interfaces.js +1 -0
- package/dist/pipeline/steps/models.d.ts +14 -0
- package/dist/pipeline/steps/models.js +24 -0
- package/dist/pipeline/workspace/manifest.d.ts +1 -0
- package/dist/pipeline/workspace/manifest.js +33 -0
- package/dist/pipeline/workspace/pipeline-workspace.context.d.ts +17 -0
- package/dist/pipeline/workspace/pipeline-workspace.context.js +58 -0
- package/dist/pipeline/workspace/pipeline-workspace.element.d.ts +6 -0
- package/dist/pipeline/workspace/pipeline-workspace.element.js +21 -0
- package/dist/pipeline/workspace/types.d.ts +6 -0
- package/dist/pipeline/workspace/types.js +10 -0
- package/dist/pipeline/workspace/views/default-pipeline-view.d.ts +20 -0
- package/dist/pipeline/workspace/views/default-pipeline-view.js +140 -0
- package/dist/queue/components/queue-list.element.d.ts +21 -0
- package/dist/queue/components/queue-list.element.js +72 -0
- package/dist/queue/components/queue-table.element.d.ts +24 -0
- package/dist/queue/components/queue-table.element.js +156 -0
- package/dist/queue/index.d.ts +3 -0
- package/dist/queue/index.js +3 -0
- package/dist/queue/queue.context.d.ts +13 -0
- package/dist/queue/queue.context.js +37 -0
- package/dist/queue/queue.repository.d.ts +10 -0
- package/dist/queue/queue.repository.js +32 -0
- package/dist/signalr/index.d.ts +2 -0
- package/dist/signalr/index.js +2 -0
- package/dist/signalr/signalr.context.d.ts +24 -0
- package/dist/signalr/signalr.context.js +99 -0
- package/dist/signalr/types.d.ts +12 -0
- package/dist/signalr/types.js +1 -0
- package/package.json +51 -0
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css, customElement, html, nothing, property, state, } from '@umbraco-cms/backoffice/external/lit';
|
|
8
|
+
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
|
9
|
+
import { PipelineStatus, JUMOO_PROCESSING_CONTEXT, } from '@jumoo/processing';
|
|
10
|
+
/**
|
|
11
|
+
* @property {string} processor - the processor to use for the pipeline
|
|
12
|
+
* @property {string} strategy - the strategy to use for the pipeline
|
|
13
|
+
* @property {ProcessingOptions} options - the options to see the pipeline with
|
|
14
|
+
*
|
|
15
|
+
* @fires pipeline-complete - when the pipeline is complete
|
|
16
|
+
* @fires pipeline-waiting - when the pipeline is waiting for user input
|
|
17
|
+
* @fires pipeline-last-action - when the pipeline is on the last action
|
|
18
|
+
* @fires pipeline-status - the current status of the pipeline.
|
|
19
|
+
*/
|
|
20
|
+
let JumooPipelineElement = class JumooPipelineElement extends UmbLitElement {
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
/**
|
|
24
|
+
* @description - show debug information
|
|
25
|
+
*/
|
|
26
|
+
this.debug = false;
|
|
27
|
+
this.consumeContext(JUMOO_PROCESSING_CONTEXT, (context) => {
|
|
28
|
+
if (!context)
|
|
29
|
+
return;
|
|
30
|
+
this.context = context;
|
|
31
|
+
this.observe(this.context.trigger, async (trigger) => {
|
|
32
|
+
if (trigger === true) {
|
|
33
|
+
await this.process();
|
|
34
|
+
this.context?.clearNext();
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
this.observe(this.context.close, async (close) => {
|
|
38
|
+
if (close === true) {
|
|
39
|
+
this.context?.triggerFinalized();
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
this.observe(this.context.pipeline, (pipeline) => {
|
|
43
|
+
this._pipelineId = pipeline;
|
|
44
|
+
if (this._pipelineId) {
|
|
45
|
+
this.context?.getPipeline(this._pipelineId);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
this.observe(this.context.state, (state) => {
|
|
49
|
+
this.state = state;
|
|
50
|
+
if (this.state) {
|
|
51
|
+
this.dispatchEvent(new CustomEvent('pipeline-status', {
|
|
52
|
+
bubbles: true,
|
|
53
|
+
composed: true,
|
|
54
|
+
detail: {
|
|
55
|
+
status: this.state?.status,
|
|
56
|
+
isLastAction: this.state?.progress.isLastAction,
|
|
57
|
+
},
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
if (this.state?.progress.isLastAction === true) {
|
|
61
|
+
this.onLastAction();
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
this.observe(this.context?.backgroundState, (backgroundState) => {
|
|
65
|
+
this.backgroundState = backgroundState;
|
|
66
|
+
});
|
|
67
|
+
this.observe(this.context.options, (options) => {
|
|
68
|
+
this.options = options;
|
|
69
|
+
});
|
|
70
|
+
this.observe(this.context.message, (message) => {
|
|
71
|
+
this.message = message;
|
|
72
|
+
});
|
|
73
|
+
this.observe(this.context.results, (results) => {
|
|
74
|
+
this.results = results;
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
connectedCallback() {
|
|
79
|
+
super.connectedCallback();
|
|
80
|
+
if (this.pipelineId) {
|
|
81
|
+
this.context?.loadPipeline(this.pipelineId);
|
|
82
|
+
}
|
|
83
|
+
else if (this.strategy && this.processor) {
|
|
84
|
+
this.options = this.setup;
|
|
85
|
+
this.context?.createPipeline(this.processor, this.strategy, this.setup);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async process() {
|
|
89
|
+
let result;
|
|
90
|
+
do {
|
|
91
|
+
result = await this.context?.process();
|
|
92
|
+
} while (result?.state.status == PipelineStatus.RUNNING);
|
|
93
|
+
// either complete, or waiting for user.
|
|
94
|
+
switch (result?.state.status) {
|
|
95
|
+
case PipelineStatus.COMPLETED:
|
|
96
|
+
this.onComplete();
|
|
97
|
+
break;
|
|
98
|
+
case PipelineStatus.BACKGROUND:
|
|
99
|
+
this.onBackground();
|
|
100
|
+
break;
|
|
101
|
+
default:
|
|
102
|
+
this.onWaiting();
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* @description dispatches a named custom event, with the pipelineId and state,
|
|
108
|
+
* @param name name of event to file
|
|
109
|
+
*/
|
|
110
|
+
fireEvent(name) {
|
|
111
|
+
this.dispatchEvent(new CustomEvent(name, {
|
|
112
|
+
bubbles: true,
|
|
113
|
+
composed: true,
|
|
114
|
+
detail: {
|
|
115
|
+
pielineId: this._pipelineId,
|
|
116
|
+
state: this.state,
|
|
117
|
+
},
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
120
|
+
onBackground() {
|
|
121
|
+
this.fireEvent('pipeline-background');
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* @description when the pipeline is complete
|
|
125
|
+
*/
|
|
126
|
+
onComplete() {
|
|
127
|
+
this.fireEvent('pipeline-complete');
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* @description when the pipeline is waiting for user input (via an element.)
|
|
131
|
+
*/
|
|
132
|
+
onWaiting() {
|
|
133
|
+
this.fireEvent('pipeline-waiting');
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* @description when the pipeline is on its last action
|
|
137
|
+
*/
|
|
138
|
+
onLastAction() {
|
|
139
|
+
this.fireEvent('pipeline-last-action');
|
|
140
|
+
}
|
|
141
|
+
render() {
|
|
142
|
+
return html `${this.renderStatus()}${this.renderDebug()}`;
|
|
143
|
+
}
|
|
144
|
+
renderDebug() {
|
|
145
|
+
return this.debug
|
|
146
|
+
? html `<div><pre>${JSON.stringify(this.state, null, 1)}</pre></div>`
|
|
147
|
+
: nothing;
|
|
148
|
+
}
|
|
149
|
+
renderStatus() {
|
|
150
|
+
switch (this.state?.status) {
|
|
151
|
+
case PipelineStatus.COMPLETED:
|
|
152
|
+
return this.renderComplete();
|
|
153
|
+
case PipelineStatus.WAITING:
|
|
154
|
+
return this.renderElement(this.state?.elementName);
|
|
155
|
+
case PipelineStatus.RUNNING:
|
|
156
|
+
return this.renderSteps();
|
|
157
|
+
case PipelineStatus.FAILED:
|
|
158
|
+
return this.renderFail();
|
|
159
|
+
case PipelineStatus.BACKGROUND:
|
|
160
|
+
return this.renderBackground();
|
|
161
|
+
default:
|
|
162
|
+
return nothing;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
renderBackground() {
|
|
166
|
+
return !this.state?.backgroundState?.backgroundElement
|
|
167
|
+
? html `<jumoo-pipeline-background
|
|
168
|
+
.message=${this.message}
|
|
169
|
+
.state=${this.backgroundState ?? this.state}
|
|
170
|
+
.pipelineId=${this._pipelineId}
|
|
171
|
+
.background=${this.state?.backgroundState}
|
|
172
|
+
.options=${this.options}></jumoo-pipeline-background>`
|
|
173
|
+
: this.renderElement(this.state?.backgroundState?.backgroundElement);
|
|
174
|
+
}
|
|
175
|
+
renderComplete() {
|
|
176
|
+
return !this.state?.backgroundState?.completedElement
|
|
177
|
+
? !this.state?.currentRequest?.action?.element
|
|
178
|
+
? html `<div>complete</div>`
|
|
179
|
+
: this.renderElement(this.state?.currentRequest?.action?.element)
|
|
180
|
+
: html `<jumoo-pipeline-background
|
|
181
|
+
.message=${this.message}
|
|
182
|
+
.state=${this.backgroundState ?? this.state}
|
|
183
|
+
.pipelineId=${this._pipelineId}
|
|
184
|
+
.background=${this.state?.backgroundState}
|
|
185
|
+
.options=${this.options}></jumoo-pipeline-background>`;
|
|
186
|
+
}
|
|
187
|
+
renderSteps() {
|
|
188
|
+
if (!this.state?.progress)
|
|
189
|
+
return nothing;
|
|
190
|
+
return html `<jumoo-pipeline-progress
|
|
191
|
+
.progress=${this.state?.progress}
|
|
192
|
+
.message=${this.message}></jumoo-pipeline-progress>`;
|
|
193
|
+
}
|
|
194
|
+
renderElement(element) {
|
|
195
|
+
return !element
|
|
196
|
+
? nothing
|
|
197
|
+
: html `
|
|
198
|
+
<div class="wrapper">
|
|
199
|
+
<umb-extension-slot
|
|
200
|
+
type="jumoo-process-step"
|
|
201
|
+
.filter=${(ext) => ext.elementName === element}
|
|
202
|
+
.props=${{
|
|
203
|
+
pipelineId: this._pipelineId,
|
|
204
|
+
state: this.state,
|
|
205
|
+
options: this.options,
|
|
206
|
+
results: this.results,
|
|
207
|
+
}}></umb-extension-slot>
|
|
208
|
+
</div>
|
|
209
|
+
`;
|
|
210
|
+
}
|
|
211
|
+
renderFail() {
|
|
212
|
+
return html `
|
|
213
|
+
<jumoo-processing-error .error=${this.results?.error}></jumoo-processing-error>
|
|
214
|
+
`;
|
|
215
|
+
}
|
|
216
|
+
};
|
|
217
|
+
JumooPipelineElement.styles = css `
|
|
218
|
+
.wrapper,
|
|
219
|
+
umb-extension-slot {
|
|
220
|
+
height: 100%;
|
|
221
|
+
}
|
|
222
|
+
`;
|
|
223
|
+
__decorate([
|
|
224
|
+
property({ type: String })
|
|
225
|
+
], JumooPipelineElement.prototype, "processor", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ type: String })
|
|
228
|
+
], JumooPipelineElement.prototype, "strategy", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
property({ type: Object })
|
|
231
|
+
], JumooPipelineElement.prototype, "setup", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
property({ type: String })
|
|
234
|
+
], JumooPipelineElement.prototype, "pipelineId", void 0);
|
|
235
|
+
__decorate([
|
|
236
|
+
property({ type: Boolean })
|
|
237
|
+
], JumooPipelineElement.prototype, "debug", void 0);
|
|
238
|
+
__decorate([
|
|
239
|
+
state()
|
|
240
|
+
], JumooPipelineElement.prototype, "_pipelineId", void 0);
|
|
241
|
+
__decorate([
|
|
242
|
+
state()
|
|
243
|
+
], JumooPipelineElement.prototype, "options", void 0);
|
|
244
|
+
__decorate([
|
|
245
|
+
state()
|
|
246
|
+
], JumooPipelineElement.prototype, "state", void 0);
|
|
247
|
+
__decorate([
|
|
248
|
+
state()
|
|
249
|
+
], JumooPipelineElement.prototype, "results", void 0);
|
|
250
|
+
__decorate([
|
|
251
|
+
state()
|
|
252
|
+
], JumooPipelineElement.prototype, "message", void 0);
|
|
253
|
+
__decorate([
|
|
254
|
+
state()
|
|
255
|
+
], JumooPipelineElement.prototype, "backgroundState", void 0);
|
|
256
|
+
JumooPipelineElement = __decorate([
|
|
257
|
+
customElement('jumoo-pipeline')
|
|
258
|
+
], JumooPipelineElement);
|
|
259
|
+
export { JumooPipelineElement };
|
|
260
|
+
export default JumooPipelineElement;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
|
2
|
+
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
|
|
3
|
+
import { PipelineStatus, ProcessingOptions } from '@jumoo/processing';
|
|
4
|
+
/**
|
|
5
|
+
* @description repository for the pipeline
|
|
6
|
+
*/
|
|
7
|
+
export declare class PipelineRepository extends UmbControllerBase {
|
|
8
|
+
private readonly source;
|
|
9
|
+
constructor(host: UmbControllerHost);
|
|
10
|
+
clear(id: string): Promise<unknown>;
|
|
11
|
+
process(id: string, clientId: string | null): Promise<import("@jumoo/processing").Pipeline>;
|
|
12
|
+
reattach(id: string, clientId: string | null): Promise<import("@jumoo/processing").Pipeline>;
|
|
13
|
+
update(id: string, body: any): Promise<import("@jumoo/processing").ProcessingOptionsResults>;
|
|
14
|
+
getProcessors(): Promise<string[]>;
|
|
15
|
+
Get(id: string): Promise<import("@jumoo/processing").Pipeline>;
|
|
16
|
+
create(processor: string, strategy: string, options: ProcessingOptions | undefined): Promise<string>;
|
|
17
|
+
complete(id: string): Promise<void>;
|
|
18
|
+
getResults(id: string): Promise<import("@jumoo/processing").ProcessingResults>;
|
|
19
|
+
listPipelines(status: PipelineStatus): Promise<import("@jumoo/processing").Pipeline[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
|
|
2
|
+
import { PipelineSource } from '@jumoo/processing';
|
|
3
|
+
/**
|
|
4
|
+
* @description repository for the pipeline
|
|
5
|
+
*/
|
|
6
|
+
export class PipelineRepository extends UmbControllerBase {
|
|
7
|
+
constructor(host) {
|
|
8
|
+
super(host);
|
|
9
|
+
this.source = new PipelineSource(host);
|
|
10
|
+
}
|
|
11
|
+
async clear(id) {
|
|
12
|
+
return (await this.source.clear(id)).data;
|
|
13
|
+
}
|
|
14
|
+
async process(id, clientId) {
|
|
15
|
+
return (await this.source.process(id, clientId)).data;
|
|
16
|
+
}
|
|
17
|
+
async reattach(id, clientId) {
|
|
18
|
+
return (await this.source.reattach(id, clientId)).data;
|
|
19
|
+
}
|
|
20
|
+
async update(id, body) {
|
|
21
|
+
return (await this.source.update(id, body)).data;
|
|
22
|
+
}
|
|
23
|
+
async getProcessors() {
|
|
24
|
+
return (await this.source.getProcessors()).data;
|
|
25
|
+
}
|
|
26
|
+
async Get(id) {
|
|
27
|
+
return (await this.source.Get(id)).data;
|
|
28
|
+
}
|
|
29
|
+
async create(processor, strategy, options) {
|
|
30
|
+
return (await this.source.create(processor, strategy, options)).data;
|
|
31
|
+
}
|
|
32
|
+
async complete(id) {
|
|
33
|
+
console.debug('complete', id);
|
|
34
|
+
}
|
|
35
|
+
async getResults(id) {
|
|
36
|
+
return (await this.source.getResults(id)).data;
|
|
37
|
+
}
|
|
38
|
+
async listPipelines(status) {
|
|
39
|
+
return (await this.source.listPiplelines(status)).data;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
|
2
|
+
import { PipelineStatus } from '../api';
|
|
3
|
+
export declare class PipelineSource {
|
|
4
|
+
private readonly host;
|
|
5
|
+
constructor(host: UmbControllerHost);
|
|
6
|
+
process(id: string, clientId: string | null): Promise<import("@umbraco-cms/backoffice/resources").UmbApiResponse<{
|
|
7
|
+
data: import("..").Pipeline;
|
|
8
|
+
request: Request;
|
|
9
|
+
response: Response;
|
|
10
|
+
}>>;
|
|
11
|
+
/**
|
|
12
|
+
* @description re-registers a client id against a pipeline already running in the
|
|
13
|
+
* background (e.g. after a SignalR reconnect gave the browser a new connection id), and
|
|
14
|
+
* returns the full, current pipeline so the caller can resync rather than trust whatever it
|
|
15
|
+
* last saw down the old, now-dead connection.
|
|
16
|
+
*/
|
|
17
|
+
reattach(id: string, clientId: string | null): Promise<import("@umbraco-cms/backoffice/resources").UmbApiResponse<{
|
|
18
|
+
data: import("..").Pipeline;
|
|
19
|
+
request: Request;
|
|
20
|
+
response: Response;
|
|
21
|
+
}>>;
|
|
22
|
+
update(id: string, body: any): Promise<import("@umbraco-cms/backoffice/resources").UmbApiResponse<{
|
|
23
|
+
data: import("..").ProcessingOptionsResults;
|
|
24
|
+
request: Request;
|
|
25
|
+
response: Response;
|
|
26
|
+
}>>;
|
|
27
|
+
getProcessors(): Promise<import("@umbraco-cms/backoffice/resources").UmbApiResponse<{
|
|
28
|
+
data: string[];
|
|
29
|
+
request: Request;
|
|
30
|
+
response: Response;
|
|
31
|
+
}>>;
|
|
32
|
+
/**
|
|
33
|
+
*
|
|
34
|
+
* @param id guid id of the pipeline to retrieve
|
|
35
|
+
* @returns pipeline
|
|
36
|
+
*/
|
|
37
|
+
Get(id: string): Promise<import("@umbraco-cms/backoffice/resources").UmbApiResponse<{
|
|
38
|
+
data: import("..").Pipeline;
|
|
39
|
+
request: Request;
|
|
40
|
+
response: Response;
|
|
41
|
+
}>>;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @param strategy alias of the strategy to use for the pipeline
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
create(processor: string, strategy: string, options: any): Promise<import("@umbraco-cms/backoffice/resources").UmbApiResponse<{
|
|
48
|
+
data: string;
|
|
49
|
+
request: Request;
|
|
50
|
+
response: Response;
|
|
51
|
+
}>>;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @param id guid id of the pipeline to remove
|
|
55
|
+
* @returns nothing.
|
|
56
|
+
*/
|
|
57
|
+
clear(id: string): Promise<import("@umbraco-cms/backoffice/resources").UmbApiResponse<{
|
|
58
|
+
data: unknown;
|
|
59
|
+
request: Request;
|
|
60
|
+
response: Response;
|
|
61
|
+
}>>;
|
|
62
|
+
/**
|
|
63
|
+
* @param id guid id of the pipeline to retrieve results for
|
|
64
|
+
* @returns results (if there are any) for the pipeline
|
|
65
|
+
*/
|
|
66
|
+
getResults(id: string): Promise<import("@umbraco-cms/backoffice/resources").UmbApiResponse<{
|
|
67
|
+
data: import("..").ProcessingResults;
|
|
68
|
+
request: Request;
|
|
69
|
+
response: Response;
|
|
70
|
+
}>>;
|
|
71
|
+
listPiplelines(status: PipelineStatus): Promise<import("@umbraco-cms/backoffice/resources").UmbApiResponse<{
|
|
72
|
+
data: import("..").Pipeline[];
|
|
73
|
+
request: Request;
|
|
74
|
+
response: Response;
|
|
75
|
+
}>>;
|
|
76
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { tryExecute } from '@umbraco-cms/backoffice/resources';
|
|
2
|
+
import { PipelinesService } from '../api';
|
|
3
|
+
export class PipelineSource {
|
|
4
|
+
constructor(host) {
|
|
5
|
+
this.host = host;
|
|
6
|
+
}
|
|
7
|
+
async process(id, clientId) {
|
|
8
|
+
const result = await tryExecute(this.host, PipelinesService.processPipeline({
|
|
9
|
+
path: { id: id },
|
|
10
|
+
query: { clientId: clientId ?? undefined },
|
|
11
|
+
}));
|
|
12
|
+
return result;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @description re-registers a client id against a pipeline already running in the
|
|
16
|
+
* background (e.g. after a SignalR reconnect gave the browser a new connection id), and
|
|
17
|
+
* returns the full, current pipeline so the caller can resync rather than trust whatever it
|
|
18
|
+
* last saw down the old, now-dead connection.
|
|
19
|
+
*/
|
|
20
|
+
async reattach(id, clientId) {
|
|
21
|
+
const result = await tryExecute(this.host, PipelinesService.reattachPipeline({
|
|
22
|
+
path: { id: id },
|
|
23
|
+
query: { clientId: clientId ?? undefined },
|
|
24
|
+
}));
|
|
25
|
+
return result;
|
|
26
|
+
}
|
|
27
|
+
async update(id, body) {
|
|
28
|
+
return await tryExecute(this.host, PipelinesService.updatePipeline({
|
|
29
|
+
path: { id: id },
|
|
30
|
+
body: body,
|
|
31
|
+
}));
|
|
32
|
+
}
|
|
33
|
+
async getProcessors() {
|
|
34
|
+
return await tryExecute(this.host, PipelinesService.getProcessors());
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param id guid id of the pipeline to retrieve
|
|
39
|
+
* @returns pipeline
|
|
40
|
+
*/
|
|
41
|
+
async Get(id) {
|
|
42
|
+
return await tryExecute(this.host, PipelinesService.getPipeline({ path: { id: id } }));
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
* @param strategy alias of the strategy to use for the pipeline
|
|
47
|
+
* @returns
|
|
48
|
+
*/
|
|
49
|
+
async create(processor, strategy, options) {
|
|
50
|
+
return await tryExecute(this.host, PipelinesService.createPipeline({
|
|
51
|
+
body: {
|
|
52
|
+
alias: processor,
|
|
53
|
+
strategy: strategy,
|
|
54
|
+
options: options,
|
|
55
|
+
clientId: null,
|
|
56
|
+
},
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
*
|
|
61
|
+
* @param id guid id of the pipeline to remove
|
|
62
|
+
* @returns nothing.
|
|
63
|
+
*/
|
|
64
|
+
async clear(id) {
|
|
65
|
+
return await tryExecute(this.host, PipelinesService.clearPipeline({ path: { id: id } }));
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @param id guid id of the pipeline to retrieve results for
|
|
69
|
+
* @returns results (if there are any) for the pipeline
|
|
70
|
+
*/
|
|
71
|
+
async getResults(id) {
|
|
72
|
+
return await tryExecute(this.host, PipelinesService.getResults({
|
|
73
|
+
path: { id: id },
|
|
74
|
+
}));
|
|
75
|
+
}
|
|
76
|
+
async listPiplelines(status) {
|
|
77
|
+
return await tryExecute(this.host, PipelinesService.listPipelines({ path: { status: status } }));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
|
|
2
|
+
import { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
|
3
|
+
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
|
4
|
+
import { PipelineStatus } from '../api';
|
|
5
|
+
export declare class PipelinesContext extends UmbControllerBase {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(host: UmbControllerHost);
|
|
8
|
+
listPipelines(status: PipelineStatus): Promise<import("..").Pipeline[]>;
|
|
9
|
+
clear(id: string): Promise<unknown>;
|
|
10
|
+
}
|
|
11
|
+
export default PipelinesContext;
|
|
12
|
+
export declare const JUMOO_PIPELINES_CONTEXT: UmbContextToken<PipelinesContext, PipelinesContext>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
+
};
|
|
7
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
+
};
|
|
12
|
+
var _PipelinesContext_repository;
|
|
13
|
+
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
|
|
14
|
+
import { PipelineRepository } from './pipeline.repository';
|
|
15
|
+
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
|
16
|
+
export class PipelinesContext extends UmbControllerBase {
|
|
17
|
+
constructor(host) {
|
|
18
|
+
super(host);
|
|
19
|
+
_PipelinesContext_repository.set(this, void 0);
|
|
20
|
+
__classPrivateFieldSet(this, _PipelinesContext_repository, new PipelineRepository(host), "f");
|
|
21
|
+
this.provideContext(JUMOO_PIPELINES_CONTEXT, this);
|
|
22
|
+
}
|
|
23
|
+
async listPipelines(status) {
|
|
24
|
+
const pipelines = await __classPrivateFieldGet(this, _PipelinesContext_repository, "f").listPipelines(status);
|
|
25
|
+
return pipelines;
|
|
26
|
+
}
|
|
27
|
+
async clear(id) {
|
|
28
|
+
return await __classPrivateFieldGet(this, _PipelinesContext_repository, "f").clear(id);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
_PipelinesContext_repository = new WeakMap();
|
|
32
|
+
export default PipelinesContext;
|
|
33
|
+
export const JUMOO_PIPELINES_CONTEXT = new UmbContextToken('JUMOO_PIPELINES_CONTEXT');
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ManifestElement } from '@umbraco-cms/backoffice/extension-api';
|
|
2
|
+
import { ProcessStepElement } from '@jumoo/processing';
|
|
3
|
+
export interface ManifestProcessStep extends ManifestElement<ProcessStepElement> {
|
|
4
|
+
type: 'jumoo-process-step';
|
|
5
|
+
}
|
|
6
|
+
declare global {
|
|
7
|
+
interface UmbExtensionManifestMap {
|
|
8
|
+
ManifestProcessStep: ManifestProcessStep;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
|
2
|
+
import { PipelineState, ProcessingOptions, ProcessingResults } from '@jumoo/processing';
|
|
3
|
+
export declare class ProcessStepElement extends HTMLElement {
|
|
4
|
+
pipelineId: string | null | undefined;
|
|
5
|
+
state: PipelineState | null | undefined;
|
|
6
|
+
options: ProcessingOptions | null | undefined;
|
|
7
|
+
results: ProcessingResults | null | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare class ProcessStepElementBase extends UmbLitElement {
|
|
10
|
+
pipelineId: string | null | undefined;
|
|
11
|
+
state: PipelineState | null | undefined;
|
|
12
|
+
options: ProcessingOptions | null | undefined;
|
|
13
|
+
results: ProcessingResults | null | undefined;
|
|
14
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
|
|
8
|
+
import { property } from '@umbraco-cms/backoffice/external/lit';
|
|
9
|
+
export class ProcessStepElement extends HTMLElement {
|
|
10
|
+
}
|
|
11
|
+
export class ProcessStepElementBase extends UmbLitElement {
|
|
12
|
+
}
|
|
13
|
+
__decorate([
|
|
14
|
+
property({ type: String })
|
|
15
|
+
], ProcessStepElementBase.prototype, "pipelineId", void 0);
|
|
16
|
+
__decorate([
|
|
17
|
+
property({ type: Object })
|
|
18
|
+
], ProcessStepElementBase.prototype, "state", void 0);
|
|
19
|
+
__decorate([
|
|
20
|
+
property({ type: Object })
|
|
21
|
+
], ProcessStepElementBase.prototype, "options", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
property({ type: Object })
|
|
24
|
+
], ProcessStepElementBase.prototype, "results", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const manifests: import("@umbraco-cms/backoffice/extension-api").ManifestBase[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { JUMOO_PROCESSING_PIPELINE_ENTITY_TYPE, JUMOO_PROCESSING_PIPELINE_WORKSPACE_ALIAS, } from './types.js';
|
|
2
|
+
const workspace = {
|
|
3
|
+
type: 'workspace',
|
|
4
|
+
kind: 'routable',
|
|
5
|
+
alias: JUMOO_PROCESSING_PIPELINE_WORKSPACE_ALIAS,
|
|
6
|
+
name: 'Processing pipeline workspace',
|
|
7
|
+
api: () => import('./pipeline-workspace.context.js'),
|
|
8
|
+
meta: {
|
|
9
|
+
entityType: JUMOO_PROCESSING_PIPELINE_ENTITY_TYPE,
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
const viewConditions = [
|
|
13
|
+
{
|
|
14
|
+
alias: 'Umb.Condition.WorkspaceAlias',
|
|
15
|
+
match: JUMOO_PROCESSING_PIPELINE_WORKSPACE_ALIAS,
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
const views = [
|
|
19
|
+
{
|
|
20
|
+
type: 'workspaceView',
|
|
21
|
+
alias: 'jumoo-processing-pipeline-workspace-default-view',
|
|
22
|
+
name: 'Processing pipeline workspace default view',
|
|
23
|
+
js: () => import('./views/default-pipeline-view.js'),
|
|
24
|
+
weight: 300,
|
|
25
|
+
meta: {
|
|
26
|
+
label: 'Pipeline',
|
|
27
|
+
pathname: 'pipeline',
|
|
28
|
+
icon: 'icon-stack',
|
|
29
|
+
},
|
|
30
|
+
conditions: viewConditions,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
export const manifests = [workspace, ...views];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { UmbEditableWorkspaceContextBase, UmbRoutableWorkspaceContext } from '@umbraco-cms/backoffice/workspace';
|
|
2
|
+
import { Pipeline } from '../../api';
|
|
3
|
+
import { UmbContextToken } from '@umbraco-cms/backoffice/context-api';
|
|
4
|
+
import { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
|
|
5
|
+
export declare class JumooProcessingPipelineWorkspaceContext extends UmbEditableWorkspaceContextBase<Pipeline> implements UmbRoutableWorkspaceContext {
|
|
6
|
+
#private;
|
|
7
|
+
readonly data: import("rxjs").Observable<Pipeline | undefined>;
|
|
8
|
+
readonly unique: import("rxjs").Observable<string | undefined>;
|
|
9
|
+
constructor(host: UmbControllerHost);
|
|
10
|
+
load(unique: string): Promise<void>;
|
|
11
|
+
getUnique(): string | null | undefined;
|
|
12
|
+
getEntityType(): string;
|
|
13
|
+
getData(): Pipeline | undefined;
|
|
14
|
+
protected submit(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export { JumooProcessingPipelineWorkspaceContext as api };
|
|
17
|
+
export declare const JUMOO_PROCESSING_PIPELINE_WORKSPACE: UmbContextToken<JumooProcessingPipelineWorkspaceContext, JumooProcessingPipelineWorkspaceContext>;
|