@autentikar/step 2.0.0-alpha.20 → 2.0.0-alpha.22

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/dist/context.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { S as StorageItem, a as Step } from './index-9E524NfU.js';
1
+ import { S as StorageItem, a as Step } from './index-ssFn-GXQ.js';
2
2
  import 'file-type/core';
3
3
  import 'zod';
4
4
 
@@ -66,11 +66,11 @@ type AppEnv = {
66
66
  };
67
67
  declare class StepDefinition {
68
68
  readonly id: string;
69
- readonly flow: string;
70
69
  readonly type: string;
70
+ readonly prev_step: string;
71
71
  readonly user_interaction: boolean;
72
72
  readonly return_result: boolean;
73
- end_after_processing: undefined | {
73
+ readonly end_after_processing: undefined | {
74
74
  dispatch: "NO";
75
75
  } | {
76
76
  dispatch: "AUTO";
@@ -81,7 +81,7 @@ declare class StepDefinition {
81
81
  cloud_hidden?: boolean;
82
82
  call_webhook?: boolean;
83
83
  };
84
- constructor(id: string, flow: string, type: string, user_interaction: boolean, return_result: boolean, end_after_processing: undefined | {
84
+ constructor(id: string, type: string, prev_step: string, user_interaction: boolean, return_result: boolean, end_after_processing: undefined | {
85
85
  dispatch: "NO";
86
86
  } | {
87
87
  dispatch: "AUTO";
@@ -90,5 +90,26 @@ declare class StepDefinition {
90
90
  call_webhook?: boolean;
91
91
  });
92
92
  }
93
+ declare class StepInstance {
94
+ readonly id: string;
95
+ readonly expires_at: number | undefined;
96
+ constructor(id: string, expires_at: number | undefined);
97
+ isExpired(): boolean | 0 | undefined;
98
+ }
99
+ declare class FlowContext {
100
+ readonly id: string;
101
+ readonly webhook: string | undefined;
102
+ constructor(id: string, webhook: string | undefined);
103
+ }
104
+ declare class StepContext {
105
+ readonly org: string;
106
+ readonly flow: FlowContext;
107
+ readonly step: StepDefinition;
108
+ readonly instance: StepInstance;
109
+ readonly expires_at: number | undefined;
110
+ readonly params: unknown;
111
+ constructor(org: string, flow: FlowContext, step: StepDefinition, instance: StepInstance, expires_at: number | undefined, params: unknown);
112
+ isExpired(): boolean | 0 | undefined;
113
+ }
93
114
 
94
- export { type AppEnvironments as A, type MethodContextOrganization as M, type PersistentType as P, StorageItem as S, type Step as a, StepRequest as b, type Staging as c, type MethodContextFlow as d, type MethodContextInstance as e, type MethodContext as f, type Method as g, type AppEnv as h, StepDefinition as i };
115
+ export { type AppEnvironments as A, FlowContext as F, type MethodContextOrganization as M, type PersistentType as P, StorageItem as S, type Step as a, StepRequest as b, type Staging as c, type MethodContextFlow as d, type MethodContextInstance as e, type MethodContext as f, type Method as g, type AppEnv as h, StepDefinition as i, StepInstance as j, StepContext as k };
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import 'file-type/core';
2
2
  import 'zod';
3
- export { h as AppEnv, A as AppEnvironments, g as Method, f as MethodContext, d as MethodContextFlow, e as MethodContextInstance, M as MethodContextOrganization, P as PersistentType, c as Staging, i as StepDefinition, b as StepRequest, S as StorageItem } from './index-9E524NfU.js';
3
+ export { h as AppEnv, A as AppEnvironments, F as FlowContext, g as Method, f as MethodContext, d as MethodContextFlow, e as MethodContextInstance, M as MethodContextOrganization, P as PersistentType, c as Staging, k as StepContext, i as StepDefinition, j as StepInstance, b as StepRequest, S as StorageItem } from './index-ssFn-GXQ.js';
package/dist/index.js CHANGED
@@ -30,7 +30,10 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var src_exports = {};
32
32
  __export(src_exports, {
33
+ FlowContext: () => FlowContext,
34
+ StepContext: () => StepContext,
33
35
  StepDefinition: () => StepDefinition,
36
+ StepInstance: () => StepInstance,
34
37
  StepRequest: () => StepRequest,
35
38
  StorageItem: () => StorageItem
36
39
  });
@@ -80,10 +83,10 @@ var StorageItem = class {
80
83
  }
81
84
  };
82
85
  var StepDefinition = class {
83
- constructor(id, flow, type, user_interaction, return_result, end_after_processing, params, output, milestone) {
86
+ constructor(id, type, prev_step, user_interaction, return_result, end_after_processing, params, output, milestone) {
84
87
  this.id = id;
85
- this.flow = flow;
86
88
  this.type = type;
89
+ this.prev_step = prev_step;
87
90
  this.user_interaction = user_interaction;
88
91
  this.return_result = return_result;
89
92
  this.end_after_processing = end_after_processing;
@@ -92,9 +95,43 @@ var StepDefinition = class {
92
95
  this.milestone = milestone;
93
96
  }
94
97
  };
98
+ var StepInstance = class {
99
+ constructor(id, expires_at) {
100
+ this.id = id;
101
+ this.expires_at = expires_at;
102
+ }
103
+ // public isInvalid() {
104
+ // return this.expires_at && this.expires_at < Date.now();
105
+ // }
106
+ isExpired() {
107
+ return this.expires_at && this.expires_at < Date.now();
108
+ }
109
+ };
110
+ var FlowContext = class {
111
+ constructor(id, webhook) {
112
+ this.id = id;
113
+ this.webhook = webhook;
114
+ }
115
+ };
116
+ var StepContext = class {
117
+ constructor(org, flow, step, instance, expires_at, params) {
118
+ this.org = org;
119
+ this.flow = flow;
120
+ this.step = step;
121
+ this.instance = instance;
122
+ this.expires_at = expires_at;
123
+ this.params = params;
124
+ }
125
+ isExpired() {
126
+ return this.expires_at && this.expires_at < Date.now();
127
+ }
128
+ };
95
129
  // Annotate the CommonJS export names for ESM import in node:
96
130
  0 && (module.exports = {
131
+ FlowContext,
132
+ StepContext,
97
133
  StepDefinition,
134
+ StepInstance,
98
135
  StepRequest,
99
136
  StorageItem
100
137
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autentikar/step",
3
- "version": "2.0.0-alpha.20",
3
+ "version": "2.0.0-alpha.22",
4
4
  "description": "",
5
5
  "files": [
6
6
  "dist"