@toa.io/extensions.exposition 1.0.0-alpha.2 → 1.0.0-alpha.4
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/components/identity.bans/manifest.toa.yaml +1 -0
- package/components/identity.basic/manifest.toa.yaml +1 -0
- package/components/identity.basic/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/manifest.toa.yaml +13 -0
- package/components/identity.federation/operations/authenticate.js +4 -4
- package/components/identity.federation/operations/authenticate.js.map +1 -1
- package/components/identity.federation/operations/create.js +4 -4
- package/components/identity.federation/operations/create.js.map +1 -1
- package/components/identity.federation/operations/{assertions-as-values.cjs → lib/assertions-as-values.js} +1 -1
- package/components/identity.federation/operations/lib/assertions-as-values.js.map +1 -0
- package/components/identity.federation/operations/{jwt.d.cts → lib/jwt.d.ts} +5 -4
- package/components/identity.federation/operations/{jwt.cjs → lib/jwt.js} +35 -11
- package/components/identity.federation/operations/lib/jwt.js.map +1 -0
- package/components/identity.federation/operations/schemas.d.ts +16 -0
- package/components/identity.federation/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/operations/types.d.ts +1 -1
- package/components/identity.federation/source/authenticate.ts +2 -2
- package/components/identity.federation/source/create.ts +2 -2
- package/components/identity.federation/source/{assertions-as-values.cts → lib/assertions-as-values.ts} +1 -2
- package/components/identity.federation/source/lib/jwt.test.ts +56 -0
- package/components/identity.federation/source/{jwt.cts → lib/jwt.ts} +57 -29
- package/components/identity.federation/source/schemas.ts +16 -0
- package/components/identity.federation/source/types.ts +1 -1
- package/components/identity.roles/manifest.toa.yaml +1 -0
- package/components/identity.roles/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.tokens/manifest.toa.yaml +1 -0
- package/components/identity.tokens/operations/tsconfig.tsbuildinfo +1 -1
- package/components/octets.storage/manifest.toa.yaml +1 -0
- package/components/octets.storage/operations/store.js +1 -1
- package/documentation/components.md +12 -5
- package/documentation/identity.md +7 -0
- package/documentation/octets.md +12 -0
- package/documentation/query.md +45 -2
- package/features/body.feature +1 -1
- package/features/errors.feature +1 -1
- package/features/etag.feature +86 -0
- package/features/identity.federation.feature +31 -1
- package/features/octets.entries.feature +1 -1
- package/features/octets.workflows.feature +38 -0
- package/features/steps/Gateway.ts +3 -0
- package/features/steps/IdP.ts +29 -0
- package/features/steps/components/echo/manifest.toa.yaml +1 -0
- package/features/steps/components/greeter/manifest.toa.yaml +1 -0
- package/features/steps/components/octets.tester/manifest.toa.yaml +1 -0
- package/features/steps/components/pots/manifest.toa.yaml +10 -3
- package/features/steps/components/sequences/manifest.toa.yaml +1 -0
- package/features/timing.feature +43 -0
- package/package.json +7 -10
- package/readme.md +7 -6
- package/schemas/annotation.cos.yaml +1 -0
- package/schemas/octets/workflow.cos.yaml +12 -0
- package/schemas/querystring.cos.yaml +1 -0
- package/source/Annotation.ts +1 -0
- package/source/Directive.test.ts +3 -3
- package/source/Directive.ts +11 -11
- package/source/Endpoint.ts +18 -4
- package/source/Factory.ts +8 -4
- package/source/Gateway.ts +55 -42
- package/source/HTTP/Context.ts +67 -0
- package/source/HTTP/Server.test.ts +1 -1
- package/source/HTTP/Server.ts +60 -95
- package/source/HTTP/Timing.ts +40 -0
- package/source/HTTP/index.ts +1 -0
- package/source/HTTP/messages.test.ts +27 -8
- package/source/HTTP/messages.ts +32 -48
- package/source/Mapping.ts +7 -8
- package/source/deployment.ts +6 -0
- package/source/directives/auth/Anonymous.ts +3 -2
- package/source/directives/auth/Authorization.ts +5 -3
- package/source/directives/auth/Incept.ts +11 -6
- package/source/directives/auth/Role.ts +5 -3
- package/source/directives/auth/Scheme.ts +2 -2
- package/source/directives/cache/Cache.ts +2 -2
- package/source/directives/cache/Control.ts +5 -5
- package/source/directives/cache/types.ts +1 -1
- package/source/directives/cors/CORS.ts +5 -3
- package/source/directives/octets/Context.ts +1 -1
- package/source/directives/octets/Delete.ts +21 -11
- package/source/directives/octets/Fetch.ts +29 -14
- package/source/directives/octets/List.ts +14 -6
- package/source/directives/octets/Octets.ts +7 -3
- package/source/directives/octets/Permute.ts +12 -6
- package/source/directives/octets/Store.ts +32 -16
- package/source/directives/octets/Workflow.ts +41 -0
- package/source/directives/octets/schemas.test.ts +21 -0
- package/source/directives/octets/schemas.ts +2 -0
- package/source/directives/octets/{workflow → workflows}/Execution.ts +0 -2
- package/source/directives/octets/{workflow → workflows}/Workflow.ts +2 -2
- package/source/directives/vary/Vary.ts +1 -1
- package/source/directives/vary/embeddings/Header.ts +1 -1
- package/source/directives/vary/embeddings/Language.ts +1 -1
- package/source/io.ts +2 -2
- package/transpiled/Annotation.d.ts +1 -0
- package/transpiled/Directive.d.ts +6 -6
- package/transpiled/Directive.js +8 -8
- package/transpiled/Directive.js.map +1 -1
- package/transpiled/Endpoint.d.ts +3 -3
- package/transpiled/Endpoint.js +34 -1
- package/transpiled/Endpoint.js.map +1 -1
- package/transpiled/Factory.js +4 -2
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Gateway.d.ts +5 -6
- package/transpiled/Gateway.js +38 -32
- package/transpiled/Gateway.js.map +1 -1
- package/transpiled/HTTP/Context.d.ts +24 -0
- package/transpiled/HTTP/Context.js +47 -0
- package/transpiled/HTTP/Context.js.map +1 -0
- package/transpiled/HTTP/Server.d.ts +8 -7
- package/transpiled/HTTP/Server.js +68 -76
- package/transpiled/HTTP/Server.js.map +1 -1
- package/transpiled/HTTP/Timing.d.ts +10 -0
- package/transpiled/HTTP/Timing.js +29 -0
- package/transpiled/HTTP/Timing.js.map +1 -0
- package/transpiled/HTTP/index.d.ts +1 -0
- package/transpiled/HTTP/index.js +1 -0
- package/transpiled/HTTP/index.js.map +1 -1
- package/transpiled/HTTP/messages.d.ts +7 -21
- package/transpiled/HTTP/messages.js +24 -26
- package/transpiled/HTTP/messages.js.map +1 -1
- package/transpiled/Mapping.js +7 -7
- package/transpiled/Mapping.js.map +1 -1
- package/transpiled/deployment.js +5 -0
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/directives/auth/Anonymous.js +3 -4
- package/transpiled/directives/auth/Anonymous.js.map +1 -1
- package/transpiled/directives/auth/Authorization.js +1 -1
- package/transpiled/directives/auth/Authorization.js.map +1 -1
- package/transpiled/directives/auth/Incept.d.ts +1 -1
- package/transpiled/directives/auth/Incept.js +11 -6
- package/transpiled/directives/auth/Incept.js.map +1 -1
- package/transpiled/directives/auth/Role.js +5 -3
- package/transpiled/directives/auth/Role.js.map +1 -1
- package/transpiled/directives/auth/Scheme.js +2 -2
- package/transpiled/directives/auth/Scheme.js.map +1 -1
- package/transpiled/directives/cache/Cache.d.ts +1 -1
- package/transpiled/directives/cache/Cache.js +2 -2
- package/transpiled/directives/cache/Cache.js.map +1 -1
- package/transpiled/directives/cache/Control.d.ts +3 -3
- package/transpiled/directives/cache/Control.js +3 -3
- package/transpiled/directives/cache/Control.js.map +1 -1
- package/transpiled/directives/cache/types.d.ts +1 -1
- package/transpiled/directives/cors/CORS.js +4 -3
- package/transpiled/directives/cors/CORS.js.map +1 -1
- package/transpiled/directives/octets/Context.d.ts +1 -1
- package/transpiled/directives/octets/Context.js.map +1 -1
- package/transpiled/directives/octets/Delete.d.ts +2 -2
- package/transpiled/directives/octets/Delete.js +21 -11
- package/transpiled/directives/octets/Delete.js.map +1 -1
- package/transpiled/directives/octets/Fetch.d.ts +1 -1
- package/transpiled/directives/octets/Fetch.js +28 -14
- package/transpiled/directives/octets/Fetch.js.map +1 -1
- package/transpiled/directives/octets/List.d.ts +1 -1
- package/transpiled/directives/octets/List.js +13 -6
- package/transpiled/directives/octets/List.js.map +1 -1
- package/transpiled/directives/octets/Octets.js +7 -3
- package/transpiled/directives/octets/Octets.js.map +1 -1
- package/transpiled/directives/octets/Permute.d.ts +1 -1
- package/transpiled/directives/octets/Permute.js +11 -6
- package/transpiled/directives/octets/Permute.js.map +1 -1
- package/transpiled/directives/octets/Store.d.ts +3 -2
- package/transpiled/directives/octets/Store.js +19 -11
- package/transpiled/directives/octets/Store.js.map +1 -1
- package/transpiled/directives/octets/Workflow.d.ts +14 -0
- package/transpiled/directives/octets/Workflow.js +52 -0
- package/transpiled/directives/octets/Workflow.js.map +1 -0
- package/transpiled/directives/octets/schemas.d.ts +2 -0
- package/transpiled/directives/octets/schemas.js +2 -1
- package/transpiled/directives/octets/schemas.js.map +1 -1
- package/transpiled/directives/octets/{workflow → workflows}/Execution.js +0 -1
- package/transpiled/directives/octets/workflows/Execution.js.map +1 -0
- package/transpiled/directives/octets/{workflow → workflows}/Workflow.d.ts +1 -1
- package/transpiled/directives/octets/{workflow → workflows}/Workflow.js +2 -2
- package/transpiled/directives/octets/workflows/Workflow.js.map +1 -0
- package/transpiled/directives/octets/workflows/index.js.map +1 -0
- package/transpiled/directives/vary/Vary.js +1 -1
- package/transpiled/directives/vary/embeddings/Header.js +1 -1
- package/transpiled/directives/vary/embeddings/Header.js.map +1 -1
- package/transpiled/directives/vary/embeddings/Language.js +1 -1
- package/transpiled/directives/vary/embeddings/Language.js.map +1 -1
- package/transpiled/io.d.ts +2 -2
- package/transpiled/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/operations/assertions-as-values.cjs.map +0 -1
- package/components/identity.federation/operations/jwt.cjs.map +0 -1
- package/source/HTTP/Server.fixtures.ts +0 -40
- package/transpiled/HTTP/Server.fixtures.d.ts +0 -10
- package/transpiled/HTTP/Server.fixtures.js +0 -31
- package/transpiled/HTTP/Server.fixtures.js.map +0 -1
- package/transpiled/directives/octets/workflow/Execution.js.map +0 -1
- package/transpiled/directives/octets/workflow/Workflow.js.map +0 -1
- package/transpiled/directives/octets/workflow/index.js.map +0 -1
- /package/components/identity.federation/operations/{assertions-as-values.d.cts → lib/assertions-as-values.d.ts} +0 -0
- /package/source/directives/octets/{workflow → workflows}/index.ts +0 -0
- /package/transpiled/directives/octets/{workflow → workflows}/Execution.d.ts +0 -0
- /package/transpiled/directives/octets/{workflow → workflows}/index.d.ts +0 -0
- /package/transpiled/directives/octets/{workflow → workflows}/index.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../source/directives/octets/Store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAAiC;AACjC,qCAA6D;AAC7D,kCAA8B;AAC9B,mDAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../source/directives/octets/Store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,yCAAiC;AACjC,qCAA6D;AAC7D,kCAA8B;AAC9B,mDAAoC;AACpC,2CAAsC;AAWtC,MAAa,KAAK;IACA,QAAQ,GAAG,KAAK,CAAA;IAEf,MAAM,CAAS;IACf,QAAQ,CAAW;IACnB,SAAS,GAAuC,EAAE,CAAA;IAC3D,OAAO,GAAqB,IAAI,CAAA;IAExC,YACC,OAAuB,EAAE,SAA6B,EAAE,OAAgB;QACvE,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAE/B,IAAI,CAAC,MAAM,GAAG,IAAA,iBAAK,EAAC,OAAO,EAAE,MAAM,EACjC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,EAChC,KAAK,EAAE,CAAC,KAAe,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAC3C,SAAS,CAAC,CAAA;QAEZ,IAAI,OAAO,EAAE,QAAQ,KAAK,SAAS;YACjC,IAAI,CAAC,QAAQ,GAAG,IAAI,oBAAQ,CAAC,OAAO,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAA;QAEzD,IAAI,CAAC,SAAS,CAAC,OAAO,GAAG,SAAS,CAAA;QAElC,WAAI,CAAC,WAAW,CAAC,cAAc,CAAC,CAAA;IAClC,CAAC;IAEM,KAAK,CAAC,KAAK,CAAE,OAAe,EAAE,KAAY,EAAE,UAAuB;QACxE,IAAI,CAAC,OAAO,KAAK,MAAM,IAAI,C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{ Unit } from './workflows';
|
|
2
|
+
import type { Directive, Input } from './types';
|
|
3
|
+
import type { Component } from '@toa.io/core';
|
|
4
|
+
import type { Output } from '../../io';
|
|
5
|
+
import type { Remotes } from '../../Remotes';
|
|
6
|
+
import type { Parameter } from '../../RTD';
|
|
7
|
+
export declare class WorkflowDirective implements Directive {
|
|
8
|
+
readonly targeted = true;
|
|
9
|
+
private readonly workflow;
|
|
10
|
+
private readonly discovery;
|
|
11
|
+
private storage;
|
|
12
|
+
constructor(units: Unit[] | Unit, discovery: Promise<Component>, remotes: Remotes);
|
|
13
|
+
apply(storage: string, input: Input, parameters: Parameter[]): Promise<Output>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.WorkflowDirective = void 0;
|
|
27
|
+
const HTTP_1 = require("../../HTTP");
|
|
28
|
+
const schemas = __importStar(require("./schemas"));
|
|
29
|
+
const workflows_1 = require("./workflows");
|
|
30
|
+
class WorkflowDirective {
|
|
31
|
+
targeted = true;
|
|
32
|
+
workflow;
|
|
33
|
+
discovery;
|
|
34
|
+
storage = null;
|
|
35
|
+
constructor(units, discovery, remotes) {
|
|
36
|
+
schemas.workflow.validate(units);
|
|
37
|
+
this.workflow = new workflows_1.Workflow(units, remotes);
|
|
38
|
+
this.discovery = discovery;
|
|
39
|
+
}
|
|
40
|
+
async apply(storage, input, parameters) {
|
|
41
|
+
this.storage ??= await this.discovery;
|
|
42
|
+
const entry = await this.storage.invoke('get', { input: { storage, path: input.request.url } });
|
|
43
|
+
if (entry instanceof Error)
|
|
44
|
+
throw new HTTP_1.NotFound();
|
|
45
|
+
return {
|
|
46
|
+
status: 202,
|
|
47
|
+
body: this.workflow.execute(input, storage, entry, parameters)
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.WorkflowDirective = WorkflowDirective;
|
|
52
|
+
//# sourceMappingURL=Workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Workflow.js","sourceRoot":"","sources":["../../../source/directives/octets/Workflow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAqC;AACrC,mDAAoC;AACpC,2CAAsC;AAUtC,MAAa,iBAAiB;IACZ,QAAQ,GAAG,IAAI,CAAA;IAEd,QAAQ,CAAU;IAClB,SAAS,CAAoB;IACtC,OAAO,GAAqB,IAAI,CAAA;IAExC,YAAoB,KAAoB,EAAE,SAA6B,EAAE,OAAgB;QACvF,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAEhC,IAAI,CAAC,QAAQ,GAAG,IAAI,oBAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAEM,KAAK,CAAC,KAAK,CAAE,OAAe,EAAE,KAAY,EAAE,UAAuB;QACxE,IAAI,CAAC,OAAO,KAAK,MAAM,IAAI,CAAC,SAAS,CAAA;QAErC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAe,KAAK,EACzD,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAElD,IAAI,KAAK,YAAY,KAAK;YACxB,MAAM,IAAI,eAAQ,EAAE,CAAA;QAEtB,OAAO;YACL,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC;SAC/D,CAAA;IACH,CAAC;CACF;AA5BD,8CA4BC"}
|
|
@@ -3,9 +3,11 @@ import type { Permissions as ListPermissions } from './List';
|
|
|
3
3
|
import type { Options as StoreOptions } from './Store';
|
|
4
4
|
import type { Options as DeleteOptions } from './Delete';
|
|
5
5
|
import type { Schema } from '@toa.io/schemas';
|
|
6
|
+
import type { Unit } from './workflows';
|
|
6
7
|
export declare const context: Schema<string>;
|
|
7
8
|
export declare const store: Schema<StoreOptions | null>;
|
|
8
9
|
export declare const fetch: Schema<FetchPermissions | null>;
|
|
9
10
|
export declare const remove: Schema<DeleteOptions | null>;
|
|
10
11
|
export declare const list: Schema<ListPermissions | null>;
|
|
11
12
|
export declare const permute: Schema<null>;
|
|
13
|
+
export declare const workflow: Schema<Unit[] | Unit>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.permute = exports.list = exports.remove = exports.fetch = exports.store = exports.context = void 0;
|
|
6
|
+
exports.workflow = exports.permute = exports.list = exports.remove = exports.fetch = exports.store = exports.context = void 0;
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
8
|
const schemas_1 = __importDefault(require("@toa.io/schemas"));
|
|
9
9
|
const path = (0, node_path_1.resolve)(__dirname, '../../../schemas/octets');
|
|
@@ -14,4 +14,5 @@ exports.fetch = namespace.schema('fetch');
|
|
|
14
14
|
exports.remove = namespace.schema('delete');
|
|
15
15
|
exports.list = namespace.schema('list');
|
|
16
16
|
exports.permute = namespace.schema('permute');
|
|
17
|
+
exports.workflow = namespace.schema('workflow');
|
|
17
18
|
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../source/directives/octets/schemas.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAmC;AACnC,8DAAqC;
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../source/directives/octets/schemas.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAmC;AACnC,8DAAqC;AAQrC,MAAM,IAAI,GAAG,IAAA,mBAAO,EAAC,SAAS,EAAE,yBAAyB,CAAC,CAAA;AAC1D,MAAM,SAAS,GAAG,iBAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AAE5B,QAAA,OAAO,GAAmB,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;AACrD,QAAA,KAAK,GAAgC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AAC9D,QAAA,KAAK,GAAoC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AAClE,QAAA,MAAM,GAAiC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACjE,QAAA,IAAI,GAAmC,SA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G,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAEnE,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAClC,CAAC;CACF;AA7DD,8BA6DC"}
|
|
@@ -7,6 +7,6 @@ export declare class Workflow {
|
|
|
7
7
|
private readonly units;
|
|
8
8
|
private readonly remotes;
|
|
9
9
|
constructor(units: Unit[] | Unit, remotes: Remotes);
|
|
10
|
-
execute(
|
|
10
|
+
execute(input: Input, storage: string, entry: Entry, params: Parameter[]): Execution;
|
|
11
11
|
}
|
|
12
12
|
export type Unit = Record<string, string>;
|
|
@@ -12,8 +12,8 @@ class Workflow {
|
|
|
12
12
|
this.remotes = remotes;
|
|
13
13
|
}
|
|
14
14
|
// eslint-disable-next-line max-params
|
|
15
|
-
execute(
|
|
16
|
-
const path = node_path_1.posix.join(request.
|
|
15
|
+
execute(input, storage, entry, params) {
|
|
16
|
+
const path = node_path_1.posix.join(input.request.url, entry.id);
|
|
17
17
|
const parameters = {};
|
|
18
18
|
for (const { name, value } of params)
|
|
19
19
|
parameters[name] = value;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Workflow.js","sourceRoot":"","sources":["../../../../source/directives/octets/workflows/Workflow.ts"],"names":[],"mappings":";;;AAAA,yCAAiC;AACjC,yCAAiC;AACjC,2CAAuC;AAOvC,MAAa,QAAQ;IACF,KAAK,CAAQ;IACb,OAAO,CAAS;IAEjC,YAAoB,KAAoB,EAAE,OAAgB;QACxD,IAAI,CAAC,KAAK,GAAG,IAAA,iBAAK,EAAS,KAAK,EAC9B,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,EAC/B,MAAM,EAAE,CAAC,IAAU,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;QAEjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,sCAAsC;IAC/B,OAAO,CACb,KAAY,EAAE,OAAe,EAAE,KAAY,EAAE,MAAmB;QAC/D,MAAM,IAAI,GAAG,iBAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;QACpD,MAAM,UAAU,GAA2B,EAAE,CAAA;QAE7C,KAAK,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,MAAM;YAClC,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;QAE1B,MAAM,OAAO,GAAY,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,CAAA;QAE7D,OAAO,IAAI,qBAAS,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACzD,CAAC;CACF;AAzBD,4BAyBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../source/directives/octets/workflows/index.ts"],"names":[],"mappings":";;;AAAA,uCAAgD;AAAvC,oGAAA,QAAQ,OAAA"}
|
|
@@ -14,7 +14,7 @@ class Vary {
|
|
|
14
14
|
}
|
|
15
15
|
preflight(instances, request) {
|
|
16
16
|
/*
|
|
17
|
-
To stop
|
|
17
|
+
To stop constructing `properties` object on each request, Directive Families must be refactored
|
|
18
18
|
from singleton factories to per-Node instances on the Tree.
|
|
19
19
|
*/
|
|
20
20
|
const properties = {};
|
|
@@ -9,7 +9,7 @@ class Header {
|
|
|
9
9
|
cors_1.cors.allowHeader(this.name);
|
|
10
10
|
}
|
|
11
11
|
resolve(input) {
|
|
12
|
-
const value = input.headers[this.name];
|
|
12
|
+
const value = input.request.headers[this.name];
|
|
13
13
|
if (value === undefined)
|
|
14
14
|
return value;
|
|
15
15
|
input.pipelines.response.push((response) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../source/directives/vary/embeddings/Header.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AAIjC,MAAa,MAAM;IACA,IAAI,CAAQ;IAE7B,YAAoB,IAAY;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAEhB,WAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC7B,CAAC;IAEM,OAAO,CAAE,KAAY;QAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../../source/directives/vary/embeddings/Header.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AAIjC,MAAa,MAAM;IACA,IAAI,CAAQ;IAE7B,YAAoB,IAAY;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAEhB,WAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC7B,CAAC;IAEM,OAAO,CAAE,KAAY;QAC1B,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAE9C,IAAI,KAAK,KAAK,SAAS;YACrB,OAAO,KAAK,CAAA;QAEd,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YACzC,QAAQ,CAAC,OAAO,KAAK,IAAI,OAAO,EAAE,CAAA;YAClC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;QAC5C,CAAC,CAAC,CAAA;QAEF,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YACtB,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;;YAEvB,OAAO,KAAK,CAAA;IAChB,CAAC;CACF;AAzBD,wBAyBC"}
|
|
@@ -14,7 +14,7 @@ class Language {
|
|
|
14
14
|
resolve(input, properties) {
|
|
15
15
|
node_assert_1.default.ok(properties.languages !== undefined, 'Supported languages are not defined. Use `vary:languages` directive.');
|
|
16
16
|
node_assert_1.default.ok(properties.languages.length > 0, 'List of supported languages is empty.');
|
|
17
|
-
const negotiator = new negotiator_1.default(input);
|
|
17
|
+
const negotiator = new negotiator_1.default(input.request);
|
|
18
18
|
const language = negotiator.language(properties.languages) ?? properties.languages[0];
|
|
19
19
|
input.pipelines.response.push((response) => {
|
|
20
20
|
response.headers ??= new Headers();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Language.js","sourceRoot":"","sources":["../../../../source/directives/vary/embeddings/Language.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAgC;AAChC,4DAAmC;AACnC,qCAAiC;AAKjC,MAAa,QAAQ;IACnB;QACE,WAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAA;IACrC,CAAC;IAEM,OAAO,CAAE,KAAY,EAAE,UAAsB;QAClD,qBAAM,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAC1C,sEAAsE,CAAC,CAAA;QAEzE,qBAAM,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EACvC,uCAAuC,CAAC,CAAA;QAE1C,MAAM,UAAU,GAAG,IAAI,oBAAU,CAAC,KAAK,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"Language.js","sourceRoot":"","sources":["../../../../source/directives/vary/embeddings/Language.ts"],"names":[],"mappings":";;;;;;AAAA,8DAAgC;AAChC,4DAAmC;AACnC,qCAAiC;AAKjC,MAAa,QAAQ;IACnB;QACE,WAAI,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAA;IACrC,CAAC;IAEM,OAAO,CAAE,KAAY,EAAE,UAAsB;QAClD,qBAAM,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,KAAK,SAAS,EAC1C,sEAAsE,CAAC,CAAA;QAEzE,qBAAM,CAAC,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EACvC,uCAAuC,CAAC,CAAA;QAE1C,MAAM,UAAU,GAAG,IAAI,oBAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;QAChD,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;QAErF,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YACzC,QAAQ,CAAC,OAAO,KAAK,IAAI,OAAO,EAAE,CAAA;YAClC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAA;YAClD,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAA;QACpD,CAAC,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AAvBD,4BAuBC"}
|
package/transpiled/io.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type Input =
|
|
1
|
+
import type { Context, OutgoingMessage } from './HTTP';
|
|
2
|
+
export type Input = Context;
|
|
3
3
|
export type Output = OutgoingMessage | null;
|