@boomi/embedkit-sdk 1.1.2 → 1.1.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.js CHANGED
@@ -4279,6 +4279,25 @@ var EnvironmentExtensionsService = class {
4279
4279
  }
4280
4280
  });
4281
4281
  }
4282
+ /**
4283
+ * Queries for an EnvironmentExtensions object(s)
4284
+ * For general information about the structure of QUERY filters, their sample payloads, and how to handle the paged results, refer to [Query filters](#section/Introduction/Query-filters) and [Query paging](#section/Introduction/Query-paging).
4285
+ * @param requestBody Possible properties include: environmentId, extensionGroupId
4286
+ * @returns EnvironmentExtensionsQueryResponse Successful request and response.
4287
+ * @throws ApiError
4288
+ */
4289
+ queryOauth2Url(requestBody) {
4290
+ return this.httpRequest.request({
4291
+ method: "POST",
4292
+ url: "/EnvironmentOAuth2AccessTokenExtensionGenerationRequest/execute",
4293
+ body: requestBody,
4294
+ mediaType: "application/json",
4295
+ errors: {
4296
+ 403: `Missing or incorrect authentication credentials.
4297
+ To know the action to be taken for this and the other error responses (410, 503, etc), refer to [API Errors](#section/Introduction/API-errors)`
4298
+ }
4299
+ });
4300
+ }
4282
4301
  };
4283
4302
 
4284
4303
  // lib/services/EnvironmentMapExtensionService.ts
@@ -11872,6 +11891,45 @@ var MergeRequestSimpleExpression;
11872
11891
  })(operator = MergeRequestSimpleExpression2.operator || (MergeRequestSimpleExpression2.operator = {}));
11873
11892
  })(MergeRequestSimpleExpression || (MergeRequestSimpleExpression = {}));
11874
11893
 
11894
+ // lib/models/Oauth2UrlGroupingExpression.ts
11895
+ var Oauth2UrlGroupingExpression;
11896
+ ((Oauth2UrlGroupingExpression2) => {
11897
+ let operator;
11898
+ ((operator2) => {
11899
+ operator2["AND"] = "and";
11900
+ operator2["OR"] = "or";
11901
+ })(operator = Oauth2UrlGroupingExpression2.operator || (Oauth2UrlGroupingExpression2.operator = {}));
11902
+ })(Oauth2UrlGroupingExpression || (Oauth2UrlGroupingExpression = {}));
11903
+
11904
+ // lib/models/Oauth2UrlSimpleExpression.ts
11905
+ var Oauth2UrlSimpleExpression;
11906
+ ((Oauth2UrlSimpleExpression2) => {
11907
+ let operator;
11908
+ ((operator2) => {
11909
+ operator2["EQUALS"] = "EQUALS";
11910
+ operator2["LIKE"] = "LIKE";
11911
+ operator2["NOT_EQUALS"] = "NOT_EQUALS";
11912
+ operator2["IS_NULL"] = "IS_NULL";
11913
+ operator2["IS_NOT_NULL"] = "IS_NOT_NULL";
11914
+ operator2["BETWEEN"] = "BETWEEN";
11915
+ operator2["GREATER_THAN"] = "GREATER_THAN";
11916
+ operator2["GREATER_THAN_OR_EQUAL"] = "GREATER_THAN_OR_EQUAL";
11917
+ operator2["LESS_THAN"] = "LESS_THAN";
11918
+ operator2["LESS_THAN_OR_EQUAL"] = "LESS_THAN_OR_EQUAL";
11919
+ operator2["CONTAINS"] = "CONTAINS";
11920
+ operator2["NOT_CONTAINS"] = "NOT_CONTAINS";
11921
+ })(operator = Oauth2UrlSimpleExpression2.operator || (Oauth2UrlSimpleExpression2.operator = {}));
11922
+ let property;
11923
+ ((property2) => {
11924
+ property2["ENVIRONMENT_ID"] = "environmentId";
11925
+ property2["EXTENSION_GROUP_ID"] = "extensionGroupId";
11926
+ property2["CONNECTION_ID"] = "connectionId";
11927
+ property2["OAUTH_FIELD_ID"] = "oAuthFieldId";
11928
+ property2["CLIENT_ID"] = "clientId";
11929
+ property2["CLIENT_SECRET"] = "clientSecret";
11930
+ })(property = Oauth2UrlSimpleExpression2.property || (Oauth2UrlSimpleExpression2.property = {}));
11931
+ })(Oauth2UrlSimpleExpression || (Oauth2UrlSimpleExpression = {}));
11932
+
11875
11933
  // lib/models/ODETTEConnectorRecordGroupingExpression.ts
11876
11934
  var ODETTEConnectorRecordGroupingExpression;
