@toa.io/extensions.exposition 1.0.0-alpha.6 → 1.0.0-alpha.8

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.
Files changed (55) hide show
  1. package/components/identity.basic/manifest.toa.yaml +2 -0
  2. package/components/identity.roles/manifest.toa.yaml +3 -1
  3. package/features/body.feature +1 -0
  4. package/features/identity.basic.feature +12 -0
  5. package/features/steps/Database.ts +1 -1
  6. package/features/timing.feature +23 -0
  7. package/package.json +7 -7
  8. package/source/Gateway.ts +4 -4
  9. package/source/HTTP/messages.ts +1 -1
  10. package/source/directives/octets/Context.ts +4 -3
  11. package/source/directives/octets/Delete.ts +4 -2
  12. package/source/directives/octets/Directive.ts +10 -0
  13. package/source/directives/octets/Fetch.ts +4 -3
  14. package/source/directives/octets/List.ts +4 -2
  15. package/source/directives/octets/Octets.ts +3 -2
  16. package/source/directives/octets/Permute.ts +4 -3
  17. package/source/directives/octets/Store.ts +4 -2
  18. package/source/directives/octets/Workflow.ts +10 -3
  19. package/source/directives/octets/types.ts +0 -7
  20. package/source/exceptions.ts +15 -9
  21. package/transpiled/Gateway.js +4 -4
  22. package/transpiled/Gateway.js.map +1 -1
  23. package/transpiled/HTTP/messages.js +1 -1
  24. package/transpiled/HTTP/messages.js.map +1 -1
  25. package/transpiled/directives/octets/Context.d.ts +3 -3
  26. package/transpiled/directives/octets/Context.js +4 -2
  27. package/transpiled/directives/octets/Context.js.map +1 -1
  28. package/transpiled/directives/octets/Delete.d.ts +3 -2
  29. package/transpiled/directives/octets/Delete.js +3 -1
  30. package/transpiled/directives/octets/Delete.js.map +1 -1
  31. package/transpiled/directives/octets/Directive.d.ts +8 -0
  32. package/transpiled/directives/octets/Directive.js +8 -0
  33. package/transpiled/directives/octets/Directive.js.map +1 -0
  34. package/transpiled/directives/octets/Fetch.d.ts +3 -2
  35. package/transpiled/directives/octets/Fetch.js +3 -1
  36. package/transpiled/directives/octets/Fetch.js.map +1 -1
  37. package/transpiled/directives/octets/List.d.ts +3 -2
  38. package/transpiled/directives/octets/List.js +3 -1
  39. package/transpiled/directives/octets/List.js.map +1 -1
  40. package/transpiled/directives/octets/Octets.d.ts +2 -1
  41. package/transpiled/directives/octets/Octets.js +1 -1
  42. package/transpiled/directives/octets/Octets.js.map +1 -1
  43. package/transpiled/directives/octets/Permute.d.ts +3 -2
  44. package/transpiled/directives/octets/Permute.js +3 -1
  45. package/transpiled/directives/octets/Permute.js.map +1 -1
  46. package/transpiled/directives/octets/Store.d.ts +3 -2
  47. package/transpiled/directives/octets/Store.js +3 -1
  48. package/transpiled/directives/octets/Store.js.map +1 -1
  49. package/transpiled/directives/octets/Workflow.d.ts +3 -2
  50. package/transpiled/directives/octets/Workflow.js +9 -2
  51. package/transpiled/directives/octets/Workflow.js.map +1 -1
  52. package/transpiled/directives/octets/types.d.ts +0 -5
  53. package/transpiled/exceptions.js +9 -7
  54. package/transpiled/exceptions.js.map +1 -1
  55. package/transpiled/tsconfig.tsbuildinfo +1 -1
@@ -6,6 +6,8 @@ entity:
6
6
  schema:
7
7
  username*: string
8
8
  password*: string
9
+ unique:
10
+ username: [username]
9
11
  dependent: true
