@universis/webhooks 1.1.1 → 1.2.0

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/README.md CHANGED
@@ -47,7 +47,7 @@ where `logLevel` can be one of `error`, `warn`, `info`, `verbose`, or `debug` an
47
47
 
48
48
  ## API Endpoints
49
49
 
50
- - `GET /api/webHookActions`: Retrieve a list of available webhook actions. The operation requires `webhooks:read` permission.
50
+ - `GET /api/webhooks/actions`: Retrieve a list of available webhook actions. The operation requires `webhooks:read` permission.
51
51
  - `POST /api/webhooks`: Create a new webhook. The operation requires `webhooks:write` permission.
52
52
  - `GET /api/webhooks`: Retrieve a list of webhooks. The operation requires `webhooks:read` permission.
53
53
  - `GET /api/webhooks/:id`: Retrieve a specific webhook by ID. The operation requires `webhooks:read` permission.
@@ -7,6 +7,7 @@
7
7
  "sealed": false,
8
8
  "abstract": false,
9
9
  "version": "1.1.0",
10
+ "classPath": "@universis/webhooks#WebHook",
10
11
  "fields": [
11
12
  {
12
13
  "@id": "https://universis.io#id",
@@ -3,15 +3,6 @@
3
3
  'scope': [
4
4
  'webhooks:read'],
5
5
 
6
- 'resource': '/api/WebHookActions/?',
7
- 'access': [
8
- 'read']
9
-
10
- },
11
- {
12
- 'scope': [
13
- 'webhooks:read'],
14
-
15
6
  'resource': '/api/WebHooks/?',
16
7
  'access': [
17
8
  'read']
@@ -1 +1 @@
1
- {"version":3,"file":"scope.access.js","names":["WebHookScopeAccessElements","exports"],"sources":["../../src/config/scope.access.js"],"sourcesContent":["const WebHookScopeAccessElements = [\n {\n 'scope': [\n 'webhooks:read',\n ],\n 'resource': '/api/WebHookActions/?',\n 'access': [\n 'read'\n ]\n },\n {\n 'scope': [\n 'webhooks:read',\n ],\n 'resource': '/api/WebHooks/?',\n 'access': [\n 'read'\n ]\n },\n {\n 'scope': [\n 'webhooks:write',\n ],\n 'resource': '/api/WebHooks/?',\n 'access': [\n 'read',\n 'write'\n ]\n }\n];\n\nexport {\n WebHookScopeAccessElements\n}"],"mappings":"uHAAA,MAAMA,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,GAAG;AAC/B;EACI,OAAO,EAAE;EACL,eAAe,CAClB;;EACD,UAAU,EAAE,uBAAuB;EACnC,QAAQ,EAAE;EACN,MAAM;;AAEd,CAAC;AACD;EACI,OAAO,EAAE;EACL,eAAe,CAClB;;EACD,UAAU,EAAE,iBAAiB;EAC7B,QAAQ,EAAE;EACN,MAAM;;AAEd,CAAC;AACD;EACI,OAAO,EAAE;EACL,gBAAgB,CACnB;;EACD,UAAU,EAAE,iBAAiB;EAC7B,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC,CACJ","ignoreList":[]}
1
+ {"version":3,"file":"scope.access.js","names":["WebHookScopeAccessElements","exports"],"sources":["../../src/config/scope.access.js"],"sourcesContent":["const WebHookScopeAccessElements = [\n {\n 'scope': [\n 'webhooks:read',\n ],\n 'resource': '/api/WebHooks/?',\n 'access': [\n 'read'\n ]\n },\n {\n 'scope': [\n 'webhooks:write',\n ],\n 'resource': '/api/WebHooks/?',\n 'access': [\n 'read',\n 'write'\n ]\n }\n];\n\nexport {\n WebHookScopeAccessElements\n}"],"mappings":"uHAAA,MAAMA,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,GAAG;AAC/B;EACI,OAAO,EAAE;EACL,eAAe,CAClB;;EACD,UAAU,EAAE,iBAAiB;EAC7B,QAAQ,EAAE;EACN,MAAM;;AAEd,CAAC;AACD;EACI,OAAO,EAAE;EACL,gBAAgB,CACnB;;EACD,UAAU,EAAE,iBAAiB;EAC7B,QAAQ,EAAE;EACN,MAAM;EACN,OAAO;;AAEf,CAAC,CACJ","ignoreList":[]}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './SchemaLoader';
2
- export * from './WebHookService';
2
+ export * from './WebHookService';
3
+ export * from './models/WebHook';
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", { value: true });var _SchemaLoader = require("./SchemaLoader");Object.keys(_SchemaLoader).forEach(function (key) {if (key === "default" || key === "__esModule") return;if (key in exports && exports[key] === _SchemaLoader[key]) return;Object.defineProperty(exports, key, { enumerable: true, get: function () {return _SchemaLoader[key];} });});
2
2
  var _WebHookService = require("./WebHookService");Object.keys(_WebHookService).forEach(function (key) {if (key === "default" || key === "__esModule") return;if (key in exports && exports[key] === _WebHookService[key]) return;Object.defineProperty(exports, key, { enumerable: true, get: function () {return _WebHookService[key];} });});
3
+ var _WebHook = require("./models/WebHook");Object.keys(_WebHook).forEach(function (key) {if (key === "default" || key === "__esModule") return;if (key in exports && exports[key] === _WebHook[key]) return;Object.defineProperty(exports, key, { enumerable: true, get: function () {return _WebHook[key];} });});
3
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_SchemaLoader","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_WebHookService"],"sources":["../src/index.js"],"sourcesContent":["export * from './SchemaLoader';\nexport * from './WebHookService';"],"mappings":"2EAAA,IAAAA,aAAA,GAAAC,OAAA,mBAAAC,MAAA,CAAAC,IAAA,CAAAH,aAAA,EAAAI,OAAA,WAAAC,GAAA,OAAAA,GAAA,kBAAAA,GAAA,8BAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,aAAA,CAAAK,GAAA,UAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA,IAAAG,UAAA,QAAAC,GAAA,WAAAA,CAAA,UAAAT,aAAA,CAAAK,GAAA;AACA,IAAAK,eAAA,GAAAT,OAAA,qBAAAC,MAAA,CAAAC,IAAA,CAAAO,eAAA,EAAAN,OAAA,WAAAC,GAAA,OAAAA,GAAA,kBAAAA,GAAA,8BAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,eAAA,CAAAL,GAAA,UAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA,IAAAG,UAAA,QAAAC,GAAA,WAAAA,CAAA,UAAAC,eAAA,CAAAL,GAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_SchemaLoader","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_WebHookService","_WebHook"],"sources":["../src/index.js"],"sourcesContent":["export * from './SchemaLoader';\nexport * from './WebHookService';\nexport * from './models/WebHook';"],"mappings":"2EAAA,IAAAA,aAAA,GAAAC,OAAA,mBAAAC,MAAA,CAAAC,IAAA,CAAAH,aAAA,EAAAI,OAAA,WAAAC,GAAA,OAAAA,GAAA,kBAAAA,GAAA,8BAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,aAAA,CAAAK,GAAA,UAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA,IAAAG,UAAA,QAAAC,GAAA,WAAAA,CAAA,UAAAT,aAAA,CAAAK,GAAA;AACA,IAAAK,eAAA,GAAAT,OAAA,qBAAAC,MAAA,CAAAC,IAAA,CAAAO,eAAA,EAAAN,OAAA,WAAAC,GAAA,OAAAA,GAAA,kBAAAA,GAAA,8BAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,eAAA,CAAAL,GAAA,UAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA,IAAAG,UAAA,QAAAC,GAAA,WAAAA,CAAA,UAAAC,eAAA,CAAAL,GAAA;AACA,IAAAM,QAAA,GAAAV,OAAA,qBAAAC,MAAA,CAAAC,IAAA,CAAAQ,QAAA,EAAAP,OAAA,WAAAC,GAAA,OAAAA,GAAA,kBAAAA,GAAA,8BAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,QAAA,CAAAN,GAAA,UAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA,IAAAG,UAAA,QAAAC,GAAA,WAAAA,CAAA,UAAAE,QAAA,CAAAN,GAAA","ignoreList":[]}
@@ -0,0 +1,18 @@
1
+ import {DataContext, DataObject, DataQueryable} from '@themost/data';
2
+
3
+ export declare class WebHook extends DataObject {
4
+
5
+ id?: string;
6
+ additionalType?: string;
7
+ name?: string;
8
+ dateCreated?: Date;
9
+ dateModified?: Date;
10
+ active?: boolean;
11
+ emit?: boolean;
12
+ action?: unknown;
13
+ owner?: unknown;
14
+ createdBy?: unknown;
15
+ modifiedBy?: unknown;
16
+
17
+ static getActions(context: DataContext): DataQueryable;
18
+ }
@@ -0,0 +1,14 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", { value: true });exports.WebHook = void 0;var _data = require("@themost/data");var _dec, _dec2, _class, _class2;function _applyDecoratedDescriptor(i, e, r, n, l) {var a = {};return Object.keys(n).forEach(function (i) {a[i] = n[i];}), a.enumerable = !!a.enumerable, a.configurable = !!a.configurable, ("value" in a || a.initializer) && (a.writable = !0), a = r.slice().reverse().reduce(function (r, n) {return n(i, e, r) || r;}, a), l && void 0 !== a.initializer && (a.value = a.initializer ? a.initializer.call(l) : void 0, a.initializer = void 0), void 0 === a.initializer ? (Object.defineProperty(i, e, a), null) : a;}let
2
+
3
+
4
+ WebHook = exports.WebHook = (_dec = _data.EdmMapping.entityType('WebHook'), _dec2 =
5
+
6
+
7
+
8
+
9
+ _data.EdmMapping.func('Actions', _data.EdmType.CollectionOf('WebHook')), _dec(_class = (_class2 = class WebHook extends _data.DataObject {constructor() {super();}
10
+ static getActions(context) {
11
+ return context.model('WebHookAction').asQueryable();
12
+ }
13
+ }, _applyDecoratedDescriptor(_class2, "getActions", [_dec2], Object.getOwnPropertyDescriptor(_class2, "getActions"), _class2), _class2)) || _class);
14
+ //# sourceMappingURL=WebHook.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebHook.js","names":["_data","require","_dec","_dec2","_class","_class2","_applyDecoratedDescriptor","i","e","r","n","l","a","Object","keys","forEach","enumerable","configurable","initializer","writable","slice","reverse","reduce","value","call","defineProperty","WebHook","exports","EdmMapping","entityType","func","EdmType","CollectionOf","DataObject","constructor","getActions","context","model","asQueryable","getOwnPropertyDescriptor"],"sources":["../../src/models/WebHook.js"],"sourcesContent":["import {DataObject, EdmMapping, EdmType} from '@themost/data';\n\n@EdmMapping.entityType('WebHook')\nclass WebHook extends DataObject {\n constructor() {\n super();\n }\n\n @EdmMapping.func('Actions', EdmType.CollectionOf('WebHook'))\n static getActions(context) {\n return context.model('WebHookAction').asQueryable();\n }\n}\n\nexport {\n WebHook\n}"],"mappings":"oGAAA,IAAAA,KAAA,GAAAC,OAAA,kBAA8D,IAAAC,IAAA,EAAAC,KAAA,EAAAC,MAAA,EAAAC,OAAA,UAAAC,0BAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,EAAAC,CAAA,OAAAC,CAAA,aAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,EAAAK,OAAA,WAAAR,CAAA,GAAAK,CAAA,CAAAL,CAAA,IAAAG,CAAA,CAAAH,CAAA,MAAAK,CAAA,CAAAI,UAAA,KAAAJ,CAAA,CAAAI,UAAA,EAAAJ,CAAA,CAAAK,YAAA,KAAAL,CAAA,CAAAK,YAAA,cAAAL,CAAA,IAAAA,CAAA,CAAAM,WAAA,MAAAN,CAAA,CAAAO,QAAA,QAAAP,CAAA,GAAAH,CAAA,CAAAW,KAAA,GAAAC,OAAA,GAAAC,MAAA,WAAAb,CAAA,EAAAC,CAAA,UAAAA,CAAA,CAAAH,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAA,CAAA,IAAAG,CAAA,GAAAD,CAAA,eAAAC,CAAA,CAAAM,WAAA,KAAAN,CAAA,CAAAW,KAAA,GAAAX,CAAA,CAAAM,WAAA,GAAAN,CAAA,CAAAM,WAAA,CAAAM,IAAA,CAAAb,CAAA,YAAAC,CAAA,CAAAM,WAAA,uBAAAN,CAAA,CAAAM,WAAA,IAAAL,MAAA,CAAAY,cAAA,CAAAlB,CAAA,EAAAC,CAAA,EAAAI,CAAA,WAAAA,CAAA;;;AAGxDc,OAAO,GAAAC,OAAA,CAAAD,OAAA,IAAAxB,IAAA,GADZ0B,gBAAU,CAACC,UAAU,CAAC,SAAS,CAAC,EAAA1B,KAAA;;;;;AAM5ByB,gBAAU,CAACE,IAAI,CAAC,SAAS,EAAGC,aAAO,CAACC,YAAY,CAAC,SAAS,CAAC,CAAC,EAAA9B,IAAA,CAAAE,MAAA,IAAAC,OAAA,GANjE,MACMqB,OAAO,SAASO,gBAAU,CAAC,CAC7BC,WAAWA,CAAA,EAAG,CACV,KAAK,CAAC,CAAC,CACX;EAEA,OACOC,UAAUA,CAACC,OAAO,EAAE;IACvB,OAAOA,OAAO,CAACC,KAAK,CAAC,eAAe,CAAC,CAACC,WAAW,CAAC,CAAC;EACvD;AACJ,CAAC,EAAAhC,yBAAA,CAAAD,OAAA,iBAAAF,KAAA,GAAAU,MAAA,CAAA0B,wBAAA,CAAAlC,OAAA,iBAAAA,OAAA,GAAAA,OAAA,MAAAD,MAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universis/webhooks",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "Universis Webhooks API Library",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -7,6 +7,7 @@
7
7
  "sealed": false,
8
8
  "abstract": false,
9
9
  "version": "1.1.0",
10
+ "classPath": "@universis/webhooks#WebHook",
10
11
  "fields": [
11
12
  {
12
13
  "@id": "https://universis.io#id",
@@ -1,13 +1,4 @@
1
1
  const WebHookScopeAccessElements = [
2
- {
3
- 'scope': [
4
- 'webhooks:read',
5
- ],
6
- 'resource': '/api/WebHookActions/?',
7
- 'access': [
8
- 'read'
9
- ]
10
- },
11
2
  {
12
3
  'scope': [
13
4
  'webhooks:read',
package/src/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './SchemaLoader';
2
- export * from './WebHookService';
2
+ export * from './WebHookService';
3
+ export * from './models/WebHook';
package/src/index.js CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './SchemaLoader';
2
- export * from './WebHookService';
2
+ export * from './WebHookService';
3
+ export * from './models/WebHook';
@@ -0,0 +1,18 @@
1
+ import {DataContext, DataObject, DataQueryable} from '@themost/data';
2
+
3
+ export declare class WebHook extends DataObject {
4
+
5
+ id?: string;
6
+ additionalType?: string;
7
+ name?: string;
8
+ dateCreated?: Date;
9
+ dateModified?: Date;
10
+ active?: boolean;
11
+ emit?: boolean;
12
+ action?: unknown;
13
+ owner?: unknown;
14
+ createdBy?: unknown;
15
+ modifiedBy?: unknown;
16
+
17
+ static getActions(context: DataContext): DataQueryable;
18
+ }
@@ -0,0 +1,17 @@
1
+ import {DataObject, EdmMapping, EdmType} from '@themost/data';
2
+
3
+ @EdmMapping.entityType('WebHook')
4
+ class WebHook extends DataObject {
5
+ constructor() {
6
+ super();
7
+ }
8
+
9
+ @EdmMapping.func('Actions', EdmType.CollectionOf('WebHook'))
10
+ static getActions(context) {
11
+ return context.model('WebHookAction').asQueryable();
12
+ }
13
+ }
14
+
15
+ export {
16
+ WebHook
17
+ }