@boomi/embedkit-sdk 1.1.2 → 1.1.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/index.cjs CHANGED
@@ -307,6 +307,8 @@ __export(lib_exports, {
307
307
  OFTP2ConnectorRecordGroupingExpression: () => OFTP2ConnectorRecordGroupingExpression,
308
308
  OFTP2ConnectorRecordSimpleExpression: () => OFTP2ConnectorRecordSimpleExpression,
309
309
  OFTPCommunicationOptions: () => OFTPCommunicationOptions,
310
+ Oauth2UrlGroupingExpression: () => Oauth2UrlGroupingExpression,
311
+ Oauth2UrlSimpleExpression: () => Oauth2UrlSimpleExpression,
310
312
  OdetteConnectorRecordService: () => OdetteConnectorRecordService,
311
313
  OdetteOptions: () => OdetteOptions,
312
314
  OdetteUNBControlInfo: () => OdetteUNBControlInfo,
@@ -415,27 +417,7 @@ __export(lib_exports, {
415
417
  X12ConnectorRecordGroupingExpression: () => X12ConnectorRecordGroupingExpression,
416
418
  X12ConnectorRecordService: () => X12ConnectorRecordService,
417
419
  X12ConnectorRecordSimpleExpression: () => X12ConnectorRecordSimpleExpression,
418
- X12Options: () => X12Options,
419
- branch: () => branch,
420
- compileAutomation: () => compileAutomation,
421
- connectorNode: () => connectorNode,
422
- createInBoomiFromAutomation: () => createInBoomiFromAutomation,
423
- decision: () => decision,
424
- defineAutomation: () => defineAutomation,
425
- docProps: () => docProps,
426
- ffElement: () => ffElement,
427
- ffElementsGroup: () => ffElementsGroup,
428
- ffRecord: () => ffRecord,
429
- fn: () => fn,
430
- m: () => m,
431
- makeEmbedKitClient: () => makeEmbedKitClient,
432
- mapNode: () => mapNode,
433
- mapNodeByAlias: () => mapNodeByAlias,
434
- notify: () => notify,
435
- returnDocs: () => returnDocs,
436
- seq: () => seq,
437
- start: () => start,
438
- stop: () => stop
420
+ X12Options: () => X12Options
439
421
  });
440
422
  module.exports = __toCommonJS(lib_exports);
441
423
 
@@ -4712,6 +4694,25 @@ var EnvironmentExtensionsService = class {
4712
4694
  }
4713
4695
  });
4714
4696
  }
4697
+ /**
4698
+ * Queries for an EnvironmentExtensions object(s)
4699
+ * 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).
4700
+ * @param requestBody Possible properties include: environmentId, extensionGroupId
4701
+ * @returns EnvironmentExtensionsQueryResponse Successful request and response.
4702
+ * @throws ApiError
4703
+ */
4704
+ queryOauth2Url(requestBody) {
4705
+ return this.httpRequest.request({
4706
+ method: "POST",
4707
+ url: "/EnvironmentOAuth2AccessTokenExtensionGenerationRequest/execute",
4708
+ body: requestBody,
4709
+ mediaType: "application/json",
4710
+ errors: {
4711
+ 403: `Missing or incorrect authentication credentials.
4712
+ 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)`
4713
+ }
4714
+ });
4715
+ }
4715
4716
  };
4716
4717
 
4717
4718
  // lib/services/EnvironmentMapExtensionService.ts
@@ -12305,6 +12306,45 @@ var MergeRequestSimpleExpression;
12305
12306
  })(operator = MergeRequestSimpleExpression2.operator || (MergeRequestSimpleExpression2.operator = {}));
12306
12307
  })(MergeRequestSimpleExpression || (MergeRequestSimpleExpression = {}));
12307
12308
 