10
12
 
11
13
  operations:
@@ -26,7 +26,9 @@ exposition:
26
26
  isolated: true
27
27
  /:identity:
28
28
  auth:role: system:identity:roles
29
- POST: transit
29
+ POST:
30
+ io:output: [id]
31
+ endpoint: transit
30
32
  GET:
31
33
  io:output: true
32
34
  auth:id: identity
@@ -5,6 +5,7 @@ Feature: Request body
5
5
  """yaml
6
6
  exposition:
7
7
  /:
8
+ io:output: true
8
9
  POST: create
9
10
  """
10
11
  When the following request is received:
@@ -16,6 +16,18 @@ Feature: Basic authentication
16
16
  """
17
17
  201 Created
18
18
  """
19
+ When the following request is received:
20
+ """
21
+ POST /identity/basic/ HTTP/1.1
22
+ content-type: application/yaml
23
+
24
+ username: developer
25
+ password: secret#1234
26
+ """
27
+ Then the following reply is sent:
28
+ """
29
+ 409 Conflict
30
+ """
19
31
 
20
32
  Scenario: Creating new Identity using inception
21
33
  Given the `users` is running with the following manifest:
@@ -1,6 +1,6 @@
1
1
  import { afterAll, beforeAll, binding, given } from 'cucumber-tsflow'
2
- import { type DataTable } from '@cucumber/cucumber'
3
2
  import { MongoClient } from 'mongodb'
3
+ import type { DataTable } from '@cucumber/cucumber'
4
4
 
5
5
  @binding()
