@jumoo/processing 18.2.0 → 18.3.1

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.
@@ -1,11 +1,16 @@
1
1
  import { tryExecute } from '@umbraco-cms/backoffice/resources';
2
- import { getProcessingGetPipelineById, getProcessingGetProcessors, getProcessingGetResultsById, getProcessingListPipelinesByStatus, postProcessingClearPipelineById, postProcessingCreatePipeline, postProcessingProcessPipelineById, postProcessingReattachPipelineById, postProcessingUpdatePipelineById, } from '../api';
2
+ import { getProcessingGetPipelineById, getProcessingGetProcessors, getProcessingGetResultsById, getProcessingListPipelinesByStatus, getProcessingPipelineStatusById, postProcessingClearPipelineById, postProcessingCreatePipeline, postProcessingProcessPipelineById, postProcessingReattachPipelineById, postProcessingUpdatePipelineById, } from '../api';
3
+ import { tryExecuteAllowingConflict } from './pipeline-conflict.js';
3
4
  export class PipelineSource {
4
5
  constructor(host) {
5
6
  this.host = host;
6
7
  }
8
+ /**
9
+ * @description a 409 (another pipeline holds this one's concurrency key, so it can't resume)
10
+ * is returned as the error without a notification - see getPipelineConflict.
11
+ */
7
12
  async process(id, clientId) {
8
- const result = await tryExecute(this.host, postProcessingProcessPipelineById({
13
+ const result = await tryExecuteAllowingConflict(this.host, postProcessingProcessPipelineById({
9
14
  path: { id: id },
10
15
  query: { clientId: clientId ?? undefined },
11
16
  }));
@@ -24,8 +29,12 @@ export class PipelineSource {
24
29
  }));
25
30
  return result;
26
31
  }
32
+ /**
33
+ * @description a 409 (the new options' concurrency key is held) is returned as the error
34
+ * without a notification - see getPipelineConflict.
35
+ */
27
36
  async update(id, body) {
28
- return await tryExecute(this.host, postProcessingUpdatePipelineById({
37
+ return await tryExecuteAllowingConflict(this.host, postProcessingUpdatePipelineById({
29
38
  path: { id: id },
30
39
  body: body,
31
40
  }));
@@ -44,10 +53,11 @@ export class PipelineSource {
44
53
  /**
45
54
  *
46
55
  * @param strategy alias of the strategy to use for the pipeline
47
- * @returns
56
+ * @returns the new pipeline's id. A 409 (another pipeline holds its concurrency key) is
57
+ * returned as the error without a notification - see getPipelineConflict.
48
58
  */
49
59
  async create(processor, strategy, options) {
50
- return await tryExecute(this.host, postProcessingCreatePipeline({
60
+ return await tryExecuteAllowingConflict(this.host, postProcessingCreatePipeline({
51
61
  body: {
52
62
  alias: processor,
53
63
  strategy: strategy,
@@ -73,6 +83,15 @@ export class PipelineSource {
73
83
  path: { id: id },
74
84
  }));
75
85
  }
86
+ /**
87
+ * @param id guid id of the pipeline
88
+ * @returns its run status, or an error (without a notification) if the user can't see it.
89
+ */
90
+ async getRunStatus(id) {
91
+ return await tryExecute(this.host, getProcessingPipelineStatusById({ path: { id: id } }), {
92
+ disableNotifications: true,
93
+ });
94
+ }
76
95
  async listPiplelines(status) {
77
96
  return await tryExecute(this.host, getProcessingListPipelinesByStatus({ path: { status: status } }));
78
97
  }
package/package.json CHANGED
@@ -1,52 +1,59 @@
1
- {
2
- "name": "@jumoo/processing",
3
- "licence": "custom",
4
- "version": "18.2.0",
5
- "type": "module",
6
- "description": "Jumoo processing library",
7
- "exports": {
8
- ".": "./dist/index.js",
9
- "./pipeline": "./dist/pipeline/index.js",
10
- "./signalr": "./dist/signalr/index.js",
11
- "./api": "./dist/api/index.js"
12
- },
13
- "files": [
14
- "./dist/**/*"
15
- ],
16
- "author": {
17
- "name": "Jumoo",
18
- "email": "info@jumoo.co.uk",
19
- "url": "https://jumoo.co.uk"
20
- },
21
- "publishConfig": {},
22
- "scripts": {
23
- "client:build": "tsc --project ./tsconfig.dist.json",
24
- "client:pack": "npm pack --pack-destination ./pack",
25
- "client:publish": "npm publish -tag next",
26
- "client:make": "npm run client:build && npm run client:pack && npm run client:publish",
27
- "client:link": "npm link",
28
- "generate-client": "node scripts/generate-openapi.js https://localhost:44348/umbraco/openapi/processing.json",
29
- "lint": "eslint .",
30
- "lint:fix": "eslint . --fix",
31
- "format:fix": "npm run format -- --write",
32
- "format": "prettier \"src/**/*.ts\" \"*.ts\" \"*.js\" \"*.json\" \"scripts/**/*.js\" --check",
33
- "build": "tsc && vite build",
34
- "watch": "vite build --watch",
35
- "make": "npm run build && npm run client:make"
36
- },
37
- "devDependencies": {
38
- "@eslint/js": "^10.0.1",
39
- "@hey-api/openapi-ts": "^0.99.0",
40
- "@microsoft/signalr": "^10.0.0",
41
- "@umbraco-cms/backoffice": "18.0.1",
42
- "chalk": "^5.6.2",
43
- "cross-env": "^10.1.0",
44
- "eslint": "^10.5.0",
45
- "globals": "^17.8.0",
46
- "node-fetch": "^3.3.2",
47
- "prettier": "^3.8.2",
48
- "typescript": "^6.0.3",
49
- "typescript-eslint": "^8.65.0",
50
- "vite": "^8.0.16"
51
- }
52
- }
1
+ {
2
+ "name": "@jumoo/processing",
3
+ "licence": "custom",
4
+ "version": "18.3.1",
5
+ "type": "module",
6
+ "description": "Jumoo processing library",
7
+ "exports": {
8
+ ".": "./dist/index.js",
9
+ "./pipeline": "./dist/pipeline/index.js",
10
+ "./signalr": "./dist/signalr/index.js",
11
+ "./api": "./dist/api/index.js"
12
+ },
13
+ "files": [
14
+ "./dist/**/*"
15
+ ],
16
+ "author": {
17
+ "name": "Jumoo",
18
+ "email": "info@jumoo.co.uk",
19
+ "url": "https://jumoo.co.uk"
20
+ },
21
+ "publishConfig": {
22
+ "access": "public"
23
+ },
24
+ "scripts": {
25
+ "client:build": "tsc --project ./tsconfig.dist.json",
26
+ "client:pack": "npm pack --pack-destination ./pack",
27
+ "client:publish": "npm publish -tag next",
28
+ "client:make": "npm run client:build && npm run client:pack && npm run client:publish",
29
+ "client:link": "npm link",
30
+ "generate-client": "node scripts/generate-openapi.js https://localhost:44348/umbraco/openapi/processing.json",
31
+ "lint": "eslint .",
32
+ "lint:fix": "eslint . --fix",
33
+ "format:fix": "npm run format -- --write",
34
+ "format": "prettier \"src/**/*.ts\" \"*.ts\" \"*.js\" \"*.json\" \"scripts/**/*.js\" --check",
35
+ "build": "tsc && vite build",
36
+ "watch": "vite build --watch",
37
+ "make": "npm run build && npm run client:make"
38
+ },
39
+ "devDependencies": {
40
+ "@eslint/js": "^10.0.1",
41
+ "@hey-api/openapi-ts": "^0.99.0",
42
+ "@microsoft/signalr": "^10.0.0",
43
+ "@umbraco-cms/backoffice": "18.0.1",
44
+ "chalk": "^5.6.2",
45
+ "cross-env": "^10.1.0",
46
+ "eslint": "^10.13.0",
47
+ "globals": "^17.13.0",
48
+ "node-fetch": "^3.3.2",
49
+ "prettier": "^3.9.10",
50
+ "typescript": "^6.0.3",
51
+ "typescript-eslint": "^8.72.0",
52
+ "vite": "^8.3.5"
53
+ },
54
+ "repository": {
55
+ "type": "git",
56
+ "url": "git+https://github.com/Jumoo/Jumoo.Processing.git",
57
+ "directory": "Jumoo.Processing.Client/jumoo-processing-assets"
58
+ }
59
+ }
package/dist/hey-api.d.ts DELETED
@@ -1,11 +0,0 @@
1
- import type { CreateClientConfig } from './api/client.gen';
2
- /**
3
- * Pre-configure the generated client by copying the Umbraco HTTP client's config.
4
- *
5
- * Called automatically by the generated client during initialization (via runtimeConfigPath).
6
- * Inherits baseUrl, credentials, auth, and headers from umbHttpClient — which is already
7
- * configured by the backoffice before extensions load.
8
- *
9
- * @see https://heyapi.dev/openapi-ts/clients/fetch#configuration
10
- */
11
- export declare const createClientConfig: CreateClientConfig;
package/dist/hey-api.js DELETED
@@ -1,14 +0,0 @@
1
- import { umbHttpClient } from '@umbraco-cms/backoffice/http-client';
2
- /**
3
- * Pre-configure the generated client by copying the Umbraco HTTP client's config.
4
- *
5
- * Called automatically by the generated client during initialization (via runtimeConfigPath).
6
- * Inherits baseUrl, credentials, auth, and headers from umbHttpClient — which is already
7
- * configured by the backoffice before extensions load.
8
- *
9
- * @see https://heyapi.dev/openapi-ts/clients/fetch#configuration
10
- */
11
- export const createClientConfig = (config) => ({
12
- ...config,
13
- ...umbHttpClient.getConfig(),
14
- });