12309
+ // lib/models/Oauth2UrlGroupingExpression.ts
12310
+ var Oauth2UrlGroupingExpression;
12311
+ ((Oauth2UrlGroupingExpression2) => {
12312
+ let operator;
12313
+ ((operator2) => {
12314
+ operator2["AND"] = "and";
12315
+ operator2["OR"] = "or";
12316
+ })(operator = Oauth2UrlGroupingExpression2.operator || (Oauth2UrlGroupingExpression2.operator = {}));
12317
+ })(Oauth2UrlGroupingExpression || (Oauth2UrlGroupingExpression = {}));
12318
+
12319
+ // lib/models/Oauth2UrlSimpleExpression.ts
12320
+ var Oauth2UrlSimpleExpression;
12321
+ ((Oauth2UrlSimpleExpression2) => {
12322
+ let operator;
12323
+ ((operator2) => {
12324
+ operator2["EQUALS"] = "EQUALS";
12325
+ operator2["LIKE"] = "LIKE";
12326
+ operator2["NOT_EQUALS"] = "NOT_EQUALS";
12327
+ operator2["IS_NULL"] = "IS_NULL";
12328
+ operator2["IS_NOT_NULL"] = "IS_NOT_NULL";
12329
+ operator2["BETWEEN"] = "BETWEEN";
12330
+ operator2["GREATER_THAN"] = "GREATER_THAN";
12331
+ operator2["GREATER_THAN_OR_EQUAL"] = "GREATER_THAN_OR_EQUAL";
12332
+ operator2["LESS_THAN"] = "LESS_THAN";
12333
+ operator2["LESS_THAN_OR_EQUAL"] = "LESS_THAN_OR_EQUAL";
12334
+ operator2["CONTAINS"] = "CONTAINS";
12335
+ operator2["NOT_CONTAINS"] = "NOT_CONTAINS";
12336
+ })(operator = Oauth2UrlSimpleExpression2.operator || (Oauth2UrlSimpleExpression2.operator = {}));
12337
+ let property;
12338
+ ((property2) => {
12339
+ property2["ENVIRONMENT_ID"] = "environmentId";
12340
+ property2["EXTENSION_GROUP_ID"] = "extensionGroupId";
12341
+ property2["CONNECTION_ID"] = "connectionId";
12342
+ property2["OAUTH_FIELD_ID"] = "oAuthFieldId";
12343
+ property2["CLIENT_ID"] = "clientId";
12344
+ property2["CLIENT_SECRET"] = "clientSecret";
12345
+ })(property = Oauth2UrlSimpleExpression2.property || (Oauth2UrlSimpleExpression2.property = {}));
12346
+ })(Oauth2UrlSimpleExpression || (Oauth2UrlSimpleExpression = {}));
12347
+
12308
12348
  // lib/models/ODETTEConnectorRecordGroupingExpression.ts
12309
12349
  var ODETTEConnectorRecordGroupingExpression;
12310
12350
  ((ODETTEConnectorRecordGroupingExpression2) => {
@@ -14003,700 +14043,6 @@ var X12Options;
14003
14043
  outboundValidationOption2["FAIL_ALL"] = "failAll";
14004
14044
  })(outboundValidationOption = X12Options2.outboundValidationOption || (X12Options2.outboundValidationOption = {}));
14005
14045
  })(X12Options || (X12Options = {}));