6
6
  export class Database {
@@ -41,3 +41,26 @@ Feature: Server timing
41
41
  201 Created
42
42
  server-timing:
43
43
  """
44
+
45
+ Scenario: Octets timing
46
+ Given the annotation:
47
+ """yaml
48
+ trace: true
49
+ /:
50
+ io:output: true
51
+ auth:anonymous: true
52
+ octets:context: octets
53
+ POST:
54
+ octets:store: ~
55
+ """
56
+ When the stream of `lenna.png` is received with the following headers:
57
+ """
58
+ POST / HTTP/1.1
59
+ content-type: application/octet-stream
60
+ """
61
+ # to debug, break it and look at the console
62
+ Then the following reply is sent:
63
+ """
64
+ 201 Created
65
+ server-timing:
66
+ """
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@toa.io/extensions.exposition",
3
- "version": "1.0.0-alpha.6",
3
+ "version": "1.0.0-alpha.8",
4
4
  "description": "Toa Exposition",
5
5
  "author": "temich <tema.gurtovoy@gmail.com>",
6
6
  "homepage": "https://github.com/toa-io/toa#readme",
@@ -17,9 +17,9 @@
17
17
  "access": "public"
18
18
  },
19
19
  "dependencies": {
20
- "@toa.io/core": "1.0.0-alpha.6",
21
- "@toa.io/generic": "1.0.0-alpha.6",
22
- "@toa.io/schemas": "1.0.0-alpha.6",
20
+ "@toa.io/core": "1.0.0-alpha.8",
21
+ "@toa.io/generic": "1.0.0-alpha.8",
22
+ "@toa.io/schemas": "1.0.0-alpha.8",
23
23
  "bcryptjs": "2.4.3",
24
24
  "error-value": "0.3.0",
25
25
  "js-yaml": "4.1.0",
@@ -43,11 +43,11 @@
43
43
  "features": "cucumber-js"
44
44
  },
45
45
  "devDependencies": {
46
- "@toa.io/agent": "1.0.0-alpha.6",
47
- "@toa.io/extensions.storages": "1.0.0-alpha.6",
46
+ "@toa.io/agent": "1.0.0-alpha.8",
47
+ "@toa.io/extensions.storages": "1.0.0-alpha.8",
48
48
  "@types/bcryptjs": "2.4.3",
49
49
  "@types/cors": "2.8.13",
50
50
  "@types/negotiator": "0.6.1"
51
51
  },
52
- "gitHead": "f28d629a9477646e267a8af8479cc1bb10d62c80"
52
+ "gitHead": "2ee18835c8214600e1d354251fa632913bff38c3"
53
53
  }
package/source/Gateway.ts CHANGED
@@ -22,7 +22,7 @@ export class Gateway extends Connector {
22
22
  }
23
23
 
24
24
  public async process (context: http.Context): Promise<http.OutgoingMessage> {
25
- const interception = await context.timing.capture('gate:intercept',
25
+ const interception = await context.timing.capture('intercept',
26
26
  this.interceptor.intercept(context))
27
27
 
28
28
  if (interception !== null)
@@ -43,13 +43,13 @@ export class Gateway extends Connector {
43
43
 
44
44
  const method = node.methods[context.request.method]
45
45
 
46
- const interruption = await context.timing.capture('gate:preflight',
46
+ const interruption = await context.timing.capture('preflight',
47
47
  method.directives.preflight(context, parameters))
48
48
 
49
49
  const response = interruption ??
50
- await context.timing.capture('gate:call', this.call(method, context, parameters))
50
+ await context.timing.capture('call', this.call(method, context, parameters))
51
51
 
52
- await context.timing.capture('gate:settle', method.directives.settle(context, response))
52
+ await context.timing.capture('settle', method.directives.settle(context, response))
53
53
 
54
54
  return response
55
55
  }
@@ -29,7 +29,7 @@ export async function read (context: Context): Promise<any> {
29
29
  throw new UnsupportedMediaType()
30
30
 
31
31
  const format = formats[type]
32
- const buf = await context.timing.capture('req:buffer', buffer(context.request))
32
+ const buf = await context.timing.capture('buffer', buffer(context.request))
33
33
 
34
34
  try {
35
35
  return format.decode(buf)
@@ -1,18 +1,19 @@
1
1
  import * as schemas from './schemas'
2
+ import { Directive } from './Directive'
2
3
  import type { Output } from '../../io'
3
- import type { Directive } from './types'
4
4
 
5
- export class Context implements Directive {
5
+ export class Context extends Directive {
6
6
  public readonly targeted = false
7
7
  public readonly storage: string
8
8
 
9
9
  public constructor (value: unknown) {
10
+ super()
10
11
  schemas.context.validate(value)
11
12
 
12
13
  this.storage = value
13
14
  }
14
15
 
15
- public apply (): Output {
16
+ public async apply (): Promise<Output> {
16
17
  return null
17
18
  }
18
19
  }
@@ -2,16 +2,17 @@ import { Readable } from 'stream'
2
2
  import { NotFound } from '../../HTTP'
3
3
  import * as schemas from './schemas'
4
4
  import { Workflow } from './workflows'
5
+ import { Directive } from './Directive'
5
6
  import type { Parameter } from '../../RTD'
6
7
  import type { Unit } from './workflows'
7
8
  import type { Maybe } from '@toa.io/types'
8
9
  import type { Component } from '@toa.io/core'
9
10
  import type { Output } from '../../io'
10
- import type { Directive, Input } from './types'
11
+ import type { Input } from './types'
11
12
  import type { Remotes } from '../../Remotes'
12
13
  import type { Entry } from '@toa.io/extensions.storages'
13
14
 
14
- export class Delete implements Directive {
15
+ export class Delete extends Directive {
15
16
  public readonly targeted = true
16
17
 
17
18
  private readonly workflow?: Workflow
@@ -19,6 +20,7 @@ export class Delete implements Directive {
19
20
  private storage: Component | null = null
20
21
 
21
22
  public constructor (options: Options | null, discovery: Promise<Component>, remotes: Remotes) {
23
+ super()
22
24
  schemas.remove.validate(options)
23
25
 
24
26
  if (options?.workflow !== undefined)
@@ -0,0 +1,10 @@
1
+ import type { Input } from './types'
2
+ import type { Parameter } from '../../RTD'
3
+ import type * as io from '../../io'
4
+
5
+ export abstract class Directive {
6
+ public readonly name = 'octets.' + this.constructor.name.toLowerCase()
7
+ public abstract readonly targeted: boolean
8
+
9
+ public abstract apply (storage: string, input: Input, parameters: Parameter[]): Promise<io.Output>
10
+ }
@@ -1,15 +1,15 @@
1
1
  import { posix } from 'node:path'
2
2
  import { Forbidden, NotFound } from '../../HTTP'
3
3
  import * as schemas from './schemas'
4
+ import { Directive } from './Directive'
4
5
  import type { Maybe } from '@toa.io/types'
5
6
  import type { Entry } from '@toa.io/extensions.storages'
6
7
  import type { Readable } from 'node:stream'
7
8
  import type { Component } from '@toa.io/core'
8
9
  import type { Output } from '../../io'
10
+ import type { Input } from './types'
9
11
 
10
- import type { Directive, Input } from './types'
11
-
12
- export class Fetch implements Directive {
12
+ export class Fetch extends Directive {
13
13
  public readonly targeted = true
14
14
 
15
15
  private readonly permissions: Required<Permissions> = {
@@ -21,6 +21,7 @@ export class Fetch implements Directive {
21
21
  private storage: Component = null as unknown as Component
22
22
 
23
23
  public constructor (permissions: Permissions | null, discovery: Promise<Component>) {
24
+ super()
24
25
  schemas.fetch.validate(permissions)
25
26
 
26
27
  Object.assign(this.permissions, permissions)
@@ -1,14 +1,15 @@
1
1
  import { posix } from 'node:path'
2
2
  import { Forbidden, NotFound } from '../../HTTP'
3
3
  import * as schemas from './schemas'
4
+ import { Directive } from './Directive'
4
5
  import type { Entry } from '@toa.io/extensions.storages'
5
6
  import type { Maybe } from '@toa.io/types'
6
7
  import type { Component } from '@toa.io/core'
7
8
  import type { Output } from '../../io'
8
9
 
9
- import type { Directive, Input } from './types'
10
+ import type { Input } from './types'
10
11
 
11
- export class List implements Directive {
12
+ export class List extends Directive {
12
13
  public readonly targeted = false
13
14
 
14
15
  private readonly permissions: Required<Permissions> = { meta: false }
@@ -16,6 +17,7 @@ export class List implements Directive {
16
17
  private storage: Component | null = null
17
18
 
18
19
  public constructor (permissions: Permissions | null, discovery: Promise<Component>) {
20
+ super()
19
21
  schemas.list.validate(permissions)
20
22
 
21
23
  Object.assign(this.permissions, permissions)
@@ -6,11 +6,12 @@ import { List } from './List'
6
6
  import { Delete } from './Delete'
7
7
  import { Permute } from './Permute'
8
8
  import { WorkflowDirective } from './Workflow'
9
+ import type { Directive } from './Directive'
9
10
  import type { Output } from '../../io'
10
11
  import type { Component } from '@toa.io/core'
11
12
  import type { Remotes } from '../../Remotes'
12
13
  import type { Parameter, DirectiveFamily } from '../../RTD'
13
- import type { Directive, Input } from './types'
14
+ import type { Input } from './types'
14
15
 
15
16
  export class Octets implements DirectiveFamily<Directive> {
16
17
  public readonly name: string = 'octets'
@@ -55,7 +56,7 @@ export class Octets implements DirectiveFamily<Directive> {
55
56
  throw new NotFound(`Trailing slash is ${action.targeted ? 'redundant' : 'required'}.`)
56
57
 
57
58
  // noinspection JSObjectNullOrUndefined
58
- return action.apply(context.storage, input, parameters)
59
+ return await input.timing.capture(action.name, action.apply(context.storage, input, parameters))
59
60
  }
60
61
  }
61
62
 
@@ -1,18 +1,19 @@
1
1
  import { NotAcceptable, NotFound } from '../../HTTP'
2
2
  import * as schemas from './schemas'
3
+ import { Directive } from './Directive'
3
4
  import type { Maybe } from '@toa.io/types'
4
5
  import type { Component } from '@toa.io/core'
5
6
  import type { Output } from '../../io'
7
+ import type { Input } from './types'
6
8
 
7
- import type { Directive, Input } from './types'
8
-
9
- export class Permute implements Directive {
9
+ export class Permute extends Directive {
10
10
  public readonly targeted = false
11
11
 
12
12
  private readonly discovery: Promise<Component>
13
13
  private storage: Component | null = null
14
14
 
15
15
  public constructor (value: null, discovery: Promise<Component>) {
16
+ super()
16
17
  schemas.permute.validate(value)
17
18
 
18
19
  this.discovery = discovery
@@ -4,6 +4,7 @@ import { BadRequest, UnsupportedMediaType } from '../../HTTP'
4
4
  import { cors } from '../cors'
5
5
  import * as schemas from './schemas'
6
6
  import { Workflow } from './workflows'
7
+ import { Directive } from './Directive'
7
8
  import type { Readable } from 'stream'
8
9
  import type { Parameter } from '../../RTD'
9
10
  import type { Unit } from './workflows'
@@ -12,9 +13,9 @@ import type { Remotes } from '../../Remotes'
12
13
  import type { ErrorType } from 'error-value'
13
14
  import type { Component } from '@toa.io/core'
14
15
  import type { Output } from '../../io'
15
- import type { Directive, Input } from './types'
16
+ import type { Input } from './types'
16
17
 
17
- export class Store implements Directive {
18
+ export class Store extends Directive {
18
19
  public readonly targeted = false
19
20
 
20
21
  private readonly accept?: string
@@ -24,6 +25,7 @@ export class Store implements Directive {
24
25
 
25
26
  public constructor
26
27
  (options: Options | null, discovery: Promise<Component>, remotes: Remotes) {
28
+ super()
27
29
  schemas.store.validate(options)
28
30
 
29
31
  this.accept = match(options?.accept,
@@ -1,8 +1,9 @@
1
1
  import { NotFound } from '../../HTTP'
2
2
  import * as schemas from './schemas'
3
3
  import { Workflow } from './workflows'
4
+ import { Directive } from './Directive'
4
5
  import type { Unit } from './workflows'
5
- import type { Directive, Input } from './types'
6
+ import type { Input } from './types'
6
7
  import type { Component } from '@toa.io/core'
7
8
  import type { Output } from '../../io'
8
9
  import type { Remotes } from '../../Remotes'
@@ -10,7 +11,7 @@ import type { Maybe } from '@toa.io/types'
10
11
  import type { Entry } from '@toa.io/extensions.storages'
11
12
  import type { Parameter } from '../../RTD'
12
13
 
13
- export class WorkflowDirective implements Directive {
14
+ export class WorkflowDirective extends Directive {
14
15
  public readonly targeted = true
15
16
 
16
17
  private readonly workflow: Workflow
@@ -18,6 +19,7 @@ export class WorkflowDirective implements Directive {
18
19
  private storage: Component | null = null
19
20
 
20
21
  public constructor (units: Unit[] | Unit, discovery: Promise<Component>, remotes: Remotes) {
22
+ super()
21
23
  schemas.workflow.validate(units)
22
24
 
23
25
  this.workflow = new Workflow(units, remotes)
@@ -28,7 +30,12 @@ export class WorkflowDirective implements Directive {
28
30
  this.storage ??= await this.discovery
29
31
 
30
32
  const entry = await this.storage.invoke<Maybe<Entry>>('get',
31
- { input: { storage, path: input.request.url } })
33
+ {
34
+ input: {
35
+ storage,
36
+ path: input.request.url
37
+ }
38
+ })
32
39
 
33
40
  if (entry instanceof Error)
34
41
  throw new NotFound()
@@ -1,12 +1,5 @@
1
- import type { Parameter } from '../../RTD'
2
1
  import type * as io from '../../io'
3
2
 
4
- export interface Directive {
5
- readonly targeted: boolean
6
-
7
- apply: (storage: string, input: Input, parameters: Parameter[]) => io.Output | Promise<io.Output>
8
- }
9
-
10
3
  export interface Extension {
11
4
  octets?: string
12
5
  }
@@ -1,17 +1,23 @@
1
1
  import { type Exception } from '@toa.io/core'
2
+ import { match } from 'matchacho'
2
3
  import * as http from './HTTP'
3
4
 
4
5
  export function rethrow (exception: Exception): void {
5
6
  // see /runtime/core/src/exceptions.js
6
7
 
7
- if ((exception.code >= 200 && exception.code < 210) || exception.code === 221)
8
- throw new http.BadRequest(exception.message)
9
-
10
- if (exception.code === 302)
11
- throw new http.NotFound()
12
-
13
- if (exception.code === 303)
14
- throw new http.PreconditionFailed()
8
+ throw match<Error>(exception.code,
9
+ badRequest(exception), () => new http.BadRequest(exception.message),
10
+ 302, NOT_FOUND,
11
+ 303, PRECONDITION_FAILED,
12
+ 306, () => new http.Conflict(exception.message),
13
+ () => exception)
14
+ }
15
15
 
16
- throw exception as unknown as Error
16
+ function badRequest (exception: Exception) {
17
+ return (code: number): boolean => {
18
+ return (exception.code >= 200 && exception.code < 210) || exception.code === 221
19
+ }
17
20
  }
21
+
22
+ const NOT_FOUND = new http.NotFound()
23
+ const PRECONDITION_FAILED = new http.PreconditionFailed()
@@ -39,7 +39,7 @@ class Gateway extends core_1.Connector {
39
39
  this.depends(broadcast);
40
40
  }
41
41
  async process(context) {
42
- const interception = await context.timing.capture('gate:intercept', this.interceptor.intercept(context));
42
+ const interception = await context.timing.capture('intercept', this.interceptor.intercept(context));
43
43
  if (interception !== null)
44
44
  return interception;
45
45
  const match = this.tree.match(context.url.pathname);
@@ -49,10 +49,10 @@ class Gateway extends core_1.Connector {
49
49
  if (!(context.request.method in node.methods))
50
50
  throw new http.MethodNotAllowed();
51
51
  const method = node.methods[context.request.method];
52
- const interruption = await context.timing.capture('gate:preflight', method.directives.preflight(context, parameters));
52
+ const interruption = await context.timing.capture('preflight', method.directives.preflight(context, parameters));
53
53
  const response = interruption ??
54
- await context.timing.capture('gate:call', this.call(method, context, parameters));
55
- await context.timing.capture('gate:settle', method.directives.settle(context, response));
54
+ await context.timing.capture('call', this.call(method, context, parameters));
55
+ await context.timing.capture('settle', method.directives.settle(context, response));
56
56
  return response;
57
57
  }
58
58
  async open() {
@@ -1 +1 @@
1
- {"version":3,"file":"Gateway.js","sourceRoot":"","sources":["../source/Gateway.ts"],"names":[],"m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
24
  throw new exceptions_1.UnsupportedMediaType();
25
25
  const format = formats_1.formats[type];
26
- const buf = await context.timing.capture('req:buffer', (0, consumers_1.buffer)(context.request));
26
+ const buf = await context.timing.capture('buffer', (0, consumers_1.buffer)(context.request));
27
27
  try {
28
28
  return format.decode(buf);
29
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"messages.js","sourceRoot":"","sources":["../../source/HTTP/messages.ts"],"names":[],"mappings":";;;AAAA,6CAAsC;AACtC,qDAA8C;AAC9C,uCAAmC;AACnC,6CAA8E;AAI9E,SAAgB,KAAK,CACpB,OAAgB,EAAE,QAA6B,EAAE,OAAwB;IACxE,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,QAAQ;QAChD,SAAS,CAAC,OAAO,CAAC,CAAA;IAEpB,OAAO,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAA;IACxE,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;IAE/B,IAAI,OAAO,CAAC,IAAI,YAAY,sBAAQ;QAClC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;;QAElC,IAAI,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAA;AACpC,CAAC;AAZD,sBAYC;AAEM,KAAK,UAAU,IAAI,CAAE,OAAgB;IAC1C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;IAEpD,IAAI,IAAI,KAAK,SAAS;QACpB,OAAO,SAAS,CAAA;IAElB,IAAI,CAAC,CAAC,IAAI,IAAI,iBAAO,CAAC;QACpB,MAAM,IAAI,iCAAoB,EAAE,CAAA;IAElC,MAAM,MAAM,GAAG,iBAAO,CAAC,IAAI,CAAC,CAAA;IAC5B,MAAM,GAAG,GAA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SACT,GAAG,CAAC,CAAC,IAAa,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;SACxE,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;SACvC,IAAI,CAAC,QAAQ,CAAC,CAAA;AACnB,CAAC;AAED,MAAM,QAAQ,GAAG,KAAK,CAAA;AACtB,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,MAAM,CAAC,CAAA;AAC5C,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;AAChC,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,CAAA"}
@@ -1,8 +1,8 @@
1
+ import { Directive } from './Directive';
1
2
  import type { Output } from '../../io';
2
- import type { Directive } from './types';
3
- export declare class Context implements Directive {
3
+ export declare class Context extends Directive {
4
4
  readonly targeted = false;
5
5
  readonly storage: string;
6
6
  constructor(value: unknown);
7
- apply(): Output;
7
+ apply(): Promise<Output>;
8
8
  }
@@ -25,14 +25,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.Context = void 0;
27
27
  const schemas = __importStar(require("./schemas"));
28
- class Context {
28
+ const Directive_1 = require("./Directive");
29
+ class Context extends Directive_1.Directive {
29
30
  targeted = false;
30
31
  storage;
31
32
  constructor(value) {
33
+ super();
32
34
  schemas.context.validate(value);
33
35
  this.storage = value;
34
36
  }
35
- apply() {
37
+ async apply() {
36
38
  return null;
37
39
  }
38
40
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../source/directives/octets/Context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAoC;AAIpC,MAAa,OAAO;IACF,QAAQ,GAAG,KAAK,CAAA;IAChB,OAAO,CAAQ;IAE/B,YAAoB,KAAc;QAChC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAE/B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;IACtB,CAAC;IAEM,KAAK;QACV,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAbD,0BAaC"}
1
+ {"version":3,"file":"Context.js","sourceRoot":"","sources":["../../../source/directives/octets/Context.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAoC;AACpC,2CAAuC;AAGvC,MAAa,OAAQ,SAAQ,qBAAS;IACpB,QAAQ,GAAG,KAAK,CAAA;IAChB,OAAO,CAAQ;IAE/B,YAAoB,KAAc;QAChC,KAAK,EAAE,CAAA;QACP,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAE/B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAA;IACtB,CAAC;IAEM,KAAK,CAAC,KAAK;QAChB,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AAdD,0BAcC"}
@@ -1,10 +1,11 @@
1
+ import { Directive } from './Directive';
1
2
  import type { Parameter } from '../../RTD';
2
3
  import type { Unit } from './workflows';
3
4
  import type { Component } from '@toa.io/core';
4
5
  import type { Output } from '../../io';
5
- import type { Directive, Input } from './types';
6
+ import type { Input } from './types';
6
7
  import type { Remotes } from '../../Remotes';
7
- export declare class Delete implements Directive {
8
+ export declare class Delete extends Directive {
8
9
  readonly targeted = true;
9
10
  private readonly workflow?;
10
11
  private readonly discovery;
@@ -28,12 +28,14 @@ const stream_1 = require("stream");
28
28
  const HTTP_1 = require("../../HTTP");
29
29
  const schemas = __importStar(require("./schemas"));
30
30
  const workflows_1 = require("./workflows");
31
- class Delete {
31
+ const Directive_1 = require("./Directive");
32
+ class Delete extends Directive_1.Directive {
32
33
  targeted = true;
33
34
  workflow;
34
35
  discovery;
35
36
  storage = null;
36
37
  constructor(options, discovery, remotes) {
38
+ super();
37
39
  schemas.remove.validate(options);
38
40
  if (options?.workflow !== undefined)
39
41
  this.workflow = new workflows_1.Workflow(options.workflow, remotes);
@@ -1 +1 @@
1
- {"version":3,"file":"Delete.js","sourceRoot":"","sources":["../../../source/directives/octets/Delete.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAiC;AACjC,qCAAqC;AACrC,mDAAoC;AACpC,2CAAsC;AAUtC,MAAa,MAAM;IACD,QAAQ,GAAG,IAAI,CAAA;IAEd,QAAQ,CAAW;IACnB,SAAS,CAAoB;IACtC,OAAO,GAAqB,IAAI,CAAA;IAExC,YAAoB,OAAuB,EAAE,SAA6B,EAAE,OAAgB;QAC1F,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAEhC,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,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;YACE,KAAK,EAAE;gBACL,OAAO;gBACP,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG;aACxB;SACF,CAAC,CAAA;QAEJ,IAAI,KAAK,YAAY,KAAK;YACxB,MAAM,IAAI,eAAQ,EAAE,CAAA;QAEtB,MAAM,MAAM,GAAW,EAAE,CAAA;QAEzB,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAChC,MAAM,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;QACpE,MAAM,IAAI,CAAC,OAAQ,CAAC,MAAM,CAAC,QAAQ,EACjC;YACE,KAAK,EAAE;gBACL,OAAO;gBACP,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG;aACxB;SACF,CAAC,CAAA;IACN,CAAC;IAED,sCAAsC;IAC9B,KAAK,CAAC,CAAE,OAAO,CACtB,KAAY,EAAE,OAAe,EAAE,KAAY,EAAE,UAAuB;QACnE,oEAAoE;QACpE,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,IAAI,CAAC,QAAS,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC;YACpF,MAAM,KAAK,CAAA;YAEX,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK;gBACjE,OAAM;QACV,CAAC;QAED,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IACnC,CAAC;CACF;AAlED,wBAkEC"}
@@ -0,0 +1,8 @@
1
+ import type { Input } from './types';
2
+ import type { Parameter } from '../../RTD';
3
+ import type * as io from '../../io';
4
+ export declare abstract class Directive {
5
+ readonly name: string;
6
+ abstract readonly targeted: boolean;
7
+ abstract apply(storage: string, input: Input, parameters: Parameter[]): Promise<io.Output>;
8
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Directive = void 0;
4
+ class Directive {
5
+ name = 'octets.' + this.constructor.name.toLowerCase();
6
+ }
7
+ exports.Directive = Directive;
8
+ //# sourceMappingURL=Directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Directive.js","sourceRoot":"","sources":["../../../source/directives/octets/Directive.ts"],"names":[],"mappings":";;;AAIA,MAAsB,SAAS;IACb,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,CAAA;CAIvE;AALD,8BAKC"}
@@ -1,7 +1,8 @@
1
+ import { Directive } from './Directive';
1
2
  import type { Component } from '@toa.io/core';
2
3
  import type { Output } from '../../io';
3
- import type { Directive, Input } from './types';
4
- export declare class Fetch implements Directive {
4
+ import type { Input } from './types';
5
+ export declare class Fetch extends Directive {
5
6
  readonly targeted = true;
6
7
  private readonly permissions;
7
8
  private readonly discovery;