11877
11935
  ((ODETTEConnectorRecordGroupingExpression2) => {
@@ -13570,700 +13628,6 @@ var X12Options;
13570
13628
  outboundValidationOption2["FAIL_ALL"] = "failAll";
13571
13629
  })(outboundValidationOption = X12Options2.outboundValidationOption || (X12Options2.outboundValidationOption = {}));
13572
13630
  })(X12Options || (X12Options = {}));
13573
-
13574
- // lib/automation/graph/builder.ts
13575
- var nid = 0;
13576
- var eid = 0;
13577
- var nextN = (p = "n") => `${p}_${++nid}`;
13578
- var nextE = () => `e_${++eid}`;
13579
- var GraphBuilder = class {
13580
- constructor(name, gid = nextN("g")) {
13581
- this.name = name;
13582
- this.gid = gid;
13583
- this.nodes = [];
13584
- this.edges = [];
13585
- }
13586
- /** Add a new node to the graph */
13587
- add(spec) {
13588
- const node = { id: this._nextId(), ...spec };
13589
- this.nodes.push(node);
13590
- const handle = {
13591
- id: node.id,
13592
- node,
13593
- in: (p) => ({ node: node.id, port: p }),
13594
- out: (p) => ({ node: node.id, port: p })
13595
- };
13596
- return handle;
13597
- }
13598
- /** Flow helpers (flow.ts) call this; accept edge without id and assign one */
13599
- addEdge(edge) {
13600
- this.edges.push({ id: nextE(), ...edge });
13601
- }
13602
- /** Optional explicit connector that also assigns an id */
13603
- connect(from, to, meta) {
13604
- this.edges.push({ id: nextE(), from, to, meta });
13605
- }
13606
- /** Finalize to a JSON BPG object */
13607
- toJSON() {
13608
- return {
13609
- id: this.gid,
13610
- name: this.name,
13611
- nodes: this.nodes,
13612
- edges: this.edges
13613
- };
13614
- }
13615
- /** Internal node id generator */
13616
- _nextId() {
13617
- return nextN("n");
13618
- }
13619
- };
13620
-
13621
- // lib/automation/automation.ts
13622
- function defineAutomation(fn2) {
13623
- const components = [];
13624
- let graph = null;
13625
- const api = {
13626
- component: (c) => {
13627
- components.push(c);
13628
- },
13629
- process: (name, build) => {
13630
- const g = new GraphBuilder(name);
13631
- build(g);
13632
- graph = g.toJSON();
13633
- }
13634
- };
13635
- fn2(api);
13636
- if (!graph) throw new Error("No process graph defined. Call b.process(...)");
13637
- const catalog = { components };
13638
- return { graph, catalog };
13639
- }
13640
-
13641
- // lib/automation/graph/flow.ts
13642
- function metaFor(port4) {
13643
- if (port4 === "true") return { label: "True", branchIdentifier: "true" };
13644
- if (port4 === "false") return { label: "False", branchIdentifier: "false" };
13645
- if (/^\d+$/.test(port4)) return { label: port4, branchIdentifier: port4 };
13646
- return void 0;
13647
- }
13648
- function add(g, from, fromPort, to, toPort) {
13649
- g.addEdge({
13650
- from: { node: from.id, port: fromPort },
13651
- to: { node: to.id, port: toPort },
13652
- meta: metaFor(fromPort)
13653
- });
13654
- }
13655
- function makeChain(g, current, outPort = "main") {
13656
- return {
13657
- to(next) {
13658
- add(g, current, outPort, next, "main");
13659
- return makeChain(g, next, "main");
13660
- },
13661
- if(decisionNode, routes) {
13662
- add(g, current, outPort, decisionNode, "main");
13663
- const trueChain = {
13664
- to(next) {
13665
- add(g, decisionNode, "true", next, "main");
13666
- return makeChain(g, next, "main");
13667
- },
13668
- if: (dn, nested) => {
13669
- add(g, decisionNode, "true", dn, "main");
13670
- const tTrue = { to(n) {
13671
- add(g, dn, "true", n, "main");
13672
- return makeChain(g, n, "main");
13673
- }, if: this.if, branch: this.branch };
13674
- const tFalse = { to(n) {
13675
- add(g, dn, "false", n, "main");
13676
- return makeChain(g, n, "main");
13677
- }, if: this.if, branch: this.branch };
13678
- nested({ onTrue: tTrue, onFalse: tFalse });
13679
- return makeChain(g, dn, "main");
13680
- },
13681
- branch: (brNode, table) => {
13682
- add(g, decisionNode, "true", brNode, "main");
13683
- for (const [exitKey, go] of Object.entries(table)) {
13684
- const exit = exitKey;
13685
- const exitChain = {
13686
- to(n) {
13687
- add(g, brNode, exit, n, "main");
13688
- return makeChain(g, n, "main");
13689
- },
13690
- if: (dn, cb) => this.if(dn, cb),
13691
- branch: (bn, tb) => this.branch(bn, tb)
13692
- };
13693
- go(exitChain);
13694
- }
13695
- return makeChain(g, brNode, "main");
13696
- }
13697
- };
13698
- const falseChain = {
13699
- to(next) {
13700
- add(g, decisionNode, "false", next, "main");
13701
- return makeChain(g, next, "main");
13702
- },
13703
- if: (dn, nested) => {
13704
- add(g, decisionNode, "false", dn, "main");
13705
- const fTrue = { to(n) {
13706
- add(g, dn, "true", n, "main");
13707
- return makeChain(g, n, "main");
13708
- }, if: this.if, branch: this.branch };
13709
- const fFalse = { to(n) {
13710
- add(g, dn, "false", n, "main");
13711
- return makeChain(g, n, "main");
13712
- }, if: this.if, branch: this.branch };
13713
- nested({ onTrue: fTrue, onFalse: fFalse });
13714
- return makeChain(g, dn, "main");
13715
- },
13716
- branch: (brNode, table) => {
13717
- add(g, decisionNode, "false", brNode, "main");
13718
- for (const [exitKey, go] of Object.entries(table)) {
13719
- const exit = exitKey;
13720
- const exitChain = {
13721
- to(n) {
13722
- add(g, brNode, exit, n, "main");
13723
- return makeChain(g, n, "main");
13724
- },
13725
- if: (dn, cb) => this.if(dn, cb),
13726
- branch: (bn, tb) => this.branch(bn, tb)
13727
- };
13728
- go(exitChain);
13729
- }
13730
- return makeChain(g, brNode, "main");
13731
- }
13732
- };
13733
- routes({ onTrue: trueChain, onFalse: falseChain });
13734
- return makeChain(g, decisionNode, "main");
13735
- },
13736
- branch(branchNode, table) {
13737
- add(g, current, outPort, branchNode, "main");
13738
- for (const [exitKey, go] of Object.entries(table)) {
13739
- const exit = exitKey;
13740
- const exitChain = {
13741
- to(n) {
13742
- add(g, branchNode, exit, n, "main");
13743
- return makeChain(g, n, "main");
13744
- },
13745
- if: (dn, cb) => {
13746
- add(g, branchNode, exit, dn, "main");
13747
- const t = {
13748
- to(n) {
13749
- add(g, dn, "true", n, "main");
13750
- return makeChain(g, n, "main");
13751
- },
13752
- if: (inner, cb2) => this.if(inner, cb2),
13753
- branch: (bn, tb) => this.branch(bn, tb)
13754
- };
13755
- const f = {
13756
- to(n) {
13757
- add(g, dn, "false", n, "main");
13758
- return makeChain(g, n, "main");
13759
- },
13760
- if: (inner, cb2) => this.if(inner, cb2),
13761
- branch: (bn, tb) => this.branch(bn, tb)
13762
- };
13763
- cb({ onTrue: t, onFalse: f });
13764
- return makeChain(g, dn, "main");
13765
- },
13766
- branch: (bn, tb) => {
13767
- add(g, branchNode, exit, bn, "main");
13768
- for (const [exKey, go2] of Object.entries(tb)) {
13769
- const ex = exKey;
13770
- const exChain = {
13771
- to(n) {
13772
- add(g, bn, ex, n, "main");
13773
- return makeChain(g, n, "main");
13774
- },
13775
- if: (dn, cb2) => this.if(dn, cb2),
13776
- branch: (bn2, tb2) => this.branch(bn2, tb2)
13777
- };
13778
- go2(exChain);
13779
- }
13780
- return makeChain(g, bn, "main");
13781
- }
13782
- };
13783
- go(exitChain);
13784
- }
13785
- return makeChain(g, branchNode, "main");
13786
- }
13787
- };
13788
- }
13789
- function seq(g, start2) {
13790
- return makeChain(g, start2, "main");
13791
- }
13792
-
13793
- // lib/automation/stdlib/index.ts
13794
- var port = (id, direction, label) => ({ id, name: id, direction, label });
13795
- var start = (name = "Start") => ({
13796
- name,
13797
- kind: { family: "start", type: "passthrough" },
13798
- ports: [port("main", "out")]
13799
- });
13800
- var docProps = (name, cfg) => ({
13801
- name,
13802
- kind: { family: "doc", type: "properties" },
13803
- ports: [port("main", "in"), port("main", "out")],
13804
- config: cfg
13805
- });
13806
- var decision = (name = "Decision", cfg) => ({
13807
- name,
13808
- kind: { family: "decision", type: "compare" },
13809
- ports: [port("main", "in"), port("true", "out", "True"), port("false", "out", "False")],
13810
- config: cfg
13811
- });
13812
- var branch = (name = "Branch", n = 2) => ({
13813
- name,
13814
- kind: { family: "control", type: "branch" },
13815
- ports: [port("main", "in"), ...Array.from({ length: n }, (_, i) => port(String(i + 1), "out", String(i + 1)))]
13816
- });
13817
- var mapNode = (name = "Map", cfg) => ({
13818
- name,
13819
- kind: { family: "transform", type: "map" },
13820
- ports: [port("main", "in"), port("main", "out")],
13821
- config: cfg
13822
- });
13823
- var notify = (name = "Notify", cfg) => ({
13824
- name,
13825
- kind: { family: "notify", type: "message" },
13826
- ports: [port("main", "in"), port("main", "out")],
13827
- config: cfg
13828
- });
13829
- var returnDocs = (name = "Return") => ({
13830
- name,
13831
- kind: { family: "return", type: "returndocuments" },
13832
- ports: [port("main", "in")]
13833
- });
13834
- var stop = (name = "Stop", cfg = { continue: true }) => ({
13835
- name,
13836
- kind: { family: "stop", type: "stop" },
13837
- ports: [port("main", "in")],
13838
- config: cfg
13839
- });
13840
-
13841
- // lib/automation/stdlib/map.ts
13842
- var port2 = (id, direction, label) => ({ id, name: id, direction, label });
13843
- function mapNodeByAlias(name, cfg) {
13844
- return {
13845
- name,
13846
- kind: { family: "transform", type: "map" },
13847
- ports: [port2("main", "in"), port2("main", "out")],
13848
- config: cfg
13849
- };
13850
- }
13851
-
13852
- // lib/automation/stdlib/connector.ts
13853
- var port3 = (id, direction, label) => ({
13854
- id,
13855
- name: id,
13856
- // keep a human-friendly port name
13857
- direction,
13858
- // must match type definition
13859
- label
13860
- // optional display label
13861
- });
13862
- function connectorNode(name, connectorType, cfg) {
13863
- return {
13864
- name,
13865
- kind: { family: "connector", type: connectorType },
13866
- ports: [
13867
- port3("main", "in"),
13868
- port3("main", "out")
13869
- ],
13870
- config: cfg
13871
- };
13872
- }
13873
-
13874
- // lib/automation/catalog/map.helpers.ts
13875
- var fn = {
13876
- propertyGet(key, name, position, opts, xy) {
13877
- return {
13878
- key,
13879
- name,
13880
- category: "ProcessProperty",
13881
- type: "PropertyGet",
13882
- position,
13883
- x: xy?.x,
13884
- y: xy?.y,
13885
- inputs: [
13886
- { key: "1", name: "Property Name", default: opts.propertyName },
13887
- { key: "2", name: "Default Value", default: opts.defaultValue ?? "" }
13888
- ],
13889
- outputs: [{ key: "3", name: "Result" }],
13890
- configurationXml: "<Configuration/>",
13891
- cacheEnabled: true,
13892
- cacheOption: "none",
13893
- sumEnabled: false
13894
- };
13895
- },
13896
- documentPropertyGet(key, outputName, position, propertyId, propertyName, xy) {
13897
- return {
13898
- key,
13899
- name: "Get Document Property",
13900
- category: "ProcessProperty",
13901
- type: "DocumentPropertyGet",
13902
- position,
13903
- x: xy?.x,
13904
- y: xy?.y,
13905
- inputs: [],
13906
- outputs: [{ key: "3", name: outputName }],
13907
- configurationXml: `
13908
- <Configuration>
13909
- <DocumentProperty defaultValue="" persist="false" propertyId="${propertyId}" propertyName="${propertyName}"/>
13910
- </Configuration>`.trim(),
13911
- cacheEnabled: true,
13912
- sumEnabled: false
13913
- };
13914
- }
13915
- };
13916
- var m = {
13917
- fromFnToProfile(fromFunction, fromKey, toKey, toKeyPath, toNamePath) {
13918
- return {
13919
- fromFunction,
13920
- fromKey,
13921
- fromType: "function",
13922
- toKey,
13923
- toKeyPath,
13924
- toNamePath,
13925
- toType: "profile"
13926
- };
13927
- }
13928
- };
13929
-
13930
- // lib/automation/catalog/profiles/flatfile.helpers.ts
13931
- function ffElement(params) {
13932
- return {
13933
- dataType: "character",
13934
- isMappable: true,
13935
- isNode: true,
13936
- enforceUnique: false,
13937
- identityValue: "",
13938
- justification: "left",
13939
- mandatory: false,
13940
- minLength: 0,
13941
- maxLength: 0,
13942
- useToIdentifyFormat: false,
13943
- validateData: false,
13944
- ...params
13945
- };
13946
- }
13947
- function ffElementsGroup(params) {
13948
- return {
13949
- isNode: true,
13950
- ...params
13951
- };
13952
- }
13953
- function ffRecord(params) {
13954
- return {
13955
- isNode: true,
13956
- detectFormat: "numberofcolumns",
13957
- ...params
13958
- };
13959
- }
13960
-
13961
- // lib/automation/compiler/compile.ts
13962
- function esc(s) {
13963
- return String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
13964
- }
13965
- var typeMap = (k) => k === "connector-operation" ? "connector-action" : k;
13966
- function attrs(r) {
13967
- return Object.entries(r).filter(([, v]) => v !== void 0).map(([k, v]) => `${k}="${String(v)}"`).join(" ");
13968
- }
13969
- function emitMapping(mp) {
13970
- return ` <Mapping fromFunction="${mp.fromFunction}" fromKey="${mp.fromKey}" fromType="${mp.fromType}" toKey="${mp.toKey}" toKeyPath="${mp.toKeyPath}" toNamePath="${mp.toNamePath}" toType="${mp.toType}"/>`;
13971
- }
13972
- function componentToXml(c) {
13973
- const xmlType = typeMap(c.kind);
13974
- const a = attrs({ type: xmlType, subType: c.subType, name: c.name });
13975
- if (c.kind === "connector-settings" && c.subType === "http") {
13976
- const s = c.config;
13977
- return `<?xml version="1.0"?>
13978
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" ${a}>
13979
- <bns:object>
13980
- <HttpSettings authenticationType="${s.authenticationType}" url="${s.url}">
13981
- <AuthSettings${s.AuthSettings?.user ? ` user="${s.AuthSettings.user}"` : ""}/>
13982
- <OAuth2Settings${s.OAuth2Settings?.grantType ? ` grantType="${s.OAuth2Settings.grantType}"` : ""}/>
13983
- <SSLOptions${s.SSLOptions?.clientauth !== void 0 ? ` clientauth="${s.SSLOptions.clientauth}"` : ""}${s.SSLOptions?.trustServerCert !== void 0 ? ` trustServerCert="${s.SSLOptions.trustServerCert}"` : ""}/>
13984
- </HttpSettings>
13985
- </bns:object>
13986
- </bns:ApiComponent>`;
13987
- }
13988
- if (c.kind === "connector-operation" && c.subType === "http") {
13989
- const o = c.config;
13990
- return `<?xml version="1.0"?>
13991
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" ${a}>
13992
- <bns:object>
13993
- <Operation>
13994
- <Configuration>
13995
- <HttpSendAction methodType="${o.method}" dataContentType="${o.dataContentType}" followRedirects="${o.followRedirects}"
13996
- returnErrors="${o.returnErrors}" returnResponses="${o.returnResponses}"
13997
- requestProfileType="${o.requestProfileType}" responseProfileType="${o.responseProfileType}">
13998
- <requestHeaders/>
13999
- <pathElements>${(o.pathElements || []).map((e) => `<element isVariable="${e.isVariable}" key="${e.key}" name="${e.name}"/>`).join("")}</pathElements>
14000
- <responseHeaderMapping/>
14001
- </HttpSendAction>
14002
- </Configuration>
14003
- </Operation>
14004
- </bns:object>
14005
- </bns:ApiComponent>`;
14006
- }
14007
- if (c.kind === "transform.map") {
14008
- const cfg = c.config;
14009
- const mappingsXml = (cfg.mappings ?? []).map(emitMapping).join("\n");
14010
- const functionsXml = (cfg.functions ?? []).map((f) => {
14011
- const inputsXml = (f.inputs ?? []).map((i) => `<Input key="${i.key}" name="${i.name}"${i.default !== void 0 ? ` default="${i.default}"` : ""}/>`).join("");
14012
- const outputsXml = (f.outputs ?? []).map((o) => `<Output key="${o.key}" name="${o.name}"/>`).join("");
14013
- const pos = f.position !== void 0 ? ` position="${f.position}"` : "";
14014
- const xy = f.x !== void 0 && f.y !== void 0 ? ` x="${f.x}" y="${f.y}"` : "";
14015
- const cache = (f.cacheEnabled !== void 0 ? ` cacheEnabled="${f.cacheEnabled}"` : "") + (f.cacheOption ? ` cacheOption="${f.cacheOption}"` : "") + (f.sumEnabled !== void 0 ? ` sumEnabled="${f.sumEnabled}"` : "");
14016
- return ` <FunctionStep category="${f.category}" key="${f.key}" name="${f.name}" type="${f.type}"${pos}${xy}${cache}>
14017
- <Inputs>${inputsXml}</Inputs>
14018
- <Outputs>${outputsXml}</Outputs>
14019
- ${f.configurationXml ?? "<Configuration/>"}
14020
- </FunctionStep>`;
14021
- }).join("\n");
14022
- const optimize = cfg.optimizeExecutionOrder ?? true;
14023
- return `<?xml version="1.0"?>
14024
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" ${a}>
14025
- <bns:object>
14026
- <Map fromProfile="ALIAS:${cfg.fromProfile.alias}" toProfile="ALIAS:${cfg.toProfile.alias}">
14027
- <Mappings>
14028
- ${mappingsXml}
14029
- </Mappings>
14030
- <Functions optimizeExecutionOrder="${optimize}">
14031
- ${functionsXml}
14032
- </Functions>
14033
- <Defaults/>
14034
- <DocumentCacheJoins/>
14035
- </Map>
14036
- </bns:object>
14037
- </bns:ApiComponent>`;
14038
- }
14039
- if (c.kind === "profile.flatfile") {
14040
- const p = c.config;
14041
- if (p.raw) return p.raw;
14042
- const modelVersion = p.modelVersion ?? "2";
14043
- const strict = p.strict ?? true;
14044
- const gi = p.properties.generalInfo;
14045
- const opts = p.properties.options?.delimited;
14046
- const record = p.dataElements.record;
14047
- const group = record.elementsGroup;
14048
- const elementsXml = group.elements.map((el) => `
14049
- <FlatFileElement dataType="${el.dataType ?? "character"}"
14050
- enforceUnique="${!!el.enforceUnique}"
14051
- identityValue="${el.identityValue ?? ""}"
14052
- isMappable="${el.isMappable ?? true}"
14053
- isNode="${el.isNode ?? true}"
14054
- justification="${el.justification ?? "left"}"
14055
- key="${el.key}"
14056
- mandatory="${!!el.mandatory}"
14057
- maxLength="${el.maxLength ?? 0}"
14058
- minLength="${el.minLength ?? 0}"
14059
- name="${esc(el.name)}"
14060
- useToIdentifyFormat="${!!el.useToIdentifyFormat}"
14061
- validateData="${!!el.validateData}">
14062
- <DataFormat>
14063
- <ProfileCharacterFormat/>
14064
- </DataFormat>
14065
- </FlatFileElement>`).join("\n");
14066
- return `<?xml version="1.0"?>
14067
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" ${attrs({ type: "profile.flatfile", name: c.name })}>
14068
- <bns:object>
14069
- <FlatFileProfile xmlns="" modelVersion="${modelVersion}" strict="${strict}">
14070
- <ProfileProperties>
14071
- <GeneralInfo fileType="${gi.fileType}" useColumnHeaders="${!!gi.useColumnHeaders}"/>
14072
- <Options>
14073
- <DataOptions/>
14074
- ${opts ? `<DelimitedOptions fileDelimiter="${opts.fileDelimiter}" removeEscape="${!!opts.removeEscape}" textQualifier="${opts.textQualifier ?? "na"}"/>` : "<DelimitedOptions/>"}
14075
- </Options>
14076
- </ProfileProperties>
14077
- <DataElements>
14078
- <FlatFileRecord detectFormat="${record.detectFormat ?? "numberofcolumns"}" isNode="${record.isNode ?? true}" key="${record.key}" name="${esc(record.name)}">
14079
- <FlatFileElements isNode="${group.isNode ?? true}" key="${group.key}" name="${esc(group.name)}">
14080
- ${elementsXml}
14081
- </FlatFileElements>
14082
- </FlatFileRecord>
14083
- </DataElements>
14084
- </FlatFileProfile>
14085
- </bns:object>
14086
- </bns:ApiComponent>`;
14087
- }
14088
- if (c.kind === "profile.json") {
14089
- const cfg = c.config;
14090
- if (!cfg.raw) {
14091
- const inner = renderJsonProfileXML(cfg).replace(/<bns:ApiComponent[^>]*name=""/, `<bns:ApiComponent ${a}`);
14092
- return inner;
14093
- }
14094
- return cfg.raw;
14095
- }
14096
- return `<?xml version="1.0"?><bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" ${a}/>`;
14097
- }
14098
- function compileAutomation(pkg) {
14099
- const componentXmls = pkg.catalog.components.map((c) => ({
14100
- alias: c.alias,
14101
- kind: c.kind,
14102
- subType: c.subType,
14103
- xml: componentToXml(c)
14104
- }));
14105
- const shapes = pkg.graph.nodes.map((n, i) => {
14106
- const isConnector = n.kind.family === "connector";
14107
- const isMap = n.kind.family === "transform" && n.kind.type === "map";
14108
- const cfg = n.config ?? {};
14109
- return ` <shape name="${n.name ?? `shape${i + 1}`}" shapetype="${n.kind.family}">
14110
- <configuration>${isConnector ? `
14111
- <connectoraction connectorType="${n.kind.type}" connectionAlias="${cfg.connection?.alias}" operationAlias="${cfg.operation?.alias}">
14112
- <parameters/>
14113
- </connectoraction>` : isMap ? `
14114
- <map action="transform" mapAlias="${cfg.map?.alias}"/>` : ""}
14115
- </configuration>
14116
- </shape>`;
14117
- }).join("\n");
14118
- const edges = pkg.graph.edges.map(
14119
- (e) => ` <edge from="${e.from.node}:${e.from.port}" to="${e.to.node}:${e.to.port}" label="${e.meta?.label ?? ""}" identifier="${e.meta?.branchIdentifier ?? ""}"/>`
14120
- ).join("\n");
14121
- const processXml = `<?xml version="1.0"?>
14122
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" type="process" name="${pkg.graph.name}">
14123
- <bns:object>
14124
- <process>
14125
- <shapes>
14126
- ${shapes}
14127
- </shapes>
14128
- <edges>
14129
- ${edges}
14130
- </edges>
14131
- </process>
14132
- </bns:object>
14133
- </bns:ApiComponent>`;
14134
- return { processXml, componentXmls };
14135
- }
14136
- function renderJsonProfileXML(p) {
14137
- if (p.raw) return p.raw;
14138
- const rootKey = p.root?.key ?? "1";
14139
- const rootName = p.root?.name ?? "Root";
14140
- const rootDataType = p.root?.dataType ?? "character";
14141
- const rootIsMappable = p.root?.isMappable ?? false;
14142
- const rootIsNode = p.root?.isNode ?? true;
14143
- const objKey = p.object?.key ?? "2";
14144
- const objName = p.object?.name ?? "Object";
14145
- const objIsMappable = p.object?.isMappable ?? false;
14146
- const objIsNode = p.object?.isNode ?? true;
14147
- const entries = (p.object?.entries ?? []).map((e) => {
14148
- const k = esc(e.key);
14149
- const nm = esc(e.name);
14150
- const dt = esc(e.dataType ?? "character");
14151
- const mappable = e.isMappable ?? true;
14152
- const isNode = e.isNode ?? true;
14153
- return ` <JSONObjectEntry dataType="${dt}" isMappable="${mappable}" isNode="${isNode}" key="${k}" name="${nm}">
14154
- <DataFormat>
14155
- <ProfileCharacterFormat/>
14156
- </DataFormat>
14157
- <Qualifiers>
14158
- <QualifierList/>
14159
- </Qualifiers>
14160
- </JSONObjectEntry>`;
14161
- }).join("\n");
14162
- return `<?xml version="1.0"?>
14163
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" type="profile.json" name="">
14164
- <bns:object>
14165
- <JSONProfile xmlns="">
14166
- <DataElements>
14167
- <JSONRootValue dataType="${rootDataType}" isMappable="${rootIsMappable}" isNode="${rootIsNode}" key="${esc(rootKey)}" name="${esc(rootName)}">
14168
- <DataFormat>
14169
- <ProfileCharacterFormat/>
14170
- </DataFormat>
14171
- <JSONObject isMappable="${objIsMappable}" isNode="${objIsNode}" key="${esc(objKey)}" name="${esc(objName)}">
14172
- ${entries}
14173
- </JSONObject>
14174
- <Qualifiers>
14175
- <QualifierList/>
14176
- </Qualifiers>
14177
- </JSONRootValue>
14178
- </DataElements>
14179
- <tagLists/>
14180
- </JSONProfile>
14181
- </bns:object>
14182
- </bns:ApiComponent>`;
14183
- }
14184
-
14185
- // lib/services/helpers.ts
14186
- function extractIdAndVersion(xml) {
14187
- const id = xml.match(/\bcomponentId="([^"]+)"/)?.[1];
14188
- if (!id) throw new Error("createComponent: componentId not found in response XML");
14189
- const version = xml.match(/\bversion="([^"]+)"/)?.[1] ?? "";
14190
- return { componentId: id, version };
14191
- }
14192
- function resolveMapXmlAliases(xml, idByAlias) {
14193
- return xml.replace(
14194
- /\b(fromProfile|toProfile)="ALIAS:([^"]+)"/g,
14195
- (_, attr, alias) => `${attr}="${idByAlias[alias] ?? (() => {
14196
- throw new Error(`Missing ID for alias ${alias} used in Map`);
14197
- })()}"`
14198
- );
14199
- }
14200
- function resolveProcessXmlAliases(xml, idByAlias) {
14201
- let out = xml;
14202
- out = out.replace(
14203
- /\bconnectionAlias="([^"]+)"/g,
14204
- (_, alias) => `connectionId="${idByAlias[alias] ?? (() => {
14205
- throw new Error(`Missing ID for connection alias ${alias}`);
14206
- })()}"`
14207
- ).replace(
14208
- /\boperationAlias="([^"]+)"/g,
14209
- (_, alias) => `operationId="${idByAlias[alias] ?? (() => {
14210
- throw new Error(`Missing ID for operation alias ${alias}`);
14211
- })()}"`
14212
- );
14213
- out = out.replace(
14214
- /\bmapAlias="([^"]+)"/g,
14215
- (_, alias) => `mapId="${idByAlias[alias] ?? (() => {
14216
- throw new Error(`Missing ID for map alias ${alias}`);
14217
- })()}"`
14218
- );
14219
- return out;
14220
- }
14221
- function asXmlString(resp) {
14222
- if (typeof resp === "string") return resp;
14223
- const maybe = resp?.xml ?? resp?.data ?? resp?.body;
14224
- return typeof maybe === "string" ? maybe : String(resp);
14225
- }
14226
-
14227
- // lib/core/XmlClient.ts
14228
- function makeEmbedKitClient(services) {
14229
- return {
14230
- async createComponent(xml) {
14231
- const resp = await services.component.createComponent(xml);
14232
- const xmlText = asXmlString(resp);
14233
- return extractIdAndVersion(xmlText);
14234
- }
14235
- };
14236
- }
14237
-
14238
- // lib/services/AutomationService.ts
14239
- function postOrder(components) {
14240
- const weight = (c) => {
14241
- if (c.kind?.startsWith("profile.")) return 10;
14242
- if (c.kind === "transform.map") return 20;
14243
- if (c.kind === "connector-settings") return 30;
14244
- if (c.kind === "connector-operation") return 40;
14245
- return 50;
14246
- };
14247
- return [...components].sort((a, b) => weight(a) - weight(b));
14248
- }
14249
- async function createInBoomiFromAutomation(pkg, boomi) {
14250
- const { componentXmls, processXml } = compileAutomation(pkg);
14251
- const idByAlias = {};
14252
- const created = {};
14253
- const ordered = postOrder(componentXmls);
14254
- for (const c of ordered) {
14255
- let xmlToSend = c.xml;
14256
- if (c.kind === "transform.map") {
14257
- xmlToSend = resolveMapXmlAliases(xmlToSend, idByAlias);
14258
- }
14259
- const { componentId, version } = await boomi.createComponent(xmlToSend);
14260
- idByAlias[c.alias] = componentId;
14261
- created[c.alias] = { id: componentId, version, kind: c.kind, subType: c.subType };
14262
- }
14263
- const processXmlResolved = resolveProcessXmlAliases(processXml, idByAlias);
14264
- const { componentId: processId, version: processVersion } = await boomi.createComponent(processXmlResolved);
14265
- return { processId, processVersion, componentIds: created };
14266
- }
14267
13631
  export {
14268
13632
  AS2CommunicationOptions,
14269
13633
  AS2ConnectorRecordGroupingExpression,
@@ -14535,6 +13899,8 @@ export {
14535
13899
  OFTP2ConnectorRecordGroupingExpression,
14536
13900
  OFTP2ConnectorRecordSimpleExpression,
14537
13901
  OFTPCommunicationOptions,
13902
+ Oauth2UrlGroupingExpression,
13903
+ Oauth2UrlSimpleExpression,
14538
13904
  OdetteConnectorRecordService,
14539
13905
  OdetteOptions,
14540
13906
  OdetteUNBControlInfo,
@@ -14643,26 +14009,6 @@ export {
14643
14009
  X12ConnectorRecordGroupingExpression,
14644
14010
  X12ConnectorRecordService,
14645
14011
  X12ConnectorRecordSimpleExpression,
14646
- X12Options,
14647
- branch,
14648
- compileAutomation,
14649
- connectorNode,
14650
- createInBoomiFromAutomation,
14651
- decision,
14652
- defineAutomation,
14653
- docProps,
14654
- ffElement,
14655
- ffElementsGroup,
14656
- ffRecord,
14657
- fn,
14658
- m,
14659
- makeEmbedKitClient,
14660
- mapNode,
14661
- mapNodeByAlias,
14662
- notify,
14663
- returnDocs,
14664
- seq,
14665
- start,
14666
- stop
14012
+ X12Options
14667
14013
  };
14668
14014
  //# sourceMappingURL=index.js.map