14006
-
14007
- // lib/automation/graph/builder.ts
14008
- var nid = 0;
14009
- var eid = 0;
14010
- var nextN = (p = "n") => `${p}_${++nid}`;
14011
- var nextE = () => `e_${++eid}`;
14012
- var GraphBuilder = class {
14013
- constructor(name, gid = nextN("g")) {
14014
- this.name = name;
14015
- this.gid = gid;
14016
- this.nodes = [];
14017
- this.edges = [];
14018
- }
14019
- /** Add a new node to the graph */
14020
- add(spec) {
14021
- const node = { id: this._nextId(), ...spec };
14022
- this.nodes.push(node);
14023
- const handle = {
14024
- id: node.id,
14025
- node,
14026
- in: (p) => ({ node: node.id, port: p }),
14027
- out: (p) => ({ node: node.id, port: p })
14028
- };
14029
- return handle;
14030
- }
14031
- /** Flow helpers (flow.ts) call this; accept edge without id and assign one */
14032
- addEdge(edge) {
14033
- this.edges.push({ id: nextE(), ...edge });
14034
- }
14035
- /** Optional explicit connector that also assigns an id */
14036
- connect(from, to, meta) {
14037
- this.edges.push({ id: nextE(), from, to, meta });
14038
- }
14039
- /** Finalize to a JSON BPG object */
14040
- toJSON() {
14041
- return {
14042
- id: this.gid,
14043
- name: this.name,
14044
- nodes: this.nodes,
14045
- edges: this.edges
14046
- };
14047
- }
14048
- /** Internal node id generator */
14049
- _nextId() {
14050
- return nextN("n");
14051
- }
14052
- };
14053
-
14054
- // lib/automation/automation.ts
14055
- function defineAutomation(fn2) {
14056
- const components = [];
14057
- let graph = null;
14058
- const api = {
14059
- component: (c) => {
14060
- components.push(c);
14061
- },
14062
- process: (name, build) => {
14063
- const g = new GraphBuilder(name);
14064
- build(g);
14065
- graph = g.toJSON();
14066
- }
14067
- };
14068
- fn2(api);
14069
- if (!graph) throw new Error("No process graph defined. Call b.process(...)");
14070
- const catalog = { components };
14071
- return { graph, catalog };
14072
- }
14073
-
14074
- // lib/automation/graph/flow.ts
14075
- function metaFor(port4) {
14076
- if (port4 === "true") return { label: "True", branchIdentifier: "true" };
14077
- if (port4 === "false") return { label: "False", branchIdentifier: "false" };
14078
- if (/^\d+$/.test(port4)) return { label: port4, branchIdentifier: port4 };
14079
- return void 0;
14080
- }
14081
- function add(g, from, fromPort, to, toPort) {
14082
- g.addEdge({
14083
- from: { node: from.id, port: fromPort },
14084
- to: { node: to.id, port: toPort },
14085
- meta: metaFor(fromPort)
14086
- });
14087
- }
14088
- function makeChain(g, current, outPort = "main") {
14089
- return {
14090
- to(next) {
14091
- add(g, current, outPort, next, "main");
14092
- return makeChain(g, next, "main");
14093
- },
14094
- if(decisionNode, routes) {
14095
- add(g, current, outPort, decisionNode, "main");
14096
- const trueChain = {
14097
- to(next) {
14098
- add(g, decisionNode, "true", next, "main");
14099
- return makeChain(g, next, "main");
14100
- },
14101
- if: (dn, nested) => {
14102
- add(g, decisionNode, "true", dn, "main");
14103
- const tTrue = { to(n) {
14104
- add(g, dn, "true", n, "main");
14105
- return makeChain(g, n, "main");
14106
- }, if: this.if, branch: this.branch };
14107
- const tFalse = { to(n) {
14108
- add(g, dn, "false", n, "main");
14109
- return makeChain(g, n, "main");
14110
- }, if: this.if, branch: this.branch };
14111
- nested({ onTrue: tTrue, onFalse: tFalse });
14112
- return makeChain(g, dn, "main");
14113
- },
14114
- branch: (brNode, table) => {
14115
- add(g, decisionNode, "true", brNode, "main");
14116
- for (const [exitKey, go] of Object.entries(table)) {
14117
- const exit = exitKey;
14118
- const exitChain = {
14119
- to(n) {
14120
- add(g, brNode, exit, n, "main");
14121
- return makeChain(g, n, "main");
14122
- },
14123
- if: (dn, cb) => this.if(dn, cb),
14124
- branch: (bn, tb) => this.branch(bn, tb)
14125
- };
14126
- go(exitChain);
14127
- }
14128
- return makeChain(g, brNode, "main");
14129
- }
14130
- };
14131
- const falseChain = {
14132
- to(next) {
14133
- add(g, decisionNode, "false", next, "main");
14134
- return makeChain(g, next, "main");
14135
- },
14136
- if: (dn, nested) => {
14137
- add(g, decisionNode, "false", dn, "main");
14138
- const fTrue = { to(n) {
14139
- add(g, dn, "true", n, "main");
14140
- return makeChain(g, n, "main");
14141
- }, if: this.if, branch: this.branch };
14142
- const fFalse = { to(n) {
14143
- add(g, dn, "false", n, "main");
14144
- return makeChain(g, n, "main");
14145
- }, if: this.if, branch: this.branch };
14146
- nested({ onTrue: fTrue, onFalse: fFalse });
14147
- return makeChain(g, dn, "main");
14148
- },
14149
- branch: (brNode, table) => {
14150
- add(g, decisionNode, "false", brNode, "main");
14151
- for (const [exitKey, go] of Object.entries(table)) {
14152
- const exit = exitKey;
14153
- const exitChain = {
14154
- to(n) {
14155
- add(g, brNode, exit, n, "main");
14156
- return makeChain(g, n, "main");
14157
- },
14158
- if: (dn, cb) => this.if(dn, cb),
14159
- branch: (bn, tb) => this.branch(bn, tb)
14160
- };
14161
- go(exitChain);
14162
- }
14163
- return makeChain(g, brNode, "main");
14164
- }
14165
- };
14166
- routes({ onTrue: trueChain, onFalse: falseChain });
14167
- return makeChain(g, decisionNode, "main");
14168
- },
14169
- branch(branchNode, table) {
14170
- add(g, current, outPort, branchNode, "main");
14171
- for (const [exitKey, go] of Object.entries(table)) {
14172
- const exit = exitKey;
14173
- const exitChain = {
14174
- to(n) {
14175
- add(g, branchNode, exit, n, "main");
14176
- return makeChain(g, n, "main");
14177
- },
14178
- if: (dn, cb) => {
14179
- add(g, branchNode, exit, dn, "main");
14180
- const t = {
14181
- to(n) {
14182
- add(g, dn, "true", n, "main");
14183
- return makeChain(g, n, "main");
14184
- },
14185
- if: (inner, cb2) => this.if(inner, cb2),
14186
- branch: (bn, tb) => this.branch(bn, tb)
14187
- };
14188
- const f = {
14189
- to(n) {
14190
- add(g, dn, "false", n, "main");
14191
- return makeChain(g, n, "main");
14192
- },
14193
- if: (inner, cb2) => this.if(inner, cb2),
14194
- branch: (bn, tb) => this.branch(bn, tb)
14195
- };
14196
- cb({ onTrue: t, onFalse: f });
14197
- return makeChain(g, dn, "main");
14198
- },
14199
- branch: (bn, tb) => {
14200
- add(g, branchNode, exit, bn, "main");
14201
- for (const [exKey, go2] of Object.entries(tb)) {
14202
- const ex = exKey;
14203
- const exChain = {
14204
- to(n) {
14205
- add(g, bn, ex, n, "main");
14206
- return makeChain(g, n, "main");
14207
- },
14208
- if: (dn, cb2) => this.if(dn, cb2),
14209
- branch: (bn2, tb2) => this.branch(bn2, tb2)
14210
- };
14211
- go2(exChain);
14212
- }
14213
- return makeChain(g, bn, "main");
14214
- }
14215
- };
14216
- go(exitChain);
14217
- }
14218
- return makeChain(g, branchNode, "main");
14219
- }
14220
- };
14221
- }
14222
- function seq(g, start2) {
14223
- return makeChain(g, start2, "main");
14224
- }
14225
-
14226
- // lib/automation/stdlib/index.ts
14227
- var port = (id, direction, label) => ({ id, name: id, direction, label });
14228
- var start = (name = "Start") => ({
14229
- name,
14230
- kind: { family: "start", type: "passthrough" },
14231
- ports: [port("main", "out")]
14232
- });
14233
- var docProps = (name, cfg) => ({
14234
- name,
14235
- kind: { family: "doc", type: "properties" },
14236
- ports: [port("main", "in"), port("main", "out")],
14237
- config: cfg
14238
- });
14239
- var decision = (name = "Decision", cfg) => ({
14240
- name,
14241
- kind: { family: "decision", type: "compare" },
14242
- ports: [port("main", "in"), port("true", "out", "True"), port("false", "out", "False")],
14243
- config: cfg
14244
- });
14245
- var branch = (name = "Branch", n = 2) => ({
14246
- name,
14247
- kind: { family: "control", type: "branch" },
14248
- ports: [port("main", "in"), ...Array.from({ length: n }, (_, i) => port(String(i + 1), "out", String(i + 1)))]
14249
- });
14250
- var mapNode = (name = "Map", cfg) => ({
14251
- name,
14252
- kind: { family: "transform", type: "map" },
14253
- ports: [port("main", "in"), port("main", "out")],
14254
- config: cfg
14255
- });
14256
- var notify = (name = "Notify", cfg) => ({
14257
- name,
14258
- kind: { family: "notify", type: "message" },
14259
- ports: [port("main", "in"), port("main", "out")],
14260
- config: cfg
14261
- });
14262
- var returnDocs = (name = "Return") => ({
14263
- name,
14264
- kind: { family: "return", type: "returndocuments" },
14265
- ports: [port("main", "in")]
14266
- });
14267
- var stop = (name = "Stop", cfg = { continue: true }) => ({
14268
- name,
14269
- kind: { family: "stop", type: "stop" },
14270
- ports: [port("main", "in")],
14271
- config: cfg
14272
- });
14273
-
14274
- // lib/automation/stdlib/map.ts
14275
- var port2 = (id, direction, label) => ({ id, name: id, direction, label });
14276
- function mapNodeByAlias(name, cfg) {
14277
- return {
14278
- name,
14279
- kind: { family: "transform", type: "map" },
14280
- ports: [port2("main", "in"), port2("main", "out")],
14281
- config: cfg
14282
- };
14283
- }
14284
-
14285
- // lib/automation/stdlib/connector.ts
14286
- var port3 = (id, direction, label) => ({
14287
- id,
14288
- name: id,
14289
- // keep a human-friendly port name
14290
- direction,
14291
- // must match type definition
14292
- label
14293
- // optional display label
14294
- });
14295
- function connectorNode(name, connectorType, cfg) {
14296
- return {
14297
- name,
14298
- kind: { family: "connector", type: connectorType },
14299
- ports: [
14300
- port3("main", "in"),
14301
- port3("main", "out")
14302
- ],
14303
- config: cfg
14304
- };
14305
- }
14306
-
14307
- // lib/automation/catalog/map.helpers.ts
14308
- var fn = {
14309
- propertyGet(key, name, position, opts, xy) {
14310
- return {
14311
- key,
14312
- name,
14313
- category: "ProcessProperty",
14314
- type: "PropertyGet",
14315
- position,
14316
- x: xy?.x,
14317
- y: xy?.y,
14318
- inputs: [
14319
- { key: "1", name: "Property Name", default: opts.propertyName },
14320
- { key: "2", name: "Default Value", default: opts.defaultValue ?? "" }
14321
- ],
14322
- outputs: [{ key: "3", name: "Result" }],
14323
- configurationXml: "<Configuration/>",
14324
- cacheEnabled: true,
14325
- cacheOption: "none",
14326
- sumEnabled: false
14327
- };
14328
- },
14329
- documentPropertyGet(key, outputName, position, propertyId, propertyName, xy) {
14330
- return {
14331
- key,
14332
- name: "Get Document Property",
14333
- category: "ProcessProperty",
14334
- type: "DocumentPropertyGet",
14335
- position,
14336
- x: xy?.x,
14337
- y: xy?.y,
14338
- inputs: [],
14339
- outputs: [{ key: "3", name: outputName }],
14340
- configurationXml: `
14341
- <Configuration>
14342
- <DocumentProperty defaultValue="" persist="false" propertyId="${propertyId}" propertyName="${propertyName}"/>
14343
- </Configuration>`.trim(),
14344
- cacheEnabled: true,
14345
- sumEnabled: false
14346
- };
14347
- }
14348
- };
14349
- var m = {
14350
- fromFnToProfile(fromFunction, fromKey, toKey, toKeyPath, toNamePath) {
14351
- return {
14352
- fromFunction,
14353
- fromKey,
14354
- fromType: "function",
14355
- toKey,
14356
- toKeyPath,
14357
- toNamePath,
14358
- toType: "profile"
14359
- };
14360
- }
14361
- };
14362
-
14363
- // lib/automation/catalog/profiles/flatfile.helpers.ts
14364
- function ffElement(params) {
14365
- return {
14366
- dataType: "character",
14367
- isMappable: true,
14368
- isNode: true,
14369
- enforceUnique: false,
14370
- identityValue: "",
14371
- justification: "left",
14372
- mandatory: false,
14373
- minLength: 0,
14374
- maxLength: 0,
14375
- useToIdentifyFormat: false,
14376
- validateData: false,
14377
- ...params
14378
- };
14379
- }
14380
- function ffElementsGroup(params) {
14381
- return {
14382
- isNode: true,
14383
- ...params
14384
- };
14385
- }
14386
- function ffRecord(params) {
14387
- return {
14388
- isNode: true,
14389
- detectFormat: "numberofcolumns",
14390
- ...params
14391
- };
14392
- }
14393
-
14394
- // lib/automation/compiler/compile.ts
14395
- function esc(s) {
14396
- return String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
14397
- }
14398
- var typeMap = (k) => k === "connector-operation" ? "connector-action" : k;
14399
- function attrs(r) {
14400
- return Object.entries(r).filter(([, v]) => v !== void 0).map(([k, v]) => `${k}="${String(v)}"`).join(" ");
14401
- }
14402
- function emitMapping(mp) {
14403
- return ` <Mapping fromFunction="${mp.fromFunction}" fromKey="${mp.fromKey}" fromType="${mp.fromType}" toKey="${mp.toKey}" toKeyPath="${mp.toKeyPath}" toNamePath="${mp.toNamePath}" toType="${mp.toType}"/>`;
14404
- }
14405
- function componentToXml(c) {
14406
- const xmlType = typeMap(c.kind);
14407
- const a = attrs({ type: xmlType, subType: c.subType, name: c.name });
14408
- if (c.kind === "connector-settings" && c.subType === "http") {
14409
- const s = c.config;
14410
- return `<?xml version="1.0"?>
14411
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" ${a}>
14412
- <bns:object>
14413
- <HttpSettings authenticationType="${s.authenticationType}" url="${s.url}">
14414
- <AuthSettings${s.AuthSettings?.user ? ` user="${s.AuthSettings.user}"` : ""}/>
14415
- <OAuth2Settings${s.OAuth2Settings?.grantType ? ` grantType="${s.OAuth2Settings.grantType}"` : ""}/>
14416
- <SSLOptions${s.SSLOptions?.clientauth !== void 0 ? ` clientauth="${s.SSLOptions.clientauth}"` : ""}${s.SSLOptions?.trustServerCert !== void 0 ? ` trustServerCert="${s.SSLOptions.trustServerCert}"` : ""}/>
14417
- </HttpSettings>
14418
- </bns:object>
14419
- </bns:ApiComponent>`;
14420
- }
14421
- if (c.kind === "connector-operation" && c.subType === "http") {
14422
- const o = c.config;
14423
- return `<?xml version="1.0"?>
14424
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" ${a}>
14425
- <bns:object>
14426
- <Operation>
14427
- <Configuration>
14428
- <HttpSendAction methodType="${o.method}" dataContentType="${o.dataContentType}" followRedirects="${o.followRedirects}"
14429
- returnErrors="${o.returnErrors}" returnResponses="${o.returnResponses}"
14430
- requestProfileType="${o.requestProfileType}" responseProfileType="${o.responseProfileType}">
14431
- <requestHeaders/>
14432
- <pathElements>${(o.pathElements || []).map((e) => `<element isVariable="${e.isVariable}" key="${e.key}" name="${e.name}"/>`).join("")}</pathElements>
14433
- <responseHeaderMapping/>
14434
- </HttpSendAction>
14435
- </Configuration>
14436
- </Operation>
14437
- </bns:object>
14438
- </bns:ApiComponent>`;
14439
- }
14440
- if (c.kind === "transform.map") {
14441
- const cfg = c.config;
14442
- const mappingsXml = (cfg.mappings ?? []).map(emitMapping).join("\n");
14443
- const functionsXml = (cfg.functions ?? []).map((f) => {
14444
- const inputsXml = (f.inputs ?? []).map((i) => `<Input key="${i.key}" name="${i.name}"${i.default !== void 0 ? ` default="${i.default}"` : ""}/>`).join("");
14445
- const outputsXml = (f.outputs ?? []).map((o) => `<Output key="${o.key}" name="${o.name}"/>`).join("");
14446
- const pos = f.position !== void 0 ? ` position="${f.position}"` : "";
14447
- const xy = f.x !== void 0 && f.y !== void 0 ? ` x="${f.x}" y="${f.y}"` : "";
14448
- const cache = (f.cacheEnabled !== void 0 ? ` cacheEnabled="${f.cacheEnabled}"` : "") + (f.cacheOption ? ` cacheOption="${f.cacheOption}"` : "") + (f.sumEnabled !== void 0 ? ` sumEnabled="${f.sumEnabled}"` : "");
14449
- return ` <FunctionStep category="${f.category}" key="${f.key}" name="${f.name}" type="${f.type}"${pos}${xy}${cache}>
14450
- <Inputs>${inputsXml}</Inputs>
14451
- <Outputs>${outputsXml}</Outputs>
14452
- ${f.configurationXml ?? "<Configuration/>"}
14453
- </FunctionStep>`;
14454
- }).join("\n");
14455
- const optimize = cfg.optimizeExecutionOrder ?? true;
14456
- return `<?xml version="1.0"?>
14457
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" ${a}>
14458
- <bns:object>
14459
- <Map fromProfile="ALIAS:${cfg.fromProfile.alias}" toProfile="ALIAS:${cfg.toProfile.alias}">
14460
- <Mappings>
14461
- ${mappingsXml}
14462
- </Mappings>
14463
- <Functions optimizeExecutionOrder="${optimize}">
14464
- ${functionsXml}
14465
- </Functions>
14466
- <Defaults/>
14467
- <DocumentCacheJoins/>
14468
- </Map>
14469
- </bns:object>
14470
- </bns:ApiComponent>`;
14471
- }
14472
- if (c.kind === "profile.flatfile") {
14473
- const p = c.config;
14474
- if (p.raw) return p.raw;
14475
- const modelVersion = p.modelVersion ?? "2";
14476
- const strict = p.strict ?? true;
14477
- const gi = p.properties.generalInfo;
14478
- const opts = p.properties.options?.delimited;
14479
- const record = p.dataElements.record;
14480
- const group = record.elementsGroup;
14481
- const elementsXml = group.elements.map((el) => `
14482
- <FlatFileElement dataType="${el.dataType ?? "character"}"
14483
- enforceUnique="${!!el.enforceUnique}"
14484
- identityValue="${el.identityValue ?? ""}"
14485
- isMappable="${el.isMappable ?? true}"
14486
- isNode="${el.isNode ?? true}"
14487
- justification="${el.justification ?? "left"}"
14488
- key="${el.key}"
14489
- mandatory="${!!el.mandatory}"
14490
- maxLength="${el.maxLength ?? 0}"
14491
- minLength="${el.minLength ?? 0}"
14492
- name="${esc(el.name)}"
14493
- useToIdentifyFormat="${!!el.useToIdentifyFormat}"
14494
- validateData="${!!el.validateData}">
14495
- <DataFormat>
14496
- <ProfileCharacterFormat/>
14497
- </DataFormat>
14498
- </FlatFileElement>`).join("\n");
14499
- return `<?xml version="1.0"?>
14500
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" ${attrs({ type: "profile.flatfile", name: c.name })}>
14501
- <bns:object>
14502
- <FlatFileProfile xmlns="" modelVersion="${modelVersion}" strict="${strict}">
14503
- <ProfileProperties>
14504
- <GeneralInfo fileType="${gi.fileType}" useColumnHeaders="${!!gi.useColumnHeaders}"/>
14505
- <Options>
14506
- <DataOptions/>
14507
- ${opts ? `<DelimitedOptions fileDelimiter="${opts.fileDelimiter}" removeEscape="${!!opts.removeEscape}" textQualifier="${opts.textQualifier ?? "na"}"/>` : "<DelimitedOptions/>"}
14508
- </Options>
14509
- </ProfileProperties>
14510
- <DataElements>
14511
- <FlatFileRecord detectFormat="${record.detectFormat ?? "numberofcolumns"}" isNode="${record.isNode ?? true}" key="${record.key}" name="${esc(record.name)}">
14512
- <FlatFileElements isNode="${group.isNode ?? true}" key="${group.key}" name="${esc(group.name)}">
14513
- ${elementsXml}
14514
- </FlatFileElements>
14515
- </FlatFileRecord>
14516
- </DataElements>
14517
- </FlatFileProfile>
14518
- </bns:object>
14519
- </bns:ApiComponent>`;
14520
- }
14521
- if (c.kind === "profile.json") {
14522
- const cfg = c.config;
14523
- if (!cfg.raw) {
14524
- const inner = renderJsonProfileXML(cfg).replace(/<bns:ApiComponent[^>]*name=""/, `<bns:ApiComponent ${a}`);
14525
- return inner;
14526
- }
14527
- return cfg.raw;
14528
- }
14529
- return `<?xml version="1.0"?><bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" ${a}/>`;
14530
- }
14531
- function compileAutomation(pkg) {
14532
- const componentXmls = pkg.catalog.components.map((c) => ({
14533
- alias: c.alias,
14534
- kind: c.kind,
14535
- subType: c.subType,
14536
- xml: componentToXml(c)
14537
- }));
14538
- const shapes = pkg.graph.nodes.map((n, i) => {
14539
- const isConnector = n.kind.family === "connector";
14540
- const isMap = n.kind.family === "transform" && n.kind.type === "map";
14541
- const cfg = n.config ?? {};
14542
- return ` <shape name="${n.name ?? `shape${i + 1}`}" shapetype="${n.kind.family}">
14543
- <configuration>${isConnector ? `
14544
- <connectoraction connectorType="${n.kind.type}" connectionAlias="${cfg.connection?.alias}" operationAlias="${cfg.operation?.alias}">
14545
- <parameters/>
14546
- </connectoraction>` : isMap ? `
14547
- <map action="transform" mapAlias="${cfg.map?.alias}"/>` : ""}
14548
- </configuration>
14549
- </shape>`;
14550
- }).join("\n");
14551
- const edges = pkg.graph.edges.map(
14552
- (e) => ` <edge from="${e.from.node}:${e.from.port}" to="${e.to.node}:${e.to.port}" label="${e.meta?.label ?? ""}" identifier="${e.meta?.branchIdentifier ?? ""}"/>`
14553
- ).join("\n");
14554
- const processXml = `<?xml version="1.0"?>
14555
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" type="process" name="${pkg.graph.name}">
14556
- <bns:object>
14557
- <process>
14558
- <shapes>
14559
- ${shapes}
14560
- </shapes>
14561
- <edges>
14562
- ${edges}
14563
- </edges>
14564
- </process>
14565
- </bns:object>
14566
- </bns:ApiComponent>`;
14567
- return { processXml, componentXmls };
14568
- }
14569
- function renderJsonProfileXML(p) {
14570
- if (p.raw) return p.raw;
14571
- const rootKey = p.root?.key ?? "1";
14572
- const rootName = p.root?.name ?? "Root";
14573
- const rootDataType = p.root?.dataType ?? "character";
14574
- const rootIsMappable = p.root?.isMappable ?? false;
14575
- const rootIsNode = p.root?.isNode ?? true;
14576
- const objKey = p.object?.key ?? "2";
14577
- const objName = p.object?.name ?? "Object";
14578
- const objIsMappable = p.object?.isMappable ?? false;
14579
- const objIsNode = p.object?.isNode ?? true;
14580
- const entries = (p.object?.entries ?? []).map((e) => {
14581
- const k = esc(e.key);
14582
- const nm = esc(e.name);
14583
- const dt = esc(e.dataType ?? "character");
14584
- const mappable = e.isMappable ?? true;
14585
- const isNode = e.isNode ?? true;
14586
- return ` <JSONObjectEntry dataType="${dt}" isMappable="${mappable}" isNode="${isNode}" key="${k}" name="${nm}">
14587
- <DataFormat>
14588
- <ProfileCharacterFormat/>
14589
- </DataFormat>
14590
- <Qualifiers>
14591
- <QualifierList/>
14592
- </Qualifiers>
14593
- </JSONObjectEntry>`;
14594
- }).join("\n");
14595
- return `<?xml version="1.0"?>
14596
- <bns:ApiComponent xmlns:bns="http://api.platform.boomi.com/" type="profile.json" name="">
14597
- <bns:object>
14598
- <JSONProfile xmlns="">
14599
- <DataElements>
14600
- <JSONRootValue dataType="${rootDataType}" isMappable="${rootIsMappable}" isNode="${rootIsNode}" key="${esc(rootKey)}" name="${esc(rootName)}">
14601
- <DataFormat>
14602
- <ProfileCharacterFormat/>
14603
- </DataFormat>
14604
- <JSONObject isMappable="${objIsMappable}" isNode="${objIsNode}" key="${esc(objKey)}" name="${esc(objName)}">
14605
- ${entries}
14606
- </JSONObject>
14607
- <Qualifiers>
14608
- <QualifierList/>
14609
- </Qualifiers>
14610
- </JSONRootValue>
14611
- </DataElements>
14612
- <tagLists/>
14613
- </JSONProfile>
14614
- </bns:object>
14615
- </bns:ApiComponent>`;
14616
- }
14617
-
14618
- // lib/services/helpers.ts
14619
- function extractIdAndVersion(xml) {
14620
- const id = xml.match(/\bcomponentId="([^"]+)"/)?.[1];
14621
- if (!id) throw new Error("createComponent: componentId not found in response XML");
14622
- const version = xml.match(/\bversion="([^"]+)"/)?.[1] ?? "";
14623
- return { componentId: id, version };
14624
- }
14625
- function resolveMapXmlAliases(xml, idByAlias) {
14626
- return xml.replace(
14627
- /\b(fromProfile|toProfile)="ALIAS:([^"]+)"/g,
14628
- (_, attr, alias) => `${attr}="${idByAlias[alias] ?? (() => {
14629
- throw new Error(`Missing ID for alias ${alias} used in Map`);
14630
- })()}"`
14631
- );
14632
- }
14633
- function resolveProcessXmlAliases(xml, idByAlias) {
14634
- let out = xml;
14635
- out = out.replace(
14636
- /\bconnectionAlias="([^"]+)"/g,
14637
- (_, alias) => `connectionId="${idByAlias[alias] ?? (() => {
14638
- throw new Error(`Missing ID for connection alias ${alias}`);
14639
- })()}"`
14640
- ).replace(
14641
- /\boperationAlias="([^"]+)"/g,
14642
- (_, alias) => `operationId="${idByAlias[alias] ?? (() => {
14643
- throw new Error(`Missing ID for operation alias ${alias}`);
14644
- })()}"`
14645
- );
14646
- out = out.replace(
14647
- /\bmapAlias="([^"]+)"/g,
14648
- (_, alias) => `mapId="${idByAlias[alias] ?? (() => {
14649
- throw new Error(`Missing ID for map alias ${alias}`);
14650
- })()}"`
14651
- );
14652
- return out;
14653
- }
14654
- function asXmlString(resp) {
14655
- if (typeof resp === "string") return resp;
14656
- const maybe = resp?.xml ?? resp?.data ?? resp?.body;
14657
- return typeof maybe === "string" ? maybe : String(resp);
14658
- }
14659
-
14660
- // lib/core/XmlClient.ts
14661
- function makeEmbedKitClient(services) {
14662
- return {
14663
- async createComponent(xml) {
14664
- const resp = await services.component.createComponent(xml);
14665
- const xmlText = asXmlString(resp);
14666
- return extractIdAndVersion(xmlText);
14667
- }
14668
- };
14669
- }
14670
-
14671
- // lib/services/AutomationService.ts
14672
- function postOrder(components) {
14673
- const weight = (c) => {
14674
- if (c.kind?.startsWith("profile.")) return 10;
14675
- if (c.kind === "transform.map") return 20;
14676
- if (c.kind === "connector-settings") return 30;
14677
- if (c.kind === "connector-operation") return 40;
14678
- return 50;
14679
- };
14680
- return [...components].sort((a, b) => weight(a) - weight(b));
14681
- }
14682
- async function createInBoomiFromAutomation(pkg, boomi) {
14683
- const { componentXmls, processXml } = compileAutomation(pkg);
14684
- const idByAlias = {};
14685
- const created = {};
14686
- const ordered = postOrder(componentXmls);
14687
- for (const c of ordered) {
14688
- let xmlToSend = c.xml;
14689
- if (c.kind === "transform.map") {
14690
- xmlToSend = resolveMapXmlAliases(xmlToSend, idByAlias);
14691
- }
14692
- const { componentId, version } = await boomi.createComponent(xmlToSend);
14693
- idByAlias[c.alias] = componentId;
14694
- created[c.alias] = { id: componentId, version, kind: c.kind, subType: c.subType };
14695
- }
14696
- const processXmlResolved = resolveProcessXmlAliases(processXml, idByAlias);
14697
- const { componentId: processId, version: processVersion } = await boomi.createComponent(processXmlResolved);
14698
- return { processId, processVersion, componentIds: created };
14699
- }
14700
14046
  // Annotate the CommonJS export names for ESM import in node:
