yaveon.ecm.d3dwebhooks 0.8.0 → 0.8.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,4 +1,4 @@
1
- import { INumberRangePropertyObject } from "./Yaveon.ECM.d3d.Webhook.Interfaces";
1
+ import { IWebhookConfiguration, IWebhookConfigurationNumRangesTenantProperty } from "./Yaveon.ECM.d3d.Webhook.Interfaces";
2
2
  import { D3dClient } from "./Yaveon.ECM.d3d.Client";
3
3
  export declare class D3dWebhookClient extends D3dClient {
4
4
  private configFileId;
@@ -6,9 +6,9 @@ export declare class D3dWebhookClient extends D3dClient {
6
6
  constructor(baseUrl: string, repositoryId: string, accessToken: string);
7
7
  updateConfiguration(configObject: Object, alterationText: string): Promise<any>;
8
8
  private ensureConfigurationFileId;
9
- getConfiguration(): Promise<any>;
9
+ getConfiguration(): Promise<IWebhookConfiguration>;
10
10
  blockConfiguration(): Promise<void>;
11
11
  releaseConfiguration(alterationText?: string): Promise<void>;
12
12
  getCurrentUserName(): Promise<string>;
13
- getNumberRangeInformation(doc: any, config: any): INumberRangePropertyObject[];
13
+ getNumberRangeInformation(doc: any, config: IWebhookConfiguration): IWebhookConfigurationNumRangesTenantProperty[];
14
14
  }
@@ -97,8 +97,8 @@ class D3dWebhookClient extends Yaveon_ECM_d3d_Client_1.D3dClient {
97
97
  return tenantProperty.value === cp.tenantPropertyValue;
98
98
  });
99
99
  let numberRangeInformation = [];
100
- if (tenantInfo !== null) {
101
- numberRangeInformation = tenantInfo.properties.filter(p => p.enabledCategories.some(ec => ec.id === doc.categoryId));
100
+ if (tenantInfo) {
101
+ numberRangeInformation = tenantInfo.properties.filter((p) => p.enabledCategories.some((ec) => ec.id === doc.categoryId));
102
102
  }
103
103
  return numberRangeInformation;
104
104
  }
@@ -40,3 +40,64 @@ export interface IWebhookResponse {
40
40
  reqBody: any;
41
41
  resultMsg: string;
42
42
  }
43
+ export interface IWebhookConfigurationKeyProperty {
44
+ id: string;
45
+ uniqueId: string;
46
+ displayName: string;
47
+ }
48
+ export interface IWebhookConfigurationBucketProperty extends IWebhookConfigurationKeyProperty {
49
+ url: string;
50
+ key: IWebhookConfigurationKeyProperty;
51
+ mappings: Map<string, string>;
52
+ }
53
+ export interface IWebhookConfigurationFoldersMoveToCategoryKey {
54
+ toPropertyGuid: string;
55
+ toPropertyId: string;
56
+ toPropertyName: string;
57
+ }
58
+ export interface IWebhookConfigurationFoldersMoveToPropertyMapping {
59
+ fromPropertyGuid: string;
60
+ fromPropertyId: string;
61
+ fromPropertyName: string;
62
+ toPropertyGuid: string;
63
+ toPropertyId: string;
64
+ toPropertyName: string;
65
+ }
66
+ export interface IWebhookConfigurationFoldersMoveToCategoryMapping {
67
+ toPropertyGuid: string;
68
+ toPropertyId: string;
69
+ toCategoryKeys: IWebhookConfigurationFoldersMoveToCategoryKey[];
70
+ propertyMapping: IWebhookConfigurationFoldersMoveToPropertyMapping[];
71
+ }
72
+ export interface IWebhookConfigurationFoldersMoveProperty {
73
+ fromCategoryGuid: string;
74
+ fromCategoryId: string;
75
+ toCategoryMappings: IWebhookConfigurationFoldersMoveToCategoryMapping[];
76
+ }
77
+ export interface IWebhookConfigurationNumRangesTenantCategories {
78
+ id: string;
79
+ name: string;
80
+ }
81
+ export interface IWebhookConfigurationNumRangesTenantProperty {
82
+ enabledCategories: IWebhookConfigurationNumRangesTenantCategories[];
83
+ numberRangePropertyGuid: string;
84
+ numberRangePropertyId: string;
85
+ numberRangePropertyName: string;
86
+ nextValue: number;
87
+ }
88
+ export interface IWebhookConfigurationNumRangesTenant {
89
+ tenantPropertyGuid: string;
90
+ tenantPropertyId: string;
91
+ tenantPropertyName: string;
92
+ tenantPropertyValue: string;
93
+ properties: IWebhookConfigurationNumRangesTenantProperty[];
94
+ }
95
+ export interface IWebhookConfiguration {
96
+ buckets: IWebhookConfigurationBucketProperty[];
97
+ folders: {
98
+ move: IWebhookConfigurationFoldersMoveProperty[];
99
+ };
100
+ numberRanges: {
101
+ tenants: IWebhookConfigurationNumRangesTenant[];
102
+ };
103
+ }
@@ -30,7 +30,7 @@ let runWebHook = async (req) => {
30
30
  webHookResponse.resultMsg += 'Setting number range id ';
31
31
  let property = doc.properties.find((p) => p.id === numberRangeInfo.numberRangePropertyGuid);
32
32
  webHookResponse.resultMsg += 'for \'' + property.name + '\'... ';
33
- if (property.value === null || property.value === "") {
33
+ if (property.value === null || property.value === '') {
34
34
  property.value = numberRangeInfo.nextValue.toString();
35
35
  numberRangeInfo.nextValue += 1;
36
36
  configNeedsUpdate = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yaveon.ecm.d3dwebhooks",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "Utility files for triggered d3d webhooks",
5
5
  "main": "",
6
6
  "scripts": {