@toolproof-core/lib 1.0.26 → 1.0.27
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/artifacts/artifacts.d.ts +30 -30
- package/dist/integrations/firebase/createRunnableStrategy.js +4 -4
- package/dist/integrations/firebase/createRunnableStrategy.js.map +1 -1
- package/dist/integrations/firebase/createStep.js +17 -17
- package/dist/integrations/firebase/createStep.js.map +1 -1
- package/dist/integrations/firebase/firebaseAdminHelpers.d.ts +5 -5
- package/dist/integrations/firebase/firebaseAdminHelpers.d.ts.map +1 -1
- package/dist/integrations/firebase/firebaseAdminHelpers.js +11 -11
- package/dist/integrations/firebase/firebaseAdminHelpers.js.map +1 -1
- package/dist/types/types.d.ts +6 -6
- package/dist/types/types.d.ts.map +1 -1
- package/dist/utils/bindInputRoleToResource.js +2 -2
- package/dist/utils/bindInputRoleToResource.js.map +1 -1
- package/dist/utils/creation/resourceCreation.d.ts +5 -5
- package/dist/utils/creation/resourceCreation.d.ts.map +1 -1
- package/dist/utils/creation/resourceCreation.js +14 -14
- package/dist/utils/creation/resourceCreation.js.map +1 -1
- package/dist/utils/creation/runnableStrategyCreation.d.ts +2 -2
- package/dist/utils/creation/runnableStrategyCreation.d.ts.map +1 -1
- package/dist/utils/creation/runnableStrategyCreation.js +7 -7
- package/dist/utils/creation/runnableStrategyCreation.js.map +1 -1
- package/dist/utils/creation/stepCreation.d.ts +17 -17
- package/dist/utils/creation/stepCreation.d.ts.map +1 -1
- package/dist/utils/creation/stepCreation.js +20 -20
- package/dist/utils/creation/stepCreation.js.map +1 -1
- package/dist/utils/extractData.d.ts +9 -9
- package/dist/utils/extractData.d.ts.map +1 -1
- package/dist/utils/extractData.js +22 -22
- package/dist/utils/extractData.js.map +1 -1
- package/dist/utils/parallelizeSteps.js +7 -7
- package/dist/utils/parallelizeSteps.js.map +1 -1
- package/package.json +2 -2
- package/src/integrations/firebase/createRunnableStrategy.ts +4 -4
- package/src/integrations/firebase/createStep.ts +17 -17
- package/src/integrations/firebase/firebaseAdminHelpers.ts +18 -18
- package/src/types/types.ts +6 -6
- package/src/utils/bindInputRoleToResource.ts +2 -2
- package/src/utils/creation/resourceCreation.ts +19 -19
- package/src/utils/creation/runnableStrategyCreation.ts +10 -10
- package/src/utils/creation/stepCreation.ts +39 -39
- package/src/utils/extractData.ts +42 -42
- package/src/utils/parallelizeSteps.ts +14 -14
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/integrations/firebase/createRunnableStrategy.d.ts +0 -3
- package/dist/integrations/firebase/createStep.d.ts +0 -11
- package/dist/integrations/firebase/firebaseAdminInit.d.ts +0 -4
- package/dist/integrations/firebase/firebaseAdminInit.d.ts.map +0 -1
- package/dist/integrations/firebase/firebaseAdminInit.js +0 -33
- package/dist/integrations/firebase/firebaseAdminInit.js.map +0 -1
- package/dist/utils/bindInputRoleToResource.d.ts +0 -5
- package/dist/utils/parallelizeSteps.d.ts +0 -3
- package/dist/utils/resolveResourceChain.d.ts +0 -23
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { BranchStepJson, ForStepJson, ToolJson, ToolStepJson, WhileStepJson } from '@toolproof-core/schema';
|
|
2
|
-
import { CONSTANTS } from '../../artifacts/artifacts.js';
|
|
3
|
-
export declare function createToolStepFromTool(tool: ToolJson): ToolStepJson;
|
|
4
|
-
export declare function createLoopStepFromToolPair(whatTool: ToolJson, whenTool: ToolJson, stepKind: typeof CONSTANTS.Enums.StepKind.for | typeof CONSTANTS.Enums.StepKind.while): ForStepJson | WhileStepJson;
|
|
5
|
-
export declare function createBranchStepFromToolPairs(cases: Array<{
|
|
6
|
-
whatTool: ToolJson;
|
|
7
|
-
whenTool: ToolJson;
|
|
8
|
-
}>): BranchStepJson;
|
|
9
|
-
export declare function cloneForStep(forStep: ForStepJson): ForStepJson;
|
|
10
|
-
export declare function cloneWhileStep(whileStep: WhileStepJson): WhileStepJson;
|
|
11
|
-
//# sourceMappingURL=createStep.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"firebaseAdminInit.d.ts","sourceRoot":"","sources":["../../../src/integrations/firebase/firebaseAdminInit.ts"],"names":[],"mappings":"AAmCA,QAAA,MAAM,OAAO,6BAAoB,CAAC;AAClC,QAAA,MAAM,YAAY,0CAAkB,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { getApp, getApps, initializeApp, applicationDefault, cert } from 'firebase-admin/app';
|
|
2
|
-
import { getFirestore } from 'firebase-admin/firestore';
|
|
3
|
-
import { getStorage } from 'firebase-admin/storage';
|
|
4
|
-
import { existsSync, readFileSync } from 'fs';
|
|
5
|
-
import path from 'path';
|
|
6
|
-
function resolveCredential() {
|
|
7
|
-
const jsonString = process.env.GOOGLE_APPLICATION_CREDENTIALS_JSON;
|
|
8
|
-
const envPath = process.env.GOOGLE_APPLICATION_CREDENTIALS;
|
|
9
|
-
const localKeyPath = path.join(process.cwd(), 'gcp-key.json');
|
|
10
|
-
try {
|
|
11
|
-
if (jsonString) {
|
|
12
|
-
return cert(JSON.parse(jsonString));
|
|
13
|
-
}
|
|
14
|
-
if (envPath && existsSync(envPath)) {
|
|
15
|
-
return cert(JSON.parse(readFileSync(envPath, 'utf8')));
|
|
16
|
-
}
|
|
17
|
-
if (existsSync(localKeyPath)) {
|
|
18
|
-
return cert(JSON.parse(readFileSync(localKeyPath, 'utf8')));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
return applicationDefault();
|
|
23
|
-
}
|
|
24
|
-
return applicationDefault();
|
|
25
|
-
}
|
|
26
|
-
const app = getApps().length ? getApp() : initializeApp({
|
|
27
|
-
credential: resolveCredential(),
|
|
28
|
-
projectId: 'toolproof-563fe',
|
|
29
|
-
});
|
|
30
|
-
const dbAdmin = getFirestore(app);
|
|
31
|
-
const storageAdmin = getStorage(app);
|
|
32
|
-
export { dbAdmin, storageAdmin };
|
|
33
|
-
//# sourceMappingURL=firebaseAdminInit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"firebaseAdminInit.js","sourceRoot":"","sources":["../../../src/integrations/firebase/firebaseAdminInit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,SAAS,iBAAiB;IACtB,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC;IACnE,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC;IAC3D,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,cAAc,CAAC,CAAC;IAE9D,IAAI,CAAC;QACD,IAAI,UAAU,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QACxC,CAAC;QAED,IAAI,OAAO,IAAI,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACjC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAC3D,CAAC;QAED,IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;IAAC,MAAM,CAAC;QACL,OAAO,kBAAkB,EAAE,CAAC;IAChC,CAAC;IAED,OAAO,kBAAkB,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,GAAG,GAAG,OAAO,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;IACpD,UAAU,EAAE,iBAAiB,EAAE;IAC/B,SAAS,EAAE,iBAAiB;CAC/B,CAAC,CAAC;AAEH,MAAM,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;AAClC,MAAM,YAAY,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAErC,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { CreationContextJson, ResourceJson, StrategyStateJson } from '@toolproof-core/schema';
|
|
2
|
-
export declare function bindInputResInStrategyState(strategyState: StrategyStateJson, target: CreationContextJson, resource: ResourceJson): StrategyStateJson;
|
|
3
|
-
export declare function bindInputRefInStrategyState(strategyState: StrategyStateJson, target: CreationContextJson, source: CreationContextJson): StrategyStateJson;
|
|
4
|
-
export declare function clearInputBindingInStrategyState(strategyState: StrategyStateJson, target: CreationContextJson): StrategyStateJson;
|
|
5
|
-
//# sourceMappingURL=bindInputRoleToResource.d.ts.map
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { CreationContextJson, ExternalInputPotentialShellJson, OutputPotentialShellJson, ResourceJson, StrategyStateJson } from '@toolproof-core/schema';
|
|
2
|
-
import { CONSTANTS } from '../artifacts/artifacts.js';
|
|
3
|
-
export type ResolveResult = {
|
|
4
|
-
status: typeof CONSTANTS.Enums.ResourceShellKind.materialized;
|
|
5
|
-
entry: ResourceJson;
|
|
6
|
-
path: CreationContextJson[];
|
|
7
|
-
} | {
|
|
8
|
-
status: typeof CONSTANTS.Enums.ResourceShellKind.externalInputPotential;
|
|
9
|
-
entry: ExternalInputPotentialShellJson;
|
|
10
|
-
path: CreationContextJson[];
|
|
11
|
-
} | {
|
|
12
|
-
status: typeof CONSTANTS.Enums.ResourceShellKind.outputPotential;
|
|
13
|
-
entry: OutputPotentialShellJson;
|
|
14
|
-
path: CreationContextJson[];
|
|
15
|
-
} | {
|
|
16
|
-
status: 'unresolved';
|
|
17
|
-
reason: 'not-found' | 'cycle' | 'depth-exceeded';
|
|
18
|
-
path: CreationContextJson[];
|
|
19
|
-
};
|
|
20
|
-
export declare function resolveResourceChain(strategyState: StrategyStateJson, start: CreationContextJson, opts?: {
|
|
21
|
-
maxDepth?: number;
|
|
22
|
-
}): ResolveResult;
|
|
23
|
-
//# sourceMappingURL=resolveResourceChain.d.ts.map
|