@uniformdev/canvas 19.150.0 → 19.151.1-alpha.16

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/index.esm.js CHANGED
@@ -2477,7 +2477,9 @@ function convertEntryToPutEntry(entry) {
2477
2477
  pattern: entry.pattern,
2478
2478
  state: entry.state,
2479
2479
  projectId: entry.projectId,
2480
- releaseId: entry.releaseId
2480
+ releaseId: entry.releaseId,
2481
+ workflowId: entry.workflowId,
2482
+ workflowStageId: entry.workflowStageId
2481
2483
  };
2482
2484
  }
2483
2485
 
@@ -2780,6 +2782,41 @@ function handleRichTextNodeBinding(object, options) {
2780
2782
 
2781
2783
  // src/index.ts
2782
2784
  import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
2785
+
2786
+ // src/WorkflowClient.ts
2787
+ import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
2788
+ var workflowsUrl = "/api/v1/workflows";
2789
+ var WorkflowClient = class extends ApiClient12 {
2790
+ constructor(options) {
2791
+ super(options);
2792
+ }
2793
+ /** Fetches workflows for a project */
2794
+ async get(options) {
2795
+ const { projectId } = this.options;
2796
+ const fetchUri = this.createUrl(workflowsUrl, { ...options, projectId });
2797
+ return await this.apiClient(fetchUri);
2798
+ }
2799
+ /** Updates or creates a workflow definition */
2800
+ async upsert(body) {
2801
+ const fetchUri = this.createUrl(workflowsUrl);
2802
+ await this.apiClient(fetchUri, {
2803
+ method: "PUT",
2804
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2805
+ expectNoContent: true
2806
+ });
2807
+ }
2808
+ /** Deletes a workflow definition */
2809
+ async remove(body) {
2810
+ const fetchUri = this.createUrl(workflowsUrl);
2811
+ await this.apiClient(fetchUri, {
2812
+ method: "DELETE",
2813
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2814
+ expectNoContent: true
2815
+ });
2816
+ }
2817
+ };
2818
+
2819
+ // src/index.ts
2783
2820
  var CanvasClientError = ApiClientError2;
2784
2821
  export {
2785
2822
  ASSETS_SOURCE_CUSTOM_URL,
@@ -2844,6 +2881,7 @@ export {
2844
2881
  UncachedCategoryClient,
2845
2882
  UncachedContentClient,
2846
2883
  UniqueBatchEntries,
2884
+ WorkflowClient,
2847
2885
  bindVariables,
2848
2886
  bindVariablesToObject,
2849
2887
  compose,
package/dist/index.js CHANGED
@@ -286,7 +286,7 @@ __export(src_exports, {
286
286
  ATTRIBUTE_PARAMETER_TYPE: () => ATTRIBUTE_PARAMETER_TYPE,
287
287
  ATTRIBUTE_PARAMETER_VALUE: () => ATTRIBUTE_PARAMETER_VALUE,
288
288
  ATTRIBUTE_PLACEHOLDER: () => ATTRIBUTE_PLACEHOLDER,
289
- ApiClientError: () => import_api13.ApiClientError,
289
+ ApiClientError: () => import_api14.ApiClientError,
290
290
  BatchEntry: () => BatchEntry,
291
291
  CANVAS_BLOCK_PARAM_TYPE: () => CANVAS_BLOCK_PARAM_TYPE,
292
292
  CANVAS_DRAFT_STATE: () => CANVAS_DRAFT_STATE,
@@ -339,6 +339,7 @@ __export(src_exports, {
339
339
  UncachedCategoryClient: () => UncachedCategoryClient,
340
340
  UncachedContentClient: () => UncachedContentClient,
341
341
  UniqueBatchEntries: () => UniqueBatchEntries,
342
+ WorkflowClient: () => WorkflowClient,
342
343
  bindVariables: () => bindVariables,
343
344
  bindVariablesToObject: () => bindVariablesToObject,
344
345
  compose: () => compose,
@@ -2613,7 +2614,9 @@ function convertEntryToPutEntry(entry) {
2613
2614
  pattern: entry.pattern,
2614
2615
  state: entry.state,
2615
2616
  projectId: entry.projectId,
2616
- releaseId: entry.releaseId
2617
+ releaseId: entry.releaseId,
2618
+ workflowId: entry.workflowId,
2619
+ workflowStageId: entry.workflowStageId
2617
2620
  };
2618
2621
  }
2619
2622
 
@@ -2915,8 +2918,43 @@ function handleRichTextNodeBinding(object, options) {
2915
2918
  }
2916
2919
 
2917
2920
  // src/index.ts
2921
+ var import_api14 = require("@uniformdev/context/api");
2922
+
2923
+ // src/WorkflowClient.ts
2918
2924
  var import_api13 = require("@uniformdev/context/api");
2919
- var CanvasClientError = import_api13.ApiClientError;
2925
+ var workflowsUrl = "/api/v1/workflows";
2926
+ var WorkflowClient = class extends import_api13.ApiClient {
2927
+ constructor(options) {
2928
+ super(options);
2929
+ }
2930
+ /** Fetches workflows for a project */
2931
+ async get(options) {
2932
+ const { projectId } = this.options;
2933
+ const fetchUri = this.createUrl(workflowsUrl, { ...options, projectId });
2934
+ return await this.apiClient(fetchUri);
2935
+ }
2936
+ /** Updates or creates a workflow definition */
2937
+ async upsert(body) {
2938
+ const fetchUri = this.createUrl(workflowsUrl);
2939
+ await this.apiClient(fetchUri, {
2940
+ method: "PUT",
2941
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2942
+ expectNoContent: true
2943
+ });
2944
+ }
2945
+ /** Deletes a workflow definition */
2946
+ async remove(body) {
2947
+ const fetchUri = this.createUrl(workflowsUrl);
2948
+ await this.apiClient(fetchUri, {
2949
+ method: "DELETE",
2950
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2951
+ expectNoContent: true
2952
+ });
2953
+ }
2954
+ };
2955
+
2956
+ // src/index.ts
2957
+ var CanvasClientError = import_api14.ApiClientError;
2920
2958
  // Annotate the CommonJS export names for ESM import in node:
2921
2959
  0 && (module.exports = {
2922
2960
  ASSETS_SOURCE_CUSTOM_URL,
@@ -2981,6 +3019,7 @@ var CanvasClientError = import_api13.ApiClientError;
2981
3019
  UncachedCategoryClient,
2982
3020
  UncachedContentClient,
2983
3021
  UniqueBatchEntries,
3022
+ WorkflowClient,
2984
3023
  bindVariables,
2985
3024
  bindVariablesToObject,
2986
3025
  compose,
package/dist/index.mjs CHANGED
@@ -2477,7 +2477,9 @@ function convertEntryToPutEntry(entry) {
2477
2477
  pattern: entry.pattern,
2478
2478
  state: entry.state,
2479
2479
  projectId: entry.projectId,
2480
- releaseId: entry.releaseId
2480
+ releaseId: entry.releaseId,
2481
+ workflowId: entry.workflowId,
2482
+ workflowStageId: entry.workflowStageId
2481
2483
  };
2482
2484
  }
2483
2485
 
@@ -2780,6 +2782,41 @@ function handleRichTextNodeBinding(object, options) {
2780
2782
 
2781
2783
  // src/index.ts
2782
2784
  import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
2785
+
2786
+ // src/WorkflowClient.ts
2787
+ import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
2788
+ var workflowsUrl = "/api/v1/workflows";
2789
+ var WorkflowClient = class extends ApiClient12 {
2790
+ constructor(options) {
2791
+ super(options);
2792
+ }
2793
+ /** Fetches workflows for a project */
2794
+ async get(options) {
2795
+ const { projectId } = this.options;
2796
+ const fetchUri = this.createUrl(workflowsUrl, { ...options, projectId });
2797
+ return await this.apiClient(fetchUri);
2798
+ }
2799
+ /** Updates or creates a workflow definition */
2800
+ async upsert(body) {
2801
+ const fetchUri = this.createUrl(workflowsUrl);
2802
+ await this.apiClient(fetchUri, {
2803
+ method: "PUT",
2804
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2805
+ expectNoContent: true
2806
+ });
2807
+ }
2808
+ /** Deletes a workflow definition */
2809
+ async remove(body) {
2810
+ const fetchUri = this.createUrl(workflowsUrl);
2811
+ await this.apiClient(fetchUri, {
2812
+ method: "DELETE",
2813
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
2814
+ expectNoContent: true
2815
+ });
2816
+ }
2817
+ };
2818
+
2819
+ // src/index.ts
2783
2820
  var CanvasClientError = ApiClientError2;
2784
2821
  export {
2785
2822
  ASSETS_SOURCE_CUSTOM_URL,
@@ -2844,6 +2881,7 @@ export {
2844
2881
  UncachedCategoryClient,
2845
2882
  UncachedContentClient,
2846
2883
  UniqueBatchEntries,
2884
+ WorkflowClient,
2847
2885
  bindVariables,
2848
2886
  bindVariablesToObject,
2849
2887
  compose,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.150.0",
3
+ "version": "19.151.1-alpha.16+083730f396",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -38,8 +38,8 @@
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/assets": "19.150.0",
42
- "@uniformdev/context": "19.150.0",
41
+ "@uniformdev/assets": "19.151.1-alpha.16+083730f396",
42
+ "@uniformdev/context": "19.151.1-alpha.16+083730f396",
43
43
  "immer": "10.0.4"
44
44
  },
45
45
  "files": [
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "4dc41368724c89d5d3c20ff5e4f84c4cfb1752b2"
51
+ "gitHead": "083730f3965a6c60b2c475903ca146a5db44260f"
52
52
  }