14701
14047
  0 && (module.exports = {
14702
14048
  AS2CommunicationOptions,
@@ -14969,6 +14315,8 @@ async function createInBoomiFromAutomation(pkg, boomi) {
14969
14315
  OFTP2ConnectorRecordGroupingExpression,
14970
14316
  OFTP2ConnectorRecordSimpleExpression,
14971
14317
  OFTPCommunicationOptions,
14318
+ Oauth2UrlGroupingExpression,
14319
+ Oauth2UrlSimpleExpression,
14972
14320
  OdetteConnectorRecordService,
14973
14321
  OdetteOptions,
14974
14322
  OdetteUNBControlInfo,
@@ -15077,26 +14425,6 @@ async function createInBoomiFromAutomation(pkg, boomi) {
15077
14425
  X12ConnectorRecordGroupingExpression,
15078
14426
  X12ConnectorRecordService,
15079
14427
  X12ConnectorRecordSimpleExpression,
15080
- X12Options,
15081
- branch,
15082
- compileAutomation,
15083
- connectorNode,
15084
- createInBoomiFromAutomation,
15085
- decision,
15086
- defineAutomation,
15087
- docProps,
15088
- ffElement,
15089
- ffElementsGroup,
15090
- ffRecord,
15091
- fn,
15092
- m,
15093
- makeEmbedKitClient,
15094
- mapNode,
15095
- mapNodeByAlias,
15096
- notify,
15097
- returnDocs,
15098
- seq,
15099
- start,
15100
- stop
14428
+ X12Options
15101
14429
  });
15102
14430
  //# sourceMappingURL=index.cjs.map