@openfn/project 0.14.1 → 0.14.3
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/index.d.ts +4 -3
- package/dist/index.js +8 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as l from '@openfn/lexicon';
|
|
2
2
|
import l__default, { SandboxMeta, WorkspaceConfig, UUID } from '@openfn/lexicon';
|
|
3
|
-
import { Logger } from '@openfn/logger';
|
|
4
3
|
import { Provisioner } from '@openfn/lexicon/lightning';
|
|
4
|
+
import { Logger } from '@openfn/logger';
|
|
5
5
|
|
|
6
6
|
type DiffType = 'added' | 'changed' | 'removed';
|
|
7
7
|
type WorkflowDiff = {
|
|
@@ -78,6 +78,7 @@ type fromAppStateConfig = Partial<l.WorkspaceConfig> & {
|
|
|
78
78
|
format?: 'yaml' | 'json';
|
|
79
79
|
alias?: string;
|
|
80
80
|
};
|
|
81
|
+
declare const mapWorkflow: (workflow: Provisioner.Workflow, credentials?: Credential[]) => l.Workflow;
|
|
81
82
|
|
|
82
83
|
type FromPathConfig = l.WorkspaceConfig & {
|
|
83
84
|
format: 'json' | 'yaml';
|
|
@@ -182,7 +183,7 @@ declare class Project {
|
|
|
182
183
|
collections: any;
|
|
183
184
|
credentials: Credential[];
|
|
184
185
|
sandbox?: SandboxMeta;
|
|
185
|
-
static from(type: 'project', data: any,
|
|
186
|
+
static from(type: 'project', data: any, config?: Partial<l__default.WorkspaceConfig>): Promise<Project>;
|
|
186
187
|
static from(type: 'state', data: Provisioner.Project, meta?: Partial<l__default.ProjectMeta>, config?: fromAppStateConfig): Promise<Project>;
|
|
187
188
|
static from(type: 'fs', options: FromFsConfig): Promise<Project>;
|
|
188
189
|
static from(type: 'path', data: string, options?: {
|
|
@@ -248,4 +249,4 @@ type GenerateProjectOptions = GenerateWorkflowOptions & {
|
|
|
248
249
|
declare function generateWorkflow(def: string, options?: Partial<GenerateWorkflowOptions>): Workflow;
|
|
249
250
|
declare function generateProject(name: string, workflowDefs: string[], options?: Partial<GenerateProjectOptions>): Project;
|
|
250
251
|
|
|
251
|
-
export { DiffType, WorkflowDiff, Workspace, Project as default, diff, generateProject, generateHash as generateVersionHash, generateWorkflow, jsonToYaml, match as versionsEqual, yamlToJson };
|
|
252
|
+
export { DiffType, WorkflowDiff, Workspace, Project as default, diff, generateProject, generateHash as generateVersionHash, generateWorkflow, jsonToYaml, mapWorkflow, match as versionsEqual, yamlToJson };
|
package/dist/index.js
CHANGED
|
@@ -55,7 +55,7 @@ var parse = (credentialName) => {
|
|
|
55
55
|
// src/serialize/to-app-state.ts
|
|
56
56
|
var defaultJobProps = {
|
|
57
57
|
// TODO why does the provisioner throw if these keys are not set?
|
|
58
|
-
// Ok, 90% of jobs will have a
|
|
58
|
+
// Ok, 90% of jobs will have a credential, but it's still optional right?
|
|
59
59
|
keychain_credential_id: null,
|
|
60
60
|
project_credential_id: null
|
|
61
61
|
};
|
|
@@ -149,10 +149,6 @@ var mapWorkflow = (workflow, credentials = []) => {
|
|
|
149
149
|
});
|
|
150
150
|
if (mappedCredential) {
|
|
151
151
|
projectCredentialId = mappedCredential.uuid;
|
|
152
|
-
} else {
|
|
153
|
-
console.warn(`WARING! Failed to map credential ${projectCredentialId} - Lightning may throw an error.
|
|
154
|
-
|
|
155
|
-
Ensure the credential exists in project.yaml and try again (maybe ensure the credential is attached to the project in the app and run project fetch)`);
|
|
156
152
|
}
|
|
157
153
|
otherOpenFnProps.project_credential_id = projectCredentialId;
|
|
158
154
|
}
|
|
@@ -1454,7 +1450,11 @@ Pass --force to force the merge anyway`
|
|
|
1454
1450
|
}
|
|
1455
1451
|
}
|
|
1456
1452
|
const assigns = options.mode === SANDBOX_MERGE ? {
|
|
1457
|
-
workflows: finalWorkflows
|
|
1453
|
+
workflows: finalWorkflows,
|
|
1454
|
+
credentials: replaceCredentials(
|
|
1455
|
+
source.credentials,
|
|
1456
|
+
target.credentials
|
|
1457
|
+
)
|
|
1458
1458
|
} : {
|
|
1459
1459
|
workflows: finalWorkflows,
|
|
1460
1460
|
openfn: {
|
|
@@ -1772,7 +1772,7 @@ var Workspace = class {
|
|
|
1772
1772
|
} catch (e) {
|
|
1773
1773
|
if (validate) {
|
|
1774
1774
|
this.logger.warn(
|
|
1775
|
-
`Could not find openfn.yaml at ${workspacePath}. Using default
|
|
1775
|
+
`Could not find openfn.yaml at ${workspacePath}. Using default configuration.`
|
|
1776
1776
|
);
|
|
1777
1777
|
}
|
|
1778
1778
|
}
|
|
@@ -2074,6 +2074,7 @@ export {
|
|
|
2074
2074
|
generateHash as generateVersionHash,
|
|
2075
2075
|
generateWorkflow,
|
|
2076
2076
|
jsonToYaml,
|
|
2077
|
+
mapWorkflow2 as mapWorkflow,
|
|
2077
2078
|
match as versionsEqual,
|
|
2078
2079
|
yamlToJson
|
|
2079
2080
|
};
|