@owneraio/finp2p-sdk-js 0.28.26 → 0.28.41

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.
Files changed (199) hide show
  1. package/README.md +71 -1
  2. package/lib/OwneraAPI/__tests__/apiErrorShape.test.d.ts +1 -0
  3. package/lib/OwneraAPI/__tests__/apiErrorShape.test.js +264 -0
  4. package/lib/OwneraAPI/__tests__/apiErrorShape.test.js.map +1 -0
  5. package/lib/OwneraAPI/finp2p-node-api/__tests__/approvalsConfig.test.js +5 -12
  6. package/lib/OwneraAPI/finp2p-node-api/__tests__/approvalsConfig.test.js.map +1 -1
  7. package/lib/OwneraAPI/finp2p-node-api/__tests__/createIntentMetadata.test.d.ts +1 -0
  8. package/lib/OwneraAPI/finp2p-node-api/__tests__/createIntentMetadata.test.js +56 -0
  9. package/lib/OwneraAPI/finp2p-node-api/__tests__/createIntentMetadata.test.js.map +1 -0
  10. package/lib/OwneraAPI/finp2p-node-api/__tests__/dryRunExecute.test.d.ts +1 -0
  11. package/lib/OwneraAPI/finp2p-node-api/__tests__/dryRunExecute.test.js +75 -0
  12. package/lib/OwneraAPI/finp2p-node-api/__tests__/dryRunExecute.test.js.map +1 -0
  13. package/lib/OwneraAPI/finp2p-node-api/__tests__/pathEncoding.test.d.ts +1 -0
  14. package/lib/OwneraAPI/finp2p-node-api/__tests__/pathEncoding.test.js +348 -0
  15. package/lib/OwneraAPI/finp2p-node-api/__tests__/pathEncoding.test.js.map +1 -0
  16. package/lib/OwneraAPI/finp2p-node-api/__tests__/rejectIntent.test.d.ts +1 -0
  17. package/lib/OwneraAPI/finp2p-node-api/__tests__/rejectIntent.test.js +97 -0
  18. package/lib/OwneraAPI/finp2p-node-api/__tests__/rejectIntent.test.js.map +1 -0
  19. package/lib/OwneraAPI/finp2p-node-api/certificates.js +15 -6
  20. package/lib/OwneraAPI/finp2p-node-api/certificates.js.map +1 -1
  21. package/lib/OwneraAPI/finp2p-node-api/custodies.js +13 -2
  22. package/lib/OwneraAPI/finp2p-node-api/custodies.js.map +1 -1
  23. package/lib/OwneraAPI/finp2p-node-api/documents.js +22 -9
  24. package/lib/OwneraAPI/finp2p-node-api/documents.js.map +1 -1
  25. package/lib/OwneraAPI/finp2p-node-api/investorAccounts.d.ts +13 -0
  26. package/lib/OwneraAPI/finp2p-node-api/investorAccounts.js +71 -0
  27. package/lib/OwneraAPI/finp2p-node-api/investorAccounts.js.map +1 -0
  28. package/lib/OwneraAPI/finp2p-node-api/ledgers.js +13 -2
  29. package/lib/OwneraAPI/finp2p-node-api/ledgers.js.map +1 -1
  30. package/lib/OwneraAPI/finp2p-node-api/messages.js +12 -3
  31. package/lib/OwneraAPI/finp2p-node-api/messages.js.map +1 -1
  32. package/lib/OwneraAPI/finp2p-node-api/operations.js +37 -15
  33. package/lib/OwneraAPI/finp2p-node-api/operations.js.map +1 -1
  34. package/lib/OwneraAPI/finp2p-node-api/policies.js +14 -5
  35. package/lib/OwneraAPI/finp2p-node-api/policies.js.map +1 -1
  36. package/lib/OwneraAPI/finp2p-node-api/profiles.js +82 -45
  37. package/lib/OwneraAPI/finp2p-node-api/profiles.js.map +1 -1
  38. package/lib/OwneraAPI/finp2p-node-api/tokens.js +20 -0
  39. package/lib/OwneraAPI/finp2p-node-api/tokens.js.map +1 -1
  40. package/lib/OwneraAPI/index.js +2 -0
  41. package/lib/OwneraAPI/index.js.map +1 -1
  42. package/lib/OwneraAPI/oss-api/__tests__/buildGraphQLQuery.test.d.ts +1 -0
  43. package/lib/OwneraAPI/oss-api/__tests__/buildGraphQLQuery.test.js +253 -0
  44. package/lib/OwneraAPI/oss-api/__tests__/buildGraphQLQuery.test.js.map +1 -0
  45. package/lib/OwneraAPI/oss-api/__tests__/getAllExecutionPlans.test.js +52 -0
  46. package/lib/OwneraAPI/oss-api/__tests__/getAllExecutionPlans.test.js.map +1 -1
  47. package/lib/OwneraAPI/oss-api/__tests__/ossQueryEscaping.test.d.ts +1 -0
  48. package/lib/OwneraAPI/oss-api/__tests__/ossQueryEscaping.test.js +347 -0
  49. package/lib/OwneraAPI/oss-api/__tests__/ossQueryEscaping.test.js.map +1 -0
  50. package/lib/OwneraAPI/oss-api/filterUtils.d.ts +20 -0
  51. package/lib/OwneraAPI/oss-api/filterUtils.js +57 -5
  52. package/lib/OwneraAPI/oss-api/filterUtils.js.map +1 -1
  53. package/lib/OwneraAPI/oss-api/oss.js +155 -75
  54. package/lib/OwneraAPI/oss-api/oss.js.map +1 -1
  55. package/lib/OwneraAPI/oss-api/queryUtils.d.ts +1 -0
  56. package/lib/OwneraAPI/oss-api/queryUtils.js +6 -5
  57. package/lib/OwneraAPI/oss-api/queryUtils.js.map +1 -1
  58. package/lib/OwneraAPI/oss-api/queryValidation.d.ts +3 -1
  59. package/lib/OwneraAPI/oss-api/queryValidation.js +21 -2
  60. package/lib/OwneraAPI/oss-api/queryValidation.js.map +1 -1
  61. package/lib/OwneraAPI/payment-adapter-api/__tests__/updateBalance.test.d.ts +1 -0
  62. package/lib/OwneraAPI/payment-adapter-api/__tests__/updateBalance.test.js +42 -0
  63. package/lib/OwneraAPI/payment-adapter-api/__tests__/updateBalance.test.js.map +1 -0
  64. package/lib/OwneraAPI/payment-adapter-api/vanilla/__tests__/payouts.test.d.ts +1 -0
  65. package/lib/OwneraAPI/payment-adapter-api/vanilla/__tests__/payouts.test.js +73 -0
  66. package/lib/OwneraAPI/payment-adapter-api/vanilla/__tests__/payouts.test.js.map +1 -0
  67. package/lib/OwneraAPI/payment-adapter-api/vanilla/payouts.js +23 -11
  68. package/lib/OwneraAPI/payment-adapter-api/vanilla/payouts.js.map +1 -1
  69. package/lib/OwneraAPI/payment-adapter-api/vanilla/update-balance.d.ts +1 -1
  70. package/lib/OwneraAPI/payment-adapter-api/vanilla/update-balance.js +3 -1
  71. package/lib/OwneraAPI/payment-adapter-api/vanilla/update-balance.js.map +1 -1
  72. package/lib/OwneraAPI/utils.d.ts +39 -0
  73. package/lib/OwneraAPI/utils.js +125 -73
  74. package/lib/OwneraAPI/utils.js.map +1 -1
  75. package/lib/core/__tests__/consoleLogger.test.d.ts +1 -0
  76. package/lib/core/__tests__/consoleLogger.test.js +269 -0
  77. package/lib/core/__tests__/consoleLogger.test.js.map +1 -0
  78. package/lib/core/__tests__/createAssetNameUniqueness.test.d.ts +1 -0
  79. package/lib/core/__tests__/createAssetNameUniqueness.test.js +95 -0
  80. package/lib/core/__tests__/createAssetNameUniqueness.test.js.map +1 -0
  81. package/lib/core/__tests__/custodianPrecedence.test.d.ts +1 -0
  82. package/lib/core/__tests__/custodianPrecedence.test.js +683 -0
  83. package/lib/core/__tests__/custodianPrecedence.test.js.map +1 -0
  84. package/lib/core/__tests__/executeIntentSettlementAssets.test.d.ts +1 -0
  85. package/lib/core/__tests__/executeIntentSettlementAssets.test.js +128 -0
  86. package/lib/core/__tests__/executeIntentSettlementAssets.test.js.map +1 -0
  87. package/lib/core/__tests__/logException.test.d.ts +1 -0
  88. package/lib/core/__tests__/logException.test.js +49 -0
  89. package/lib/core/__tests__/logException.test.js.map +1 -0
  90. package/lib/core/__tests__/multiplyDecimalStrings.test.d.ts +1 -0
  91. package/lib/core/__tests__/multiplyDecimalStrings.test.js +37 -0
  92. package/lib/core/__tests__/multiplyDecimalStrings.test.js.map +1 -0
  93. package/lib/core/__tests__/settlementExecutionAmount.test.d.ts +1 -0
  94. package/lib/core/__tests__/settlementExecutionAmount.test.js +300 -0
  95. package/lib/core/__tests__/settlementExecutionAmount.test.js.map +1 -0
  96. package/lib/core/asset.js +21 -27
  97. package/lib/core/asset.js.map +1 -1
  98. package/lib/core/custodian.d.ts +30 -0
  99. package/lib/core/custodian.js +49 -0
  100. package/lib/core/custodian.js.map +1 -0
  101. package/lib/core/index.d.ts +1 -0
  102. package/lib/core/index.js +3 -1
  103. package/lib/core/index.js.map +1 -1
  104. package/lib/core/intents/__tests__/intentErrorCode.test.d.ts +1 -0
  105. package/lib/core/intents/__tests__/intentErrorCode.test.js +111 -0
  106. package/lib/core/intents/__tests__/intentErrorCode.test.js.map +1 -0
  107. package/lib/core/intents/__tests__/intentHandleReject.test.d.ts +1 -0
  108. package/lib/core/intents/__tests__/intentHandleReject.test.js +50 -0
  109. package/lib/core/intents/__tests__/intentHandleReject.test.js.map +1 -0
  110. package/lib/core/intents/__tests__/loanIntentAdditionalAccounts.test.d.ts +1 -0
  111. package/lib/core/intents/__tests__/loanIntentAdditionalAccounts.test.js +185 -0
  112. package/lib/core/intents/__tests__/loanIntentAdditionalAccounts.test.js.map +1 -0
  113. package/lib/core/intents/__tests__/loanIntentCustodianPrecedence.test.d.ts +1 -0
  114. package/lib/core/intents/__tests__/loanIntentCustodianPrecedence.test.js +85 -0
  115. package/lib/core/intents/__tests__/loanIntentCustodianPrecedence.test.js.map +1 -0
  116. package/lib/core/intents/__tests__/loanIntentMetadata.test.d.ts +1 -0
  117. package/lib/core/intents/__tests__/loanIntentMetadata.test.js +81 -0
  118. package/lib/core/intents/__tests__/loanIntentMetadata.test.js.map +1 -0
  119. package/lib/core/intents/__tests__/moveIntentSegregatedAccounts.test.d.ts +1 -0
  120. package/lib/core/intents/__tests__/moveIntentSegregatedAccounts.test.js +203 -0
  121. package/lib/core/intents/__tests__/moveIntentSegregatedAccounts.test.js.map +1 -0
  122. package/lib/core/intents/createIntent/createIntent.js +4 -3
  123. package/lib/core/intents/createIntent/createIntent.js.map +1 -1
  124. package/lib/core/intents/createIntent/createMoveIntentReq.d.ts +0 -1
  125. package/lib/core/intents/createIntent/createMoveIntentReq.js +15 -8
  126. package/lib/core/intents/createIntent/createMoveIntentReq.js.map +1 -1
  127. package/lib/core/intents/createIntent/helpers.d.ts +6 -2
  128. package/lib/core/intents/createIntent/helpers.js +27 -17
  129. package/lib/core/intents/createIntent/helpers.js.map +1 -1
  130. package/lib/core/intents/createLoanIntent.js +64 -19
  131. package/lib/core/intents/createLoanIntent.js.map +1 -1
  132. package/lib/core/intents/executeIntent.js +102 -41
  133. package/lib/core/intents/executeIntent.js.map +1 -1
  134. package/lib/core/intents/executeLoanIntent.js +48 -23
  135. package/lib/core/intents/executeLoanIntent.js.map +1 -1
  136. package/lib/core/intents/executeMoveIntent.js.map +1 -1
  137. package/lib/core/intents/executePrivateIntent.js +46 -13
  138. package/lib/core/intents/executePrivateIntent.js.map +1 -1
  139. package/lib/core/intents/executeRedemptionIntent.d.ts +1 -0
  140. package/lib/core/intents/executeRedemptionIntent.js +23 -9
  141. package/lib/core/intents/executeRedemptionIntent.js.map +1 -1
  142. package/lib/core/intents/executeTransferRequest.d.ts +5 -0
  143. package/lib/core/intents/executeTransferRequest.js +14 -3
  144. package/lib/core/intents/executeTransferRequest.js.map +1 -1
  145. package/lib/core/intents/getIntent.js +9 -0
  146. package/lib/core/intents/getIntent.js.map +1 -1
  147. package/lib/core/intents/transfer.js +7 -2
  148. package/lib/core/intents/transfer.js.map +1 -1
  149. package/lib/core/intents/updateMoveIntentReq.d.ts +4 -3
  150. package/lib/core/intents/updateMoveIntentReq.js +14 -12
  151. package/lib/core/intents/updateMoveIntentReq.js.map +1 -1
  152. package/lib/core/intents/utils.d.ts +15 -7
  153. package/lib/core/intents/utils.js +35 -26
  154. package/lib/core/intents/utils.js.map +1 -1
  155. package/lib/core/logger.js +128 -22
  156. package/lib/core/logger.js.map +1 -1
  157. package/lib/core/normalizers/__tests__/normalizeOperationResponse.test.d.ts +1 -0
  158. package/lib/core/normalizers/__tests__/normalizeOperationResponse.test.js +60 -0
  159. package/lib/core/normalizers/__tests__/normalizeOperationResponse.test.js.map +1 -0
  160. package/lib/core/normalizers/normalizeOperationResponse.d.ts +6 -0
  161. package/lib/core/normalizers/normalizeOperationResponse.js +4 -5
  162. package/lib/core/normalizers/normalizeOperationResponse.js.map +1 -1
  163. package/lib/core/sdk.d.ts +4 -0
  164. package/lib/core/sdk.js +2 -2
  165. package/lib/core/sdk.js.map +1 -1
  166. package/lib/core/user.d.ts +2 -2
  167. package/lib/core/user.js +6 -3
  168. package/lib/core/user.js.map +1 -1
  169. package/lib/core/utils.d.ts +17 -1
  170. package/lib/core/utils.js +75 -16
  171. package/lib/core/utils.js.map +1 -1
  172. package/lib/index.d.ts +1 -0
  173. package/lib/index.js +3 -1
  174. package/lib/index.js.map +1 -1
  175. package/lib/types/Core/Intents.d.ts +115 -3
  176. package/lib/types/Core/Intents.js +9 -0
  177. package/lib/types/Core/Intents.js.map +1 -1
  178. package/lib/types/Core/OwneraAPI.d.ts +21 -1
  179. package/lib/types/Core/User.d.ts +28 -3
  180. package/lib/types/InvestorAccounts/InvestorAccounts.d.ts +171 -0
  181. package/lib/types/InvestorAccounts/InvestorAccounts.js +35 -0
  182. package/lib/types/InvestorAccounts/InvestorAccounts.js.map +1 -0
  183. package/lib/types/InvestorAccounts/index.d.ts +1 -0
  184. package/lib/types/InvestorAccounts/index.js +18 -0
  185. package/lib/types/InvestorAccounts/index.js.map +1 -0
  186. package/lib/types/Operations/Operations.d.ts +11 -0
  187. package/lib/types/Oss/Oss.d.ts +18 -1
  188. package/lib/types/Oss/OssSchemas.d.ts +50 -0
  189. package/lib/types/Oss/OssSchemas.js.map +1 -1
  190. package/lib/types/Oss/utils.d.ts +32 -0
  191. package/lib/types/PaymentAdapter/PaymentAdapter.d.ts +7 -0
  192. package/lib/types/PaymentAdapter/index.d.ts +33 -1
  193. package/lib/types/Profiles/Intents.d.ts +24 -12
  194. package/lib/types/Profiles/Profiles.d.ts +46 -1
  195. package/lib/types/Tokens/Tokens.d.ts +109 -1
  196. package/lib/types/index.d.ts +1 -0
  197. package/lib/types/index.js +1 -0
  198. package/lib/types/index.js.map +1 -1
  199. package/package.json +1 -1
