@autentikar/step 1.0.4 → 2.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/dist/context.d.ts +36 -0
- package/dist/context.js +42 -0
- package/package.json +16 -7
- package/dist/index.d.ts +0 -57
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
interface Storage {
|
|
2
|
+
save(name: string, content: Buffer, instance: string): Promise<StorageItem>;
|
|
3
|
+
get(key: string): Promise<StorageItem | undefined>;
|
|
4
|
+
}
|
|
5
|
+
type PersistentType = "FILESYSTEM" | "MONGODB" | "S3" | "NFS" | "S3-MRAP" | "CDN";
|
|
6
|
+
declare class StorageItem {
|
|
7
|
+
readonly path: string;
|
|
8
|
+
readonly type: PersistentType;
|
|
9
|
+
readonly buffer: Buffer;
|
|
10
|
+
readonly fileUrl: string;
|
|
11
|
+
constructor(path: string, type: PersistentType, buffer: Buffer, fileUrl: string);
|
|
12
|
+
getBase64(): string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type KVKind = "INSTANCE" | "STEP";
|
|
16
|
+
interface KV {
|
|
17
|
+
get<TValue = unknown>(key: string, kind?: KVKind): Promise<TValue | undefined>;
|
|
18
|
+
set(key: string, value: unknown, kind?: KVKind): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
interface Params {
|
|
22
|
+
get<TValue = unknown>(): Promise<TValue | undefined>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface Preference {
|
|
26
|
+
get<TValue = unknown>(name: string): Promise<TValue | undefined>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
declare let params: Params;
|
|
30
|
+
/** @deprecated use system. */
|
|
31
|
+
declare let preference: Preference;
|
|
32
|
+
declare let system: Preference;
|
|
33
|
+
declare let kv: KV;
|
|
34
|
+
declare let asset: Storage;
|
|
35
|
+
|
|
36
|
+
export { asset, kv, params, preference, system };
|
package/dist/context.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/context.ts
|
|
21
|
+
var context_exports = {};
|
|
22
|
+
__export(context_exports, {
|
|
23
|
+
asset: () => asset,
|
|
24
|
+
kv: () => kv,
|
|
25
|
+
params: () => params,
|
|
26
|
+
preference: () => preference,
|
|
27
|
+
system: () => system
|
|
28
|
+
});
|
|
29
|
+
module.exports = __toCommonJS(context_exports);
|
|
30
|
+
var params;
|
|
31
|
+
var preference;
|
|
32
|
+
var system;
|
|
33
|
+
var kv;
|
|
34
|
+
var asset;
|
|
35
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
36
|
+
0 && (module.exports = {
|
|
37
|
+
asset,
|
|
38
|
+
kv,
|
|
39
|
+
params,
|
|
40
|
+
preference,
|
|
41
|
+
system
|
|
42
|
+
});
|
package/package.json
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@autentikar/step",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.4",
|
|
4
4
|
"description": "",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"exports": {
|
|
9
|
+
"./context": "./dist/context.js",
|
|
10
|
+
"./package.json": "./package.json"
|
|
11
|
+
},
|
|
12
|
+
"typesVersions": {
|
|
13
|
+
"*": {
|
|
14
|
+
"context": [
|
|
15
|
+
"./dist/context.d.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
8
19
|
"scripts": {
|
|
9
20
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
10
21
|
"dev": "pnpm run build -- --watch",
|
|
11
|
-
"build": "tsup"
|
|
12
|
-
"publish-packages": "turbo run build && changeset version && changeset publish"
|
|
22
|
+
"build": "tsup"
|
|
13
23
|
},
|
|
14
24
|
"keywords": [],
|
|
15
25
|
"author": "",
|
|
16
26
|
"license": "ISC",
|
|
17
27
|
"devDependencies": {
|
|
18
|
-
"@changesets/cli": "^2.27.1",
|
|
19
28
|
"@types/node": "^20.11.5",
|
|
20
29
|
"tsup": "^8.0.1",
|
|
21
30
|
"typescript": "^5.2.2"
|
package/dist/index.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
declare global {
|
|
2
|
-
class AccountPreference {
|
|
3
|
-
static get<VALUE = unknown>(name: string): Promise<VALUE | undefined>;
|
|
4
|
-
}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
interface StepFile {
|
|
8
|
-
buffer: Buffer;
|
|
9
|
-
url?: string;
|
|
10
|
-
}
|
|
11
|
-
declare global {
|
|
12
|
-
class Assets {
|
|
13
|
-
static get(path: string, options?: {
|
|
14
|
-
url?: boolean;
|
|
15
|
-
}): Promise<StepFile | undefined>;
|
|
16
|
-
static save(name: string, content: Buffer | string, options?: {
|
|
17
|
-
meta?: undefined;
|
|
18
|
-
base?: string;
|
|
19
|
-
}): Promise<{
|
|
20
|
-
path: string;
|
|
21
|
-
}>;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare global {
|
|
26
|
-
class Preference {
|
|
27
|
-
static get<VALUE = unknown>(name: string): Promise<VALUE | undefined>;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
interface StepOutput {
|
|
32
|
-
[key: string]: string | undefined;
|
|
33
|
-
success?: string;
|
|
34
|
-
failure?: string;
|
|
35
|
-
}
|
|
36
|
-
interface MethodResult {
|
|
37
|
-
omitMethodRecord?: boolean;
|
|
38
|
-
nextStep?: {
|
|
39
|
-
id: string;
|
|
40
|
-
linkData?: unknown;
|
|
41
|
-
};
|
|
42
|
-
status: "SUCCESS" | "FAILURE";
|
|
43
|
-
result: {
|
|
44
|
-
output?: unknown;
|
|
45
|
-
[key: string]: unknown;
|
|
46
|
-
};
|
|
47
|
-
akAdmin?: unknown;
|
|
48
|
-
}
|
|
49
|
-
type Method<INIT_DATA = any, PARAMS = any, DATA = any> = (options: {
|
|
50
|
-
initData: INIT_DATA | undefined;
|
|
51
|
-
params: PARAMS | undefined;
|
|
52
|
-
data: DATA | undefined;
|
|
53
|
-
threads: string[] | undefined;
|
|
54
|
-
output: StepOutput;
|
|
55
|
-
}) => Promise<MethodResult>;
|
|
56
|
-
|
|
57
|
-
export type { Method, MethodResult, StepFile };
|
package/dist/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var d=(n,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of a(e))!u.call(n,t)&&t!==i&&o(n,t,{get:()=>e[t],enumerable:!(r=s(e,t))||r.enumerable});return n};var A=n=>d(o({},"__esModule",{value:!0}),n);var p={};module.exports=A(p);
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../index.ts"],"sourcesContent":["// export { Method } from \"@autentikar/step-types\";\n\ninterface StepOutput {\n [key: string]: string | undefined;\n success?: string;\n failure?: string;\n}\n\nexport interface MethodResult {\n omitMethodRecord?: boolean;\n nextStep?: {\n id: string;\n linkData?: unknown;\n };\n status: \"SUCCESS\" | \"FAILURE\";\n result: {\n output?: unknown;\n [key: string]: unknown;\n };\n akAdmin?: unknown;\n}\n\nexport type Method<INIT_DATA = any, PARAMS = any, DATA = any> = (options: {\n initData: INIT_DATA | undefined;\n params: PARAMS | undefined;\n data: DATA | undefined;\n threads: string[] | undefined;\n output: StepOutput;\n}) => Promise<MethodResult>;\n\nexport * from \"./src\";\n"],"mappings":"+WAAA,IAAAA,EAAA,kBAAAC,EAAAD","names":["step_exports","__toCommonJS"]}
|