integreat 1.4.0 → 1.4.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.
package/README.md
CHANGED
|
@@ -248,9 +248,10 @@ incoming actions, provide an array of `<auth id | true>`, and they will be run
|
|
|
248
248
|
from first to last until one of them returns an ident or an error other than
|
|
249
249
|
`noaccess`.
|
|
250
250
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
> [!NOTE]
|
|
252
|
+
> When connecting to a service for listening, the `outgoing` auth is
|
|
253
|
+
> used. `incoming` is only used for validating the actions being dispatched "back"
|
|
254
|
+
> from the service.
|
|
254
255
|
|
|
255
256
|
In `options`, you may provide options for transporters and adapters. It is
|
|
256
257
|
merged with the `options` object on the endpoint. See
|
|
@@ -280,7 +281,8 @@ one, creating, updating, and the same all over for users. Instead of urls and
|
|
|
280
281
|
http verbs, as for REST, these endpoints will address different databases and
|
|
281
282
|
different database operations (through the transporter).
|
|
282
283
|
|
|
283
|
-
>
|
|
284
|
+
> [!NOTE]
|
|
285
|
+
> This is not to say that Integreat requires you to set up endpoints
|
|
284
286
|
> exactly as described in these examples, it might be that you would like to set
|
|
285
287
|
> up an endpoint that handles many of these cases. The intention here is just to
|
|
286
288
|
> give you an understanding of what an endpoint is in Integreat.
|
|
@@ -403,10 +405,12 @@ An endpoint may specify none or more of the following match properties:
|
|
|
403
405
|
rely on JavaScript definition of 'truthy' here, so any value that is not
|
|
404
406
|
`false`, `null`, `undefined`, `0`, `NaN`, or `''` will be considered truthy.
|
|
405
407
|
|
|
408
|
+
> [!NOTE]
|
|
406
409
|
> There used to be a `filters` property on the endpoint match object. It is
|
|
407
410
|
> still supported, but it's deprecated and will be removed in v1.1. Please use
|
|
408
411
|
> `conditions` instead.
|
|
409
412
|
|
|
413
|
+
> [!NOTE]
|
|
410
414
|
> Editor's note: Describe what incoming actions are, and give more details on
|
|
411
415
|
> filters.
|
|
412
416
|
|
|
@@ -1208,7 +1212,8 @@ page at a time, the following properties may be supported:
|
|
|
1208
1212
|
that this id may hold internal logic from the transporter, but you should
|
|
1209
1213
|
never rely on this logic and simply use it as an id.
|
|
1210
1214
|
|
|
1211
|
-
>
|
|
1215
|
+
> [!IMPORTANT]
|
|
1216
|
+
> Pagination has to be supported by the service and your
|
|
1212
1217
|
> service configuration, and sometimes also the transporter. Integreat prepares
|
|
1213
1218
|
> and passes on these pagination properties, but if the service disregards them,
|
|
1214
1219
|
> there is little Integreat can do – except limiting the number of items
|
|
@@ -1337,6 +1342,7 @@ When you dispatch an action, you will get a response object back in this format:
|
|
|
1337
1342
|
`SYNC` or `RUN`. The action handlers _may_ then provide an array of all the
|
|
1338
1343
|
sub-response objects here.
|
|
1339
1344
|
|
|
1345
|
+
> [!NOTE]
|
|
1340
1346
|
> Editor's note: Is it correct that queues return the id in the data?
|
|
1341
1347
|
|
|
1342
1348
|
When the status is `queued`, the id of the queued action may found in
|
|
@@ -1763,12 +1769,14 @@ to have one set per individual item, you may set `setMember` to `true` on the
|
|
|
1763
1769
|
payload object. (This is almost the same as setting `maxPerSet` to `1`, except
|
|
1764
1770
|
it won't be wrapped in an array.)
|
|
1765
1771
|
|
|
1772
|
+
> [!NOTE]
|
|
1766
1773
|
> There are more options than these, and the documentation will be updated to
|
|
1767
1774
|
> include them later.
|
|
1768
1775
|
|
|
1769
1776
|
#### `EXPIRE`
|
|
1770
1777
|
|
|
1771
|
-
>
|
|
1778
|
+
> [!NOTE]
|
|
1779
|
+
> This action will change before we reach v1.0.
|
|
1772
1780
|
|
|
1773
1781
|
The `EXPIRE` action will `GET` expired data items from a service, and the then
|
|
1774
1782
|
`DELETE` them.
|
|
@@ -1927,6 +1935,7 @@ You may also use queues directly, by dispatching to it as a server and getting
|
|
|
1927
1935
|
incoming actions from its `listen()` method. In that case, it's just as any
|
|
1928
1936
|
other service with no need for any special handling.
|
|
1929
1937
|
|
|
1938
|
+
> [!NOTE]
|
|
1930
1939
|
> Queueing actions are actually done through an action handler, but this handler
|
|
1931
1940
|
> is not available from outside Integreat.
|
|
1932
1941
|
|
|
@@ -68,7 +68,7 @@ async function runAuths(auths, authentication, action) {
|
|
|
68
68
|
}
|
|
69
69
|
export const authenticateCallback = (service, incomingAuth) => async function authenticateFromListen(authentication, action) {
|
|
70
70
|
const endpoint = action
|
|
71
|
-
? await service.endpointFromAction(action)
|
|
71
|
+
? await service.endpointFromAction(action, true)
|
|
72
72
|
: undefined;
|
|
73
73
|
const auths = endpoint?.incomingAuth || incomingAuth;
|
|
74
74
|
if (auths === undefined) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"incoming.js","sourceRoot":"","sources":["../../../src/service/utils/incoming.ts"],"names":[],"mappings":"AACA,OAAO,SAA+B,MAAM,YAAY,CAAA;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACxD,OAAO,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAW5C,MAAM,qBAAqB,GAAG,MAAM,CAAC,uBAAuB,CAAC,CAAA;AAE7D,MAAM,mCAAmC,GAAG,CAC1C,MAAc,EACd,SAAiB,EACT,EAAE,CAAC,CAAC;IACZ,GAAG,MAAM;IACT,OAAO,EAAE;QACP,GAAG,MAAM,CAAC,OAAO;QACjB,aAAa,EAAE,MAAM,CAAC,OAAO,CAAC,aAAa,IAAI,SAAS;KACzD;CACF,CAAC,CAAA;AAEF,MAAM,OAAO,GAAG,CAAC,KAAc,EAAkB,EAAE,CACjD,QAAQ,CAAC,KAAK,CAAC;IACf,CAAC,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ;QAC3B,OAAO,KAAK,CAAC,SAAS,KAAK,QAAQ;QACnC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,IAAI,OAAO,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,QAAQ,CA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,GAAG,MAAM,UAAU,CAC/B,oBAAoB,CAAC,QAAQ,EAAE,WAAW,EAAE,SAAS,CAAC,CACvD,CAAC,gBAAgB,CAAC,CAAA;YACnB,OAAO,CACL,SAAS,CAAC,QAAQ,EAAE,sBAAsB,SAAS,EAAE,CAAC,IAAI;gBACxD,MAAM,EAAE,OAAO;gBACf,MAAM,EAAE,WAAW,SAAS,EAAE;aAC/B,CACF,CAAA;SACF;aAAM;YACL,OAAO;gBACL,MAAM,EAAE,UAAU;gBAClB,KAAK,EAAE,0BAA0B;gBACjC,MAAM,EAAE,WAAW,SAAS,EAAE;aAC/B,CAAA;SACF;IACH,CAAC,CAAC,CAAA;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "integreat",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Node.js integration layer",
|
|
5
5
|
"author": "Kjell-Morten Bratsberg Thorsen <kjellmorten@integreat.io> (https://integreat.io/)",
|
|
6
6
|
"license": "ISC",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"rfdc": "^1.3.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@integreat/ts-dev-setup": "^5.0.
|
|
56
|
+
"@integreat/ts-dev-setup": "^5.0.2",
|
|
57
57
|
"@types/debug": "^4.1.9",
|
|
58
58
|
"@types/luxon": "^3.3.2",
|
|
59
59
|
"@types/sinon": "^10.0.19",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"integreat-adapter-uri": "^1.0.0",
|
|
62
62
|
"integreat-transformers": "^1.0.2",
|
|
63
63
|
"integreat-transporter-http": "1.2.1",
|
|
64
|
-
"nock": "^13.3.
|
|
64
|
+
"nock": "^13.3.4",
|
|
65
65
|
"sinon": "^16.1.0"
|
|
66
66
|
}
|
|
67
67
|
}
|