@@ -23,6 +23,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
23
23
  const utils_1 = require("../../core/intents/utils");
24
24
  const utils_2 = require("../utils");
25
25
  const queryUtils_1 = require("./queryUtils");
26
+ const filterUtils_1 = require("./filterUtils");
26
27
  const queryValidation_1 = require("./queryValidation");
27
28
  const executeDynamicQueryWithExternal_1 = require("./executeDynamicQueryWithExternal");
28
29
  const externalQueryHandler_1 = require("./externalQueryHandler");
@@ -269,6 +270,11 @@ const intentFragment = `
269
270
  intent {
270
271
  ${intentDetailsFragment}
271
272
  }
273
+ customMetadata {
274
+ key
275
+ value
276
+ }
277
+ rejectReason
272
278
  `;
273
279
  // Data-layer fragments for the Financial Asset (assetHeader / pricing / referenceData feeds).
274
280
  const assetDataItemFragment = `
@@ -508,6 +514,11 @@ const planInstructionDetailsFragment = `
508
514
  amount
509
515
  }
510
516
  `;
517
+ // Filter values of the hand-written queries that used to be interpolated raw. Each value goes through
518
+ // String(), as the template literal did, so a missing id is still a lookup that matches nothing. Only
519
+ // the escaping is new. Values that were already escaped keep the strict formatFilterValue.
520
+ const gqlString = (value) => (0, filterUtils_1.formatFilterValue)(String(value));
521
+ const gqlStringList = (values) => (0, filterUtils_1.formatFilterArray)(Array.from(values, (v) => String(v)));
511
522
  // pagination fragments
512
523
  const pageInfoFragment = `
513
524
  pageInfo {
@@ -516,10 +527,6 @@ pageInfo {
516
527
  totalCount
517
528
  totalLeft
518
529
  }`;
519
- // this allows to get by default the 100 first results
520
- const paginateFragment = ({ after, limit, skip }) => `
521
- paginate: {limit: ${limit || 10000}, skip: ${skip || 0}, after: "${after || ''}"},
522
- `;
523
530
  // execution plan fragments
524
531
  const termFragment = `
525
532
  term {
@@ -962,9 +969,6 @@ const mapAsset = (asset) => ({
962
969
  financialIdentifier: asset.financialIdentifier,
963
970
  decimalPlaces: asset.decimalPlaces,
964
971
  });
965
- const stringifyArrayForQuery = (arr) => {
966
- return `[` + arr.map((s) => `\\"${s}\\"`) + `]`;
967
- };
968
972
  /**
969
973
  * Transforms raw GraphQL data nodes into API-formatted objects using schema path mappings
970
974
  * @param nodes - Raw GraphQL data nodes
@@ -1126,22 +1130,22 @@ query getAssets {
1126
1130
  assets
1127
1131
  (
1128
1132
  filter: [
1129
- ${!!(filter === null || filter === void 0 ? void 0 : filter.assetIds) ? `{ key: "id", operator: IN, value: "${stringifyArrayForQuery(filter.assetIds)}"},` : ''}
1130
- ${!!(filter === null || filter === void 0 ? void 0 : filter.name) ? `{ key: "name", operator: EQ, value: "${filter.name}" },` : ''}
1133
+ ${!!(filter === null || filter === void 0 ? void 0 : filter.assetIds) ? `{ key: "id", operator: IN, value: ${gqlStringList(filter.assetIds)}},` : ''}
1134
+ ${!!(filter === null || filter === void 0 ? void 0 : filter.name) ? `{ key: "name", operator: EQ, value: ${gqlString(filter.name)} },` : ''}
1131
1135
  ${Array.isArray(filter === null || filter === void 0 ? void 0 : filter.symbol)
1132
- ? `{ key: "symbol", operator: IN, value: "${stringifyArrayForQuery(filter.symbol)}" },`
1136
+ ? `{ key: "symbol", operator: IN, value: ${gqlStringList(filter.symbol)} },`
1133
1137
  : (filter === null || filter === void 0 ? void 0 : filter.symbol)
1134
- ? `{ key: "symbol", operator: EQ, value: "${filter.symbol}" },`
1138
+ ? `{ key: "symbol", operator: EQ, value: ${gqlString(filter.symbol)} },`
1135
1139
  : ''}
1136
- ${!!(filter === null || filter === void 0 ? void 0 : filter.excludeType) ? `{ key: "type", operator: NEQ, value: "${filter.excludeType}" },` : ''}
1140
+ ${!!(filter === null || filter === void 0 ? void 0 : filter.excludeType) ? `{ key: "type", operator: NEQ, value: ${gqlString(filter.excludeType)} },` : ''}
1137
1141
  ${Array.isArray(filter === null || filter === void 0 ? void 0 : filter.type)
1138
- ? `{ key: "type", operator: IN, value: "${stringifyArrayForQuery(filter.type)}" },`
1142
+ ? `{ key: "type", operator: IN, value: ${gqlStringList(filter.type)} },`
1139
1143
  : (filter === null || filter === void 0 ? void 0 : filter.type)
1140
- ? `{ key: "type", operator: EQ, value: "${filter.type}" },`
1144
+ ? `{ key: "type", operator: EQ, value: ${gqlString(filter.type)} },`
1141
1145
  : ''}
1142
1146
  ],
1143
- ${paginateFragment({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1144
- orderBy: {field: ${((_a = filter === null || filter === void 0 ? void 0 : filter.orderBy) === null || _a === void 0 ? void 0 : _a.field) || 'NAME'}, direction: ${((_b = filter === null || filter === void 0 ? void 0 : filter.orderBy) === null || _b === void 0 ? void 0 : _b.direction) || 'ASC'}},
1147
+ ${(0, queryUtils_1.paginateFragment)({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1148
+ orderBy: {field: ${(0, filterUtils_1.formatEnumValue)(((_a = filter === null || filter === void 0 ? void 0 : filter.orderBy) === null || _a === void 0 ? void 0 : _a.field) || 'NAME')}, direction: ${(0, filterUtils_1.formatEnumValue)(((_b = filter === null || filter === void 0 ? void 0 : filter.orderBy) === null || _b === void 0 ? void 0 : _b.direction) || 'ASC')}},
1145
1149
  )
1146
1150
  {
1147
1151
  nodes {
@@ -1187,9 +1191,9 @@ query financialAssets {
1187
1191
  financialAssets
1188
1192
  (
1189
1193
  filter: [
1190
- ${!!(filter === null || filter === void 0 ? void 0 : filter.identifierValues) ? `{ key: "identifierValue", operator: IN, value: "${stringifyArrayForQuery(filter.identifierValues)}" },` : ''}
1194
+ ${!!(filter === null || filter === void 0 ? void 0 : filter.identifierValues) ? `{ key: "identifierValue", operator: IN, value: ${gqlStringList(filter.identifierValues)} },` : ''}
1191
1195
  ],
1192
- ${paginateFragment({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1196
+ ${(0, queryUtils_1.paginateFragment)({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1193
1197
  )
1194
1198
  {
1195
1199
  nodes {
@@ -1261,10 +1265,10 @@ query assetDatas {
1261
1265
  assetDatas
1262
1266
  (
1263
1267
  filter: [
1264
- ${!!(filter === null || filter === void 0 ? void 0 : filter.identifierValue) ? `{ key: "identifierValue", operator: EQ, value: "${filter.identifierValue}" },` : ''}
1265
- ${!!(filter === null || filter === void 0 ? void 0 : filter.dataType) ? `{ key: "dataType", operator: EQ, value: "${filter.dataType}" },` : ''}
1268
+ ${!!(filter === null || filter === void 0 ? void 0 : filter.identifierValue) ? `{ key: "identifierValue", operator: EQ, value: ${gqlString(filter.identifierValue)} },` : ''}
1269
+ ${!!(filter === null || filter === void 0 ? void 0 : filter.dataType) ? `{ key: "dataType", operator: EQ, value: ${gqlString(filter.dataType)} },` : ''}
1266
1270
  ],
1267
- ${paginateFragment({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1271
+ ${(0, queryUtils_1.paginateFragment)({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1268
1272
  )
1269
1273
  {
1270
1274
  nodes {
@@ -1308,12 +1312,14 @@ query assetDatas {
1308
1312
  var _a, _b;
1309
1313
  const { retry, filter } = request;
1310
1314
  const intentFilterFragments = [
1311
- `{ key: "type", operator: IN, value: "${stringifyArrayForQuery(filter.intentTypes)}" }`,
1312
- filter.intentStatus ? `{ key: "status", operator: EQ, value: "${filter.intentStatus}" }` : '',
1315
+ `{ key: "type", operator: IN, value: ${gqlStringList(filter.intentTypes)} }`,
1316
+ filter.intentStatus ? `{ key: "status", operator: EQ, value: ${gqlString(filter.intentStatus)} }` : '',
1313
1317
  ]
1314
1318
  .filter(Boolean)
1315
1319
  .join(',');
1316
- const assetFilterFragments = [(filter === null || filter === void 0 ? void 0 : filter.type) ? `{ key: "type", operator: EQ, value: "${filter.type}" }` : '']
1320
+ const assetFilterFragments = [
1321
+ (filter === null || filter === void 0 ? void 0 : filter.type) ? `{ key: "type", operator: EQ, value: ${gqlString(filter.type)} }` : '',
1322
+ ]
1317
1323
  .filter(Boolean)
1318
1324
  .join(',');
1319
1325
  const query = `
@@ -1321,8 +1327,8 @@ query assetDatas {
1321
1327
  assets
1322
1328
  (
1323
1329
  filter: [${assetFilterFragments}],
1324
- ${paginateFragment({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1325
- orderBy: {field: ${((_a = filter === null || filter === void 0 ? void 0 : filter.orderBy) === null || _a === void 0 ? void 0 : _a.field) || 'NAME'}, direction: ${((_b = filter === null || filter === void 0 ? void 0 : filter.orderBy) === null || _b === void 0 ? void 0 : _b.direction) || 'ASC'}},
1330
+ ${(0, queryUtils_1.paginateFragment)({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1331
+ orderBy: {field: ${(0, filterUtils_1.formatEnumValue)(((_a = filter === null || filter === void 0 ? void 0 : filter.orderBy) === null || _a === void 0 ? void 0 : _a.field) || 'NAME')}, direction: ${(0, filterUtils_1.formatEnumValue)(((_b = filter === null || filter === void 0 ? void 0 : filter.orderBy) === null || _b === void 0 ? void 0 : _b.direction) || 'ASC')}},
1326
1332
  )
1327
1333
  {
1328
1334
  nodes {
@@ -1404,8 +1410,8 @@ query assetDatas {
1404
1410
  }),
1405
1411
  getAssetsWithSpecificIntents: (request) => __awaiter(void 0, void 0, void 0, function* () {
1406
1412
  const { assetIds, intentIds, fields, assetFields } = request;
1407
- const assetFilterFragment = `{ key: "id", operator: IN, value: "${stringifyArrayForQuery(assetIds)}" }`;
1408
- const intentFilterFragment = `{ key: "id", operator: IN, value: "${stringifyArrayForQuery(intentIds)}" }`;
1413
+ const assetFilterFragment = `{ key: "id", operator: IN, value: ${gqlStringList(assetIds)} }`;
1414
+ const intentFilterFragment = `{ key: "id", operator: IN, value: ${gqlStringList(intentIds)} }`;
1409
1415
  const query = `
1410
1416
  query getAssetsWithSpecificIntents {
1411
1417
  assets(filter: [${assetFilterFragment}]) {
@@ -1447,11 +1453,11 @@ query assetDatas {
1447
1453
  const { assetId, intentId } = request;
1448
1454
  const query = `
1449
1455
  query getLoanIntent {
1450
- assets (filter: {operator: EQ, key: "id", value: "${assetId}"}) {
1456
+ assets (filter: {operator: EQ, key: "id", value: ${gqlString(assetId)}}) {
1451
1457
  nodes {
1452
1458
  id
1453
1459
  name
1454
- intents (filter: {operator: EQ, key: "id", value: "${intentId}"}) {
1460
+ intents (filter: {operator: EQ, key: "id", value: ${gqlString(intentId)}}) {
1455
1461
  nodes {
1456
1462
  ${intentFragment}
1457
1463
  }
@@ -1539,11 +1545,11 @@ query assetDatas {
1539
1545
  const query = `
1540
1546
  query getIssuerAssets {
1541
1547
  issuers (
1542
- filter:{key:"id", operator:EQ, value: "${issuerId}"},
1548
+ filter:{key:"id", operator:EQ, value: ${gqlString(issuerId)}},
1543
1549
  ) {
1544
1550
  nodes {
1545
1551
  assets (
1546
- ${paginateFragment({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1552
+ ${(0, queryUtils_1.paginateFragment)({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1547
1553
  ) {
1548
1554
  nodes {
1549
1555
  ${assetFragment}
@@ -1585,7 +1591,7 @@ query assetDatas {
1585
1591
  getOutbox: (request) => __awaiter(void 0, void 0, void 0, function* () {
1586
1592
  const query = `
1587
1593
  query getOutbox {
1588
- issuers (filter: {key: "id", operator: EQ, value: "${request.userId}"}){
1594
+ issuers (filter: {key: "id", operator: EQ, value: ${gqlString(request.userId)}}){
1589
1595
  nodes {
1590
1596
  id
1591
1597
  outbox {
@@ -1651,6 +1657,8 @@ query getAllOutbox {
1651
1657
  // model - certificate
1652
1658
  getProfileCertificates: (request) => __awaiter(void 0, void 0, void 0, function* () {
1653
1659
  const { profileId, profileType } = request;
1660
+ // profileType is written unquoted as the root field name
1661
+ (0, queryValidation_1.validateGraphQLTypeName)(profileType);
1654
1662
  const query = `
1655
1663
  query getProfileCertificates ($profileId: String!) {
1656
1664
  ${profileType} (filter: { key: "id", operator: EQ, value: $profileId }) {
@@ -1767,9 +1775,9 @@ query getUsers {
1767
1775
  users
1768
1776
  (
1769
1777
  filter: [
1770
- ${userIds.length > 0 ? `{ key: "id", operator: IN, value: "${stringifyArrayForQuery(userIds)}"},` : ''}
1778
+ ${userIds.length > 0 ? `{ key: "id", operator: IN, value: ${gqlStringList(userIds)}},` : ''}
1771
1779
  ],
1772
- ${paginateFragment({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1780
+ ${(0, queryUtils_1.paginateFragment)({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
1773
1781
  )
1774
1782
  {
1775
1783
  ${userFragment}
@@ -1833,6 +1841,62 @@ query getUsers {
1833
1841
  pageInfo: response.users.pageInfo,
1834
1842
  };
1835
1843
  }),
1844
+ // model - users / investor network accounts
1845
+ getUserNetworkAccounts: (request) => __awaiter(void 0, void 0, void 0, function* () {
1846
+ var _a, _b, _c;
1847
+ const { userId, organizationId, assetId, retry } = request;
1848
+ // Deliberately a standalone query: widening the shared userFragment with
1849
+ // `networkAccounts` would hard-fail getUsers against routers that predate
1850
+ // the field (OSS validates strictly — unknown field = query error).
1851
+ //
1852
+ // `account` is a GraphQL UNION (WalletAccount | Caip10Account |
1853
+ // CustodialAccount) — plain field selection is rejected by OSS, so the
1854
+ // variants are selected via inline fragments discriminated by __typename.
1855
+ //
1856
+ // The org/asset narrowing happens client-side rather than via the nested
1857
+ // networkAccounts(filter:) argument: the per-investor list is small and
1858
+ // filtering here avoids coupling to the read model's filter keys.
1859
+ const query = `
1860
+ query getUserNetworkAccounts {
1861
+ users (filter: [{ key: "id", operator: EQ, value: ${(0, filterUtils_1.formatFilterValue)(userId)} }]) {
1862
+ nodes {
1863
+ id
1864
+ networkAccounts {
1865
+ id
1866
+ organizationId
1867
+ assetId
1868
+ account {
1869
+ __typename
1870
+ ... on WalletAccount { type address }
1871
+ ... on Caip10Account { network address }
1872
+ ... on CustodialAccount { provider vaultAccountId assetId }
1873
+ }
1874
+ }
1875
+ }
1876
+ }
1877
+ }
1878
+ `;
1879
+ const readyConditions = {
1880
+ match: (res) => {
1881
+ var _a, _b, _c, _d;
1882
+ if (!retry)
1883
+ return true;
1884
+ return ((_d = (_c = (_b = (_a = res.users) === null || _a === void 0 ? void 0 : _a.nodes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.networkAccounts) === null || _d === void 0 ? void 0 : _d.length) > 0;
1885
+ },
1886
+ name: 'getUserNetworkAccounts',
1887
+ data: request,
1888
+ };
1889
+ const response = yield (0, utils_2.ossQuery)(client, logger, query, readyConditions);
1890
+ const user = (_b = (_a = response.users) === null || _a === void 0 ? void 0 : _a.nodes) === null || _b === void 0 ? void 0 : _b[0];
1891
+ if (!user) {
1892
+ throw {
1893
+ code: 404,
1894
+ name: 'NoMatchingOwner',
1895
+ message: `No owner found by id: ${userId}`,
1896
+ };
1897
+ }
1898
+ return ((_c = user.networkAccounts) !== null && _c !== void 0 ? _c : []).filter((account) => (!organizationId || account.organizationId === organizationId) && (!assetId || account.assetId === assetId));
1899
+ }),
1836
1900
  getUserIdByPublicKey: (request) => __awaiter(void 0, void 0, void 0, function* () {
1837
1901
  const { publicKey } = request;
1838
1902
  const query = `
@@ -1840,7 +1904,7 @@ query getUsers {
1840
1904
  organizations {
1841
1905
  nodes {
1842
1906
  id
1843
- users (filter: {key:"finIds", operator:CONTAINS, value:"${publicKey}"}) {
1907
+ users (filter: {key:"finIds", operator:CONTAINS, value:${gqlString(publicKey)}}) {
1844
1908
  nodes {
1845
1909
  id
1846
1910
  }
@@ -1870,7 +1934,7 @@ query getUsers {
1870
1934
  var _a, _b;
1871
1935
  const query = `
1872
1936
  query getUserHoldings {
1873
- users (filter:{key:"id",operator:EQ,value:"${request.userId}"}) {
1937
+ users (filter:{key:"id",operator:EQ,value:${gqlString(request.userId)}}) {
1874
1938
  nodes {
1875
1939
  holdings {
1876
1940
  nodes {
@@ -1916,7 +1980,7 @@ query getUserHoldings {
1916
1980
  const query = `
1917
1981
  query getAllUsersHoldings {
1918
1982
  users
1919
- (${paginateFragment({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })})
1983
+ (${(0, queryUtils_1.paginateFragment)({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })})
1920
1984
  {
1921
1985
  nodes {
1922
1986
  id
@@ -1953,7 +2017,7 @@ query getAllUsersHoldings {
1953
2017
  getInbox: (request) => __awaiter(void 0, void 0, void 0, function* () {
1954
2018
  const query = `
1955
2019
  query getUserInbox {
1956
- users (filter: {key: "id", operator: EQ, value: "${request.userId}"}) {
2020
+ users (filter: {key: "id", operator: EQ, value: ${gqlString(request.userId)}}) {
1957
2021
  nodes {
1958
2022
  id
1959
2023
  inbox {
@@ -1977,7 +2041,7 @@ query getUserInbox {
1977
2041
  var _a;
1978
2042
  const query = `
1979
2043
  query getReceipt {
1980
- receipts (filter: {key: "id", operator: EQ, value: "${request.receiptId}"}) {
2044
+ receipts (filter: {key: "id", operator: EQ, value: ${gqlString(request.receiptId)}}) {
1981
2045
  nodes {
1982
2046
  ${receiptFragment}
1983
2047
  }
@@ -2004,7 +2068,7 @@ query getReceipt {
2004
2068
  var _a;
2005
2069
  const query = `
2006
2070
  query getReceipt {
2007
- receipts (filter: {key: "operationId", operator: EQ, value: "${request.operationId}"}) {
2071
+ receipts (filter: {key: "operationId", operator: EQ, value: ${gqlString(request.operationId)}}) {
2008
2072
  nodes {
2009
2073
  ${receiptFragment}
2010
2074
  }
@@ -2046,7 +2110,7 @@ query getReceipt {
2046
2110
  const query = `
2047
2111
  query getReceiptsByAsset {
2048
2112
  receipts
2049
- (${paginateFragment({ after: cursor, limit: 10000, skip: 0 })})
2113
+ (${(0, queryUtils_1.paginateFragment)({ after: cursor, limit: 10000, skip: 0 })})
2050
2114
  {
2051
2115
  nodes {
2052
2116
  ${receiptFragment}
@@ -2094,8 +2158,8 @@ query getReceiptsByAsset {
2094
2158
  const destination = fetchDst
2095
2159
  ? `
2096
2160
  destination: receipts (
2097
- filter: {key: "destination", operator: EQ, value: "${request.userId}"},
2098
- ${paginateFragment({ after: dstCursor, limit: 10000, skip: 0 })}
2161
+ filter: {key: "destination", operator: EQ, value: ${gqlString(request.userId)}},
2162
+ ${(0, queryUtils_1.paginateFragment)({ after: dstCursor, limit: 10000, skip: 0 })}
2099
2163
  ) {
2100
2164
  nodes {
2101
2165
  ${receiptFragment}
@@ -2106,8 +2170,8 @@ query getReceiptsByAsset {
2106
2170
  const source = fetchSrc
2107
2171
  ? `
2108
2172
  source: receipts (
2109
- filter: {key: "source", operator: EQ, value: "${request.userId}"},
2110
- ${paginateFragment({ after: srcCursor, limit: 10000, skip: 0 })}
2173
+ filter: {key: "source", operator: EQ, value: ${gqlString(request.userId)}},
2174
+ ${(0, queryUtils_1.paginateFragment)({ after: srcCursor, limit: 10000, skip: 0 })}
2111
2175
  ) {
2112
2176
  nodes {
2113
2177
  ${receiptFragment}
@@ -2148,7 +2212,7 @@ query getReceiptsByUser {
2148
2212
  var _a;
2149
2213
  const query = `
2150
2214
  query getReceipt {
2151
- receipts (filter: {key: "operationId", operator: EQ, value: "${request.operationId}"}) {
2215
+ receipts (filter: {key: "operationId", operator: EQ, value: ${gqlString(request.operationId)}}) {
2152
2216
  nodes {
2153
2217
  ${receiptFragment}
2154
2218
  }
@@ -2176,7 +2240,7 @@ query getReceipt {
2176
2240
  var _a;
2177
2241
  const query = `
2178
2242
  query getReceiptsFromTimestamp {
2179
- receipts (filter: {key: "timestamp", operator: GT, value: "${request.timestamp}"}) {
2243
+ receipts (filter: {key: "timestamp", operator: GT, value: ${gqlString(request.timestamp)}}) {
2180
2244
  nodes {
2181
2245
  ${receiptFragment}
2182
2246
  }
@@ -2199,7 +2263,7 @@ query getReceiptsFromTimestamp {
2199
2263
  const query = `
2200
2264
  query getExecutionPlanStatus {
2201
2265
  plans
2202
- (filter: { key:"id", operator:EQ, value: "${request.planId}" })
2266
+ (filter: { key:"id", operator:EQ, value: ${gqlString(request.planId)} })
2203
2267
  {
2204
2268
  nodes {
2205
2269
  id
@@ -2224,31 +2288,49 @@ query getExecutionPlanStatus {
2224
2288
  }),
2225
2289
  getAllExecutionPlans: (request) => __awaiter(void 0, void 0, void 0, function* () {
2226
2290
  const { filter } = request;
2227
- const { id, status, creationDate, lastModified, sortOrder, sortField } = filter || {};
2291
+ const { id, status, creationDate, lastModified, sortOrder, sortField, investorId, assetId } = filter || {};
2228
2292
  let creationDateFilter = '';
2229
2293
  let lastModifiedFilter = '';
2230
2294
  if (creationDate) {
2231
2295
  if (typeof creationDate === 'object') {
2232
2296
  creationDateFilter = `
2233
- {key: "creationTimestamp", operator:GTE, value: "${creationDate.start}"},
2234
- {key: "creationTimestamp", operator:LTE, value: "${creationDate.end}"},
2297
+ {key: "creationTimestamp", operator:GTE, value: ${gqlString(creationDate.start)}},
2298
+ {key: "creationTimestamp", operator:LTE, value: ${gqlString(creationDate.end)}},
2235
2299
  `;
2236
2300
  }
2237
2301
  else {
2238
2302
  creationDateFilter = `
2239
- {key: "creationTimestamp", operator:GTE, value: "${creationDate}"},
2303
+ {key: "creationTimestamp", operator:GTE, value: ${gqlString(creationDate)}},
2240
2304
  `;
2241
2305
  }
2242
2306
  }
2243
2307
  if (lastModified) {
2244
- lastModifiedFilter = `{key: "lastModified", operator:GT, value: "${lastModified}"},`;
2245
- }
2308
+ lastModifiedFilter = `{key: "lastModified", operator:GT, value: ${gqlString(lastModified)}},`;
2309
+ }
2310
+ // ExecutionPlan.investorIds / assetIds are LIST fields (OSS >= v0.28.6, owneraio/oss#590)
2311
+ // holding every id from both the sending and the receiving side. Each filter takes a
2312
+ // single id and uses CONTAINS, which OSS evaluates on a list as exact, case-sensitive
2313
+ // membership of one element. IN / EQ / NEQ are rejected on list fields.
2314
+ // assetIds is the ASSET leg only; the settlement leg lives on settlementAssetIds and
2315
+ // would need a `where: { or: [...] }` expression, which we do not emit.
2316
+ // A blank value is treated as "no filter" and never emitted: a blank CONTAINS predicate
2317
+ // would match no plan, which is not what an empty filter means.
2318
+ const trimmedInvestorId = investorId === null || investorId === void 0 ? void 0 : investorId.trim();
2319
+ const trimmedAssetId = assetId === null || assetId === void 0 ? void 0 : assetId.trim();
2320
+ const investorIdFilter = trimmedInvestorId
2321
+ ? `{key: "investorIds", operator:CONTAINS, value: ${(0, filterUtils_1.formatFilterValue)(trimmedInvestorId)}},`
2322
+ : '';
2323
+ const assetIdFilter = trimmedAssetId
2324
+ ? `{key: "assetIds", operator:CONTAINS, value: ${(0, filterUtils_1.formatFilterValue)(trimmedAssetId)}},`
2325
+ : '';
2246
2326
  const filters = `
2247
2327
  filter: [
2248
- ${!!id ? `{key:"id",operator:EQ,value:"${id}"},` : ''}
2249
- ${!!status ? `{key:"status",operator:IN,value:"[${status.map((st) => `\\"${st}\\"`)}]"},` : ''}
2328
+ ${!!id ? `{key:"id",operator:EQ,value:${(0, filterUtils_1.formatFilterValue)(id)}},` : ''}
2329
+ ${!!status ? `{key:"status",operator:IN,value:${gqlStringList(status)}},` : ''}
2250
2330
  ${creationDateFilter}
2251
2331
  ${lastModifiedFilter}
2332
+ ${investorIdFilter}
2333
+ ${assetIdFilter}
2252
2334
  ]
2253
2335
  `;
2254
2336
  let orderBy = `orderBy:{field: CREATION_TIMESTAMP, direction: DESC}`;
@@ -2257,13 +2339,13 @@ query getExecutionPlanStatus {
2257
2339
  .split(/(?=[A-Z][a-z])/)
2258
2340
  .join('_')
2259
2341
  .toUpperCase();
2260
- orderBy = `orderBy:{field: ${field}, direction: ${(sortOrder === null || sortOrder === void 0 ? void 0 : sortOrder.toUpperCase()) || 'DESC'}}`;
2342
+ orderBy = `orderBy:{field: ${(0, filterUtils_1.formatEnumValue)(field)}, direction: ${(0, filterUtils_1.formatEnumValue)((sortOrder === null || sortOrder === void 0 ? void 0 : sortOrder.toUpperCase()) || 'DESC')}}`;
2261
2343
  }
2262
2344
  const query = `
2263
2345
  query getExecutionPlans {
2264
2346
  plans
2265
2347
  (${filters},
2266
- ${paginateFragment({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
2348
+ ${(0, queryUtils_1.paginateFragment)({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
2267
2349
  ${orderBy})
2268
2350
  {
2269
2351
  nodes {
@@ -2323,7 +2405,7 @@ query getExecutionPlans {
2323
2405
  };
2324
2406
  }
2325
2407
  const filters = `
2326
- (filter: [{key:"id",operator:EQ,value:"${id}"}, ])`;
2408
+ (filter: [{key:"id",operator:EQ,value:${gqlString(id)}}, ])`;
2327
2409
  const query = `
2328
2410
  query getExecutionPlans {
2329
2411
  plans
@@ -2514,7 +2596,7 @@ query getExecutionPlans {
2514
2596
  const { assetId, intentId } = request;
2515
2597
  const query = `
2516
2598
  query getIntentById {
2517
- assets (filter: {operator: EQ, key: "id", value: "${assetId}"}) {
2599
+ assets (filter: {operator: EQ, key: "id", value: ${gqlString(assetId)}}) {
2518
2600
  nodes {
2519
2601
  id
2520
2602
  name
@@ -2534,7 +2616,7 @@ query getExecutionPlans {
2534
2616
  ${certificateFragment}
2535
2617
  }
2536
2618
  }
2537
- intents (filter: {operator: EQ, key: "id", value: "${intentId}"}) {
2619
+ intents (filter: {operator: EQ, key: "id", value: ${gqlString(intentId)}}) {
2538
2620
  nodes {
2539
2621
  ${intentFragment}
2540
2622
  }
@@ -2759,36 +2841,34 @@ query getApproverConfigs {
2759
2841
  if (creationDate) {
2760
2842
  if (typeof creationDate === 'object') {
2761
2843
  creationDateFilter = `
2762
- {key: "creationTimestamp", operator:GTE, value: "${creationDate.start}"},
2763
- {key: "creationTimestamp", operator:LTE, value: "${creationDate.end}"},
2844
+ {key: "creationTimestamp", operator:GTE, value: ${gqlString(creationDate.start)}},
2845
+ {key: "creationTimestamp", operator:LTE, value: ${gqlString(creationDate.end)}},
2764
2846
  `;
2765
2847
  }
2766
2848
  else {
2767
- creationDateFilter = `{key: "creationTimestamp", operator:GTE, value: "${creationDate}"},`;
2849
+ creationDateFilter = `{key: "creationTimestamp", operator:GTE, value: ${gqlString(creationDate)}},`;
2768
2850
  }
2769
2851
  }
2770
2852
  const filters = `
2771
2853
  filter: [
2772
- ${id ? `{key:"id",operator:EQ,value:"${id}"},` : ''}
2773
- ${name ? `{key:"name",operator:EQ,value:"${name}"},` : ''}
2774
- ${referenceId ? `{key:"reference_id",operator:EQ,value:"${referenceId}"},` : ''}
2775
- ${status && status.length
2776
- ? `{key:"status",operator:IN,value:"[${status.map((s) => `\\"${s}\\"`).join(',')}]"},`
2777
- : ''}
2854
+ ${id ? `{key:"id",operator:EQ,value:${gqlString(id)}},` : ''}
2855
+ ${name ? `{key:"name",operator:EQ,value:${gqlString(name)}},` : ''}
2856
+ ${referenceId ? `{key:"reference_id",operator:EQ,value:${gqlString(referenceId)}},` : ''}
2857
+ ${status && status.length ? `{key:"status",operator:IN,value:${gqlStringList(status)}},` : ''}
2778
2858
  ${healthStatus && healthStatus.length
2779
- ? `{key:"health.status",operator:IN,value:"[${healthStatus.map((s) => `\\"${s}\\"`).join(',')}]"},`
2859
+ ? `{key:"health.status",operator:IN,value:${gqlStringList(healthStatus)}},`
2780
2860
  : ''}
2781
2861
  ${creationDateFilter}
2782
2862
  ]
2783
2863
  `;
2784
2864
  const orderBy = sortField
2785
- ? `orderBy:{field: ${sortField}, direction: ${sortOrder || 'DESC'}}`
2865
+ ? `orderBy:{field: ${(0, filterUtils_1.formatEnumValue)(sortField)}, direction: ${(0, filterUtils_1.formatEnumValue)(sortOrder || 'DESC')}}`
2786
2866
  : `orderBy:{field: CREATION_TIMESTAMP, direction: DESC}`;
2787
2867
  const query = `
2788
2868
  query getWorkflows {
2789
2869
  workflows
2790
2870
  (${filters},
2791
- ${paginateFragment({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
2871
+ ${(0, queryUtils_1.paginateFragment)({ after: filter === null || filter === void 0 ? void 0 : filter.after, limit: filter === null || filter === void 0 ? void 0 : filter.limit, skip: filter === null || filter === void 0 ? void 0 : filter.skip })}
2792
2872
  ${orderBy})
2793
2873
  {
2794
2874
  nodes {
@@ -2818,7 +2898,7 @@ query getWorkflows {
2818
2898
  const query = `
2819
2899
  query getWorkflowById {
2820
2900
  workflows
2821
- (filter: [{key:"id",operator:EQ,value:"${id}"}])
2901
+ (filter: [{key:"id",operator:EQ,value:${gqlString(id)}}])
2822
2902
  {
2823
2903
  nodes {
2824
2904
  ${routerWorkflowFragment}