diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 6b6e389d..c9aa5d82 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,19 +1,19 @@ lockVersion: 2.0.0 id: cc3a5766-8b39-40da-a0be-fff57173d8e1 management: - docChecksum: 3bf333ffd4b2b0d832c5511a7e7ff173 + docChecksum: 65d27c3792bbe2f937e9ccf9d6087388 docVersion: "2.0" speakeasyVersion: 1.736.1 generationVersion: 2.845.15 - releaseVersion: 0.6.0 - configChecksum: 976f9a3eab53c25137a5e27a963dcf9f + releaseVersion: 0.6.1 + configChecksum: 2b1a4e81d4d79baeeaa073f49508a590 repoURL: https://github.com/launchdarkly/mcp-server.git installationURL: https://github.com/launchdarkly/mcp-server published: true persistentEdits: - generation_id: c9f94ed6-fdb5-4186-8833-40022a1d0597 - pristine_commit_hash: ef7273def0d4f9ecedf7c4cd0d65c94dfc01b038 - pristine_tree_hash: f3ff54d7e32f317060981863152d5cc14567e21a + generation_id: 46915945-05e8-4a9d-b158-ca8c81eb7e2e + pristine_commit_hash: 508a78c48eb6abee453e48c9a23a0caafe983ec4 + pristine_tree_hash: 0515909d7516ab1e6863823316a8a53f380430ed features: typescript: additionalDependencies: 0.1.0 @@ -59,16 +59,16 @@ trackedFiles: pristine_git_object: 134e78a629b846b88e408199011801852bacc600 FUNCTIONS.md: id: 21b9df02aaeb - last_write_checksum: sha1:b95097a3daa0d2bcd997ffa44a9ff5a01e924b14 - pristine_git_object: a9298490035b3bd7c8049e353df76b34a7a2e907 + last_write_checksum: sha1:21bfac77396cb4ca8f99d60b320c9bd1a91e2a5b + pristine_git_object: a22489e92588d536f606e7b9fae50cbd5acb8f49 RUNTIMES.md: id: 620c490847b6 last_write_checksum: sha1:e45b854f02c357cbcfdb8c3663000e8339e16505 pristine_git_object: 27731c3b5ace66bedc454ed5acbe15075aacd3dc USAGE.md: id: 3aed33ce6e6f - last_write_checksum: sha1:8ecb34ac6dd2963b590796d9177bbd34265afead - pristine_git_object: 261b3550e93fcc422b6894db5a9caabf17200947 + last_write_checksum: sha1:242b0455d02498205230788a7a2a14de8e72ed73 + pristine_git_object: 0e860d6e06a645e34d0fe4e322691ace73b9d80b docs/lib/utils/retryconfig.md: id: 0ce9707cb848 last_write_checksum: sha1:bc4454e196fcd219f5a78da690375a884f5ed07b @@ -133,6 +133,10 @@ trackedFiles: id: fd6a832e98fc last_write_checksum: sha1:9528116dd4184f153c8eec2fbb937b970bd4b2a5 pristine_git_object: 112d49d82043d390a932fe45cd4e071878a464dd + docs/models/components/aiconfigrep.md: + id: 36013fe02c36 + last_write_checksum: sha1:bf8056f99ea81f605141ac569634b9e03c588530 + pristine_git_object: b390f58636a45504f06337eb28f6114dbda39c67 docs/models/components/aiconfigs.md: id: 939eee65c3a2 last_write_checksum: sha1:506fd010e5c544eb8144689325e0d798b1d54694 @@ -337,26 +341,74 @@ trackedFiles: id: 82af9c0d4a1e last_write_checksum: sha1:fb28eb25e55f84c2e2855d5f81db8236707ee302 pristine_git_object: c50ec86631b51775bfa2462c43cc8b3725d9e63a + docs/models/components/conflict.md: + id: 022408366b49 + last_write_checksum: sha1:81c4719f5081d2c105e83bb07e7e7e9165be8edb + pristine_git_object: 8eec0e59832daa2ae8fc52bb3473998d0bbcf8fc + docs/models/components/copiedfromenv.md: + id: ee280318f394 + last_write_checksum: sha1:3cac449b0a5cafabdbbc4351e889d2b5596b0c84 + pristine_git_object: 99ceb8114ce13002b970338761ef4926d5f16af7 docs/models/components/corelink.md: id: 2cd512f6e168 last_write_checksum: sha1:cc7bffbd165151fdbaef69ea15802684de1e7f59 pristine_git_object: 58d6973ba6a0eca486bff4fc136cf5988fa5667b + docs/models/components/createflagconfigapprovalrequestrequest.md: + id: ff7ee8bf5b7c + last_write_checksum: sha1:bf08085c27eedf799df04bb432e66cf19d63c1d7 + pristine_git_object: ebe8da6efc0e11028f32db1487d12be9829ca9d4 docs/models/components/customproperty.md: id: c8bee897a039 last_write_checksum: sha1:a8ae958e014bdf436a299738b9719263d2575b90 pristine_git_object: d73a6a4df24eb38493ec9a8d542cf8128aa77444 + docs/models/components/customworkflowmeta.md: + id: a5475c0106ef + last_write_checksum: sha1:625e93e1add3b2912b1b86f6612c997a0eada5c0 + pristine_git_object: 1ae9857b6d6ac2edb48e45179d097502a8fe925c + docs/models/components/customworkflowstagemeta.md: + id: e816f94c62c4 + last_write_checksum: sha1:7866322d90f3a14e5e19b701b93164191ce38d88 + pristine_git_object: 3fb634202b5bd90ff505dae084ec7105b76859d3 docs/models/components/defaults.md: id: 2389a1b8a2ac last_write_checksum: sha1:6948ddbc3a3c429c5f03b9d556820f745680f068 pristine_git_object: aa8a17de4f20c10fe11d5933064d162bc88a6fec docs/models/components/environment.md: id: 2bbd505fcb39 - last_write_checksum: sha1:7b29b02ef49286d2ea4cc28328987825bbc8b5b5 - pristine_git_object: dd2b19d25f26ec647caf99a8aca57d06e81dde6a + last_write_checksum: sha1:10e59c561a4c8897456ba26fb72d491c36b1f1be + pristine_git_object: 899d86f17735822c1b05121d62c2ee13ecbaceef docs/models/components/environments.md: id: 4c2409d6f530 last_write_checksum: sha1:68149361d60d78dee0011010d8066536c230b829 pristine_git_object: 14230d32a9b11a05e5a88011c19191acff8e7781 + docs/models/components/expandableapprovalrequestresponse.md: + id: cdd48318b5dc + last_write_checksum: sha1:b5fb3c3162122d8d55f990943126424205364812 + pristine_git_object: ef0e3ac218a5a4ce2ea52cc9a85da59fff6f4692 + docs/models/components/expandableapprovalrequestresponsereviewstatus.md: + id: 54bd79e334ca + last_write_checksum: sha1:bfc8c5c6a55aba1a7b6fbd9fe0c5d9d38a472e57 + pristine_git_object: 2d0eaa70e41652e00f47445b2985509d3e05ab73 + docs/models/components/expandableapprovalrequestresponsestatus.md: + id: cb525209b861 + last_write_checksum: sha1:12f057e69d049c58d739cbce50ee804f6433e75a + pristine_git_object: a8926441dbc8761aa9ce2082262354f69539e52e + docs/models/components/expandableapprovalrequestsresponse.md: + id: 8da084524929 + last_write_checksum: sha1:3d7d2ccb44c3815e078dadf81be66a735d16c009 + pristine_git_object: 1d64152dc01d97379a8119e4e6773a830b3d72bc + docs/models/components/expandedflagrep.md: + id: 0dbc85994e12 + last_write_checksum: sha1:d97d23cd2da5516be80c27cb15b11620fd827d7f + pristine_git_object: 4f97ce31362ec8adf0bf017f114e61fd1072ce22 + docs/models/components/expandedflagrepkind.md: + id: 5af33a2266a6 + last_write_checksum: sha1:0d5e1c810d555f4b2388328bbf9876166f5cdf4b + pristine_git_object: 2460b1b11570a5f3f14e5747a886e2d2a7e04928 + docs/models/components/expandedresourcerep.md: + id: a7f251682cc6 + last_write_checksum: sha1:bf6218fd288545da13626b6d7f5311b515d9330e + pristine_git_object: 5e92a20fecd6c4ea6b6df78b7704e0d52482dea9 docs/models/components/experimentallocationrep.md: id: 75a25b7fcabd last_write_checksum: sha1:2ad2284c69e56a2a04d33dc1967e749d9198057f @@ -371,8 +423,8 @@ trackedFiles: pristine_git_object: 16dd1d1ae0c3e4ae731465d99a1eaf0531a7f9af docs/models/components/experimentinforep.md: id: 9ced948a4c0e - last_write_checksum: sha1:62729688993bc747f3c66e0842c792ad1e86ace8 - pristine_git_object: 8823f27f484cc73065e147aebeff015e218ca4d2 + last_write_checksum: sha1:02064b1b0550f7df4c29f4b9e473e93d1612cd05 + pristine_git_object: 0957e6c1ddc1132dbe7746c7eb5224815d62b055 docs/models/components/featureflag.md: id: a3171171929d last_write_checksum: sha1:b91ea008e999d35c1db32622592fb810a657c0b0 @@ -383,8 +435,8 @@ trackedFiles: pristine_git_object: bbaeb9731988d5fb31d5a92b74a25675e2b36b55 docs/models/components/featureflagconfig.md: id: 153c31cea295 - last_write_checksum: sha1:68bec158d44412e48a983c8e8909f26bb12813cb - pristine_git_object: 667e59e63f9015a55f5c80601de04b43d03e5d2a + last_write_checksum: sha1:79348c770fc10438aa06cf0a67804436292867e9 + pristine_git_object: 58a66218bba79715d83ac7968fc6e1c89ff11425 docs/models/components/featureflagkind.md: id: db8ee7215ead last_write_checksum: sha1:1255d5b5cd06bab733ca02be5e0ca4b5b55c5166 @@ -409,6 +461,22 @@ trackedFiles: id: 333639c9dd1e last_write_checksum: sha1:46f98a2b01401be1e7452b64d6b8299d3b0d0b16 pristine_git_object: 83d10a8efe9ebaa85c75220f66a94d20be3b1d0f + docs/models/components/flagconfigapprovalrequestresponse.md: + id: 128806f289b1 + last_write_checksum: sha1:435cc5c273cd392b0c79c62bddd8bb1a1691160b + pristine_git_object: c334b31017d694915f3dc5e4b86a085179c860ae + docs/models/components/flagconfigapprovalrequestresponsereviewstatus.md: + id: 683deb8489bf + last_write_checksum: sha1:73e9eb28a7eb25e78bd5fa7d69c0bf24873e1e0b + pristine_git_object: f36873380cefb3bca02a78397d38896b7a2595de + docs/models/components/flagconfigapprovalrequestresponsestatus.md: + id: 34e62b7660f1 + last_write_checksum: sha1:2b0f85e547efcc72949582cd0d1245fe66bee662 + pristine_git_object: 98f4bce74e31f202f8adde2e89d455bb184a8120 + docs/models/components/flagconfigapprovalrequestsresponse.md: + id: d413537511bc + last_write_checksum: sha1:d3c80089dd286f8816436fbc2a47e1b97a656593 + pristine_git_object: 53924b4bedf34a38cfa5b64877148390ef9bfb0a docs/models/components/flagconfigevaluation.md: id: ddf0871969a9 last_write_checksum: sha1:7275a6cb21c59a694b9dbeae7d1c24142b69279a @@ -417,6 +485,10 @@ trackedFiles: id: 698f0e908d0b last_write_checksum: sha1:c1f4f606e883410ed09bf559df234a4bb864c8ed pristine_git_object: f144e34727a07642cb2fd1a6c11613ed90abe12f + docs/models/components/flaglistingrep.md: + id: 85a3880cfa0b + last_write_checksum: sha1:bc291c884b84ef4e9ef2d46bfb9b803dcb67717a + pristine_git_object: f33fe45014d3ee001e411bd5b27af65f4440595c docs/models/components/flagmigrationsettingsrep.md: id: baa4d0044d89 last_write_checksum: sha1:f6ba5294d0bdc1360892bc07509391481aa7fbc8 @@ -433,6 +505,14 @@ trackedFiles: id: 1053e1594fe4 last_write_checksum: sha1:b08c1b35e20442faecd98b7ad4941b335b19b02d pristine_git_object: ea7b62ecb845573254e543bf2c1317632a042903 + docs/models/components/integrationmetadata.md: + id: 3950c23bb25f + last_write_checksum: sha1:36da84f970cfeffd1c2d6a99e7c69ad37671c3d3 + pristine_git_object: 845970eedd7fe847fe51fe2654428f9e9750409e + docs/models/components/integrationstatus.md: + id: d9a7641f6645 + last_write_checksum: sha1:e39d57fd7436bde0b27b62a318753048048e0b21 + pristine_git_object: 40106664477c0da62f8f53fceaa9593162541686 docs/models/components/judgeattachment.md: id: 928ca0b7e9cf last_write_checksum: sha1:79c9253223af16ca94de45586942e0e3c54bba7d @@ -443,8 +523,8 @@ trackedFiles: pristine_git_object: cda22069e52bd30a260253fba5fc1eaa88507add docs/models/components/legacyexperimentrep.md: id: 93313def1b12 - last_write_checksum: sha1:aa9e5cf6245b0fae44f7fe6a289bd6dd21163e88 - pristine_git_object: 89e8610fab7f53cae11d8015a48055421a31196d + last_write_checksum: sha1:d523823dff7ae52584323159fdc93fba8791919e + pristine_git_object: 0d5ea5117e961fb1d4ab187ff2614a066b2da127 docs/models/components/link.md: id: 9e6e1afe0cdc last_write_checksum: sha1:ba3571df7bab49e1e1c7f05951cf05fe796e42c2 @@ -475,8 +555,8 @@ trackedFiles: pristine_git_object: 9bd2b9f4ca3caf28ea68dd6942265e73a48c66f5 docs/models/components/metriclistingrep.md: id: 8fd7b0cabc96 - last_write_checksum: sha1:91e3433d66d3c6bf3915e70169d0772cbe4418c8 - pristine_git_object: ecd5131f4d4781c4c6b2bf4de3a30b5602470e19 + last_write_checksum: sha1:a9819d3849fe97cc733d43bbf8de910d7411e538 + pristine_git_object: 46e09656ce8c1406d96e30a8127e8c347a687886 docs/models/components/metriclistingrepanalysistype.md: id: 83e55e845186 last_write_checksum: sha1:7b12bc8f068ec1ee232a86ae7d0d71ede631723d @@ -525,10 +605,26 @@ trackedFiles: id: ce3d65fafd4a last_write_checksum: sha1:15643aeddb0b6b7bda4e039939f291b580df9664 pristine_git_object: 5d089d63e692864c1d19dc92acea6cf3b0aee15f + docs/models/components/postapprovalrequestapplyrequest.md: + id: 8d81613022e1 + last_write_checksum: sha1:e3c5dca487ac78b67094a972b8c615434ae61910 + pristine_git_object: 4675fc8fbc9720e3fcdcd48bc0deaf200e0450bf + docs/models/components/postapprovalrequestreviewrequest.md: + id: 8efbd51120e7 + last_write_checksum: sha1:942b08984b306b117184587000338ee08cb53386 + pristine_git_object: 9f8250fb0be17f370f5586e362857e3a088cdadb + docs/models/components/postapprovalrequestreviewrequestkind.md: + id: 7f3692b7b89a + last_write_checksum: sha1:72242df106fb5bc0a9875a3c48429d1b4d6020b7 + pristine_git_object: 204063b509d5b7605f85ce3dd8aa11ba24397e7d docs/models/components/prerequisite.md: id: 0550f93fb00c last_write_checksum: sha1:0a221fb5a7be020bb32001276a71960fc79299df pristine_git_object: 98aaf9ab803cdd90324e6006a3714dc8022e145f + docs/models/components/project.md: + id: e6f9abcd3eff + last_write_checksum: sha1:c79f4067adbd291c06525e2bf1ff2deafbad0c12 + pristine_git_object: c5e027801a7540aa485dee75cc10d34ceb6fc77e docs/models/components/purpose.md: id: 9425b6a9fa5e last_write_checksum: sha1:b69cfde46be813fdb21f6021ce37295ac3870d14 @@ -539,16 +635,24 @@ trackedFiles: pristine_git_object: 724fdcf892e46b765108f3f8077ab2f573691fa3 docs/models/components/repositorycollectionrep.md: id: 8212304cb054 - last_write_checksum: sha1:79025a62f105a5f9b11a288af6e073c88f598f59 - pristine_git_object: 80315327b04320a610519ee0b71b10de20b6dd85 + last_write_checksum: sha1:e4b283669059418edf1d01f241ec864712bdd0d0 + pristine_git_object: 74b47465841568f596a21f607ec492699b0332f2 docs/models/components/repositoryrep.md: id: c945f4228da5 - last_write_checksum: sha1:006a5304b9903d387601ae8e1a46b2a057aaf47a - pristine_git_object: 5236c83bdc4910798fe7d67f0bc609182cec7aab + last_write_checksum: sha1:c2ff376f227b8045a993bfc08a6341b91f25753a + pristine_git_object: c080fcb4c55f5d279a95e1ed98ff441177b4faa2 docs/models/components/repositoryreptype.md: id: 3515ef79e582 last_write_checksum: sha1:32d0d14decda7133ced5154967ad8bad9736f0ff pristine_git_object: c1db573b2f30513f58798ed21345def389c75404 + docs/models/components/reviewresponse.md: + id: 6137caaeda9a + last_write_checksum: sha1:d16cdbf131e36a5f2396afc797ee7ec6185c4cb5 + pristine_git_object: 93d74df35353fa8449833dc006fcf2a5c51d31d2 + docs/models/components/reviewresponsekind.md: + id: 6dd5f31001b5 + last_write_checksum: sha1:87f6751c0d7cff7af6127ce4fa97bc63ba0783fc + pristine_git_object: a39b7cc8511b7b8ac714512404f91b834a2f2f08 docs/models/components/rollout.md: id: 272e34d6ae8f last_write_checksum: sha1:458f825709a99251022e6793aa4f99572d179167 @@ -561,10 +665,26 @@ trackedFiles: id: 54906b49ea28 last_write_checksum: sha1:30f9b50db444802ccdafe7b6453b0ea227590ede pristine_git_object: df3ba19616399c02e6e7cb4e6e5579459bdeefd6 + docs/models/components/segmentmetadata.md: + id: 2a493da35c71 + last_write_checksum: sha1:ebb2517ca75b60831ab688c92a2e4b6e36402a1c + pristine_git_object: 71d11e3dc1ede14b63bea0613a6f0a013709978c + docs/models/components/segmenttarget.md: + id: ca5c902be07a + last_write_checksum: sha1:0a4100a9b838875a64bbab648017e710e8aef458 + pristine_git_object: a57cc5fb76bddc75b7fdf17b24ba86030e4ca551 docs/models/components/target.md: id: 6b01d6776a4e last_write_checksum: sha1:1dd75078653d39e587c14637d784bc3270b7f9bb pristine_git_object: 979126da7cd2392ef7c251988234d54eef1ce006 + docs/models/components/usersegment.md: + id: 2902ecbdc90f + last_write_checksum: sha1:48fbf7e7fc28b8be0966779b0fabf1d3f03d81b6 + pristine_git_object: 367f725c6ab0383cd2e1335c15335b7f977b4a33 + docs/models/components/usersegmentrule.md: + id: e57c598c5e45 + last_write_checksum: sha1:351937b796b85caa6f5e29fc43ab340fab076d26 + pristine_git_object: b8301feb448bceaa72a9bcb3b7d9f5cd0d86ba5d docs/models/components/variation.md: id: 95680a8c739f last_write_checksum: sha1:854624b4fa02e09c9651357e1e05361c18c1a65b @@ -629,6 +749,10 @@ trackedFiles: id: 685353a40a17 last_write_checksum: sha1:996298c68ca7fa5a8def0c25a4dd3e1cf2536097 pristine_git_object: a4578df4dcba6ae5803c4141afe63965d5f8968e + docs/models/operations/deleteapprovalrequestforflagrequest.md: + id: d71a1a8248b9 + last_write_checksum: sha1:f916edaca5a265d8b1d4d2cd9705872b1d6819ab + pristine_git_object: dc63787e23752576682e0e40a5e1741b4ee7e2b8 docs/models/operations/deletefeatureflagrequest.md: id: 01394f6e0776 last_write_checksum: sha1:ebd8b5360fa7ad312d7171923d3a9bd8b2105230 @@ -649,6 +773,18 @@ trackedFiles: id: a728e45bb955 last_write_checksum: sha1:4495b9dccd52600483329c47cdd092a68db8741a pristine_git_object: 9a8627dab2535e34a3330f5253930f36e8be2245 + docs/models/operations/getapprovalforflagrequest.md: + id: 35afd4ceb96f + last_write_checksum: sha1:1d1a22a4fdc7b9fd96761604fe86d826f7f92c33 + pristine_git_object: e60bcc14f6e4a692b94a77434491e92b20faaad1 + docs/models/operations/getapprovalrequestsrequest.md: + id: ef0b5c318422 + last_write_checksum: sha1:d88acc06779ffdba7fc0836fa1d34b82481a78bb + pristine_git_object: cb049c02e53c79ce5e330b9f6df806dd274f81de + docs/models/operations/getapprovalsforflagrequest.md: + id: 323f0b664ac0 + last_write_checksum: sha1:2ce4f79af10f5240c119b5614be690c1f3d237db + pristine_git_object: 28de9a45deb3ddd3838cb0eef32df45a10a0da63 docs/models/operations/getenvironmentsbyprojectrequest.md: id: 9fc1ae07e3cb last_write_checksum: sha1:10ec8a7535dd617cc74bed2e6653a3edd34cf227 @@ -693,6 +829,18 @@ trackedFiles: id: 380b9d6fe341 last_write_checksum: sha1:1f95e4c22047925c0b0a4e74d26c9a4969ccc14c pristine_git_object: 11cf943c061aab904f68f0fcb883476d9de7291f + docs/models/operations/postapprovalrequestapplyforflagrequest.md: + id: 29ed99760149 + last_write_checksum: sha1:a99e8465c9157505eccaca8f1510cfc9da4af2ad + pristine_git_object: 2424937fcc8d0efbcb7d9137576683259723469e + docs/models/operations/postapprovalrequestforflagrequest.md: + id: 37c5da3048b1 + last_write_checksum: sha1:25ae898cbec4599f2ef9a381c0f918188b989f28 + pristine_git_object: 8ede1b92ee38eca97bea52e2abfbdad58504b102 + docs/models/operations/postapprovalrequestreviewforflagrequest.md: + id: b87262efe311 + last_write_checksum: sha1:19719648660fc807e557a893553ef7eb95597601 + pristine_git_object: c764f5eb9addf7cc593a0fb998d4634571f9c9ed docs/models/operations/postfeatureflagrequest.md: id: 4b77dcacba74 last_write_checksum: sha1:b131140d95a7d00ae6abdb5efa46741d5a6145e2 @@ -701,6 +849,10 @@ trackedFiles: id: 33e1db755b36 last_write_checksum: sha1:daa4714482492fdfd120e40dabed6b8f948a616e pristine_git_object: 145c051a513de8cbbbdd47866376caba7487c42d + docs/sdks/approvals/README.md: + id: 560b4bbe7303 + last_write_checksum: sha1:7f8d8f3c858a3fbe0b3f17a012adb5f1527c96f2 + pristine_git_object: 1e00230056a1787a1af1ae16b1157723696a1d81 docs/sdks/codereferences/README.md: id: 5aeaba1478ce last_write_checksum: sha1:00a003d758bd164b0fe4b7dfd895684fcfd43413 @@ -725,22 +877,22 @@ trackedFiles: id: 9d0f69d6e677 last_write_checksum: sha1:a7bb5dedb2ee9ba274f0507f67a1687d1305464e pristine_git_object: 37d8dd45f7990352b95be8e5aac91908798a27c2 - examples/codeReferencesListRepositories.example.ts: - id: 4eec9f2b32b7 - last_write_checksum: sha1:670220562ea0daab7632b55301633bdaee154cba - pristine_git_object: b8dd9cda0788a8cf0c845e7cddb3656857076f8c + examples/approvalsList.example.ts: + id: 9ba6a16a9c71 + last_write_checksum: sha1:b9eb12293e52a760949f232920d443009c138972 + pristine_git_object: 8b9011a71eb542a5bef0386655bacb7fe9d9a7f7 examples/package.json: id: c1d7b0ec8e7e last_write_checksum: sha1:7bc4907d34572dbf5ce2bf130db420d3a064ff06 pristine_git_object: b6d40ae05716a1243a0adf677aef02a56b724541 jsr.json: id: 7f6ab7767282 - last_write_checksum: sha1:89ed0ca9be634c5a6cdde5a6a0f3132438d58bc7 - pristine_git_object: 26ca5f132869d2bd2f01bc4464fc7bad5bc46943 + last_write_checksum: sha1:60bcfa39114c45ed0d9f6cfaffca0bcf28176e4c + pristine_git_object: 2bbfb1cad7c598438f86edbf512d39834e500751 package.json: id: 7030d0b2f71b - last_write_checksum: sha1:f429edd953308ae302061d209cd8545d8aec3a30 - pristine_git_object: e4b50d14b5003c0ea3db3ab4436beec55893fd90 + last_write_checksum: sha1:5547292855f64b8e58da9cf92f9f347e4e88e195 + pristine_git_object: 3c1c18fd273d7cae91ac8fe43bfe0346d317f000 src/core.ts: id: f431fdbcd144 last_write_checksum: sha1:c5377e0f566bb6fa8c1f40abad8ed8e2afeff228 @@ -789,6 +941,34 @@ trackedFiles: id: 9ea8114bf389 last_write_checksum: sha1:03f87922d414cf09774a8b552f2df1f86cb3fd0c pristine_git_object: 60d3ccf6931541c9fc033988126defc18e33bd8d + src/funcs/approvalsApplyRequest.ts: + id: 9a8ac265214a + last_write_checksum: sha1:5c6ee3812ff14f2a85f9f309af7625c60ebeb019 + pristine_git_object: 96ffe06943b32194b834e74d3c651089b55a4dae + src/funcs/approvalsCreateRequest.ts: + id: be9fc029b8c9 + last_write_checksum: sha1:8db7c66f78e1b18f64060d49601491689c83a942 + pristine_git_object: 2439d842ecdd00483425fe6634a3bb8a45d1d0f7 + src/funcs/approvalsDeleteFlagRequest.ts: + id: 1eefad5a955f + last_write_checksum: sha1:f0c90afb5dacade56e67ea0033d7f14006953ce5 + pristine_git_object: 40f8526b69330bf2044f185303f1a26f484b46a7 + src/funcs/approvalsGetForFlag.ts: + id: bfeab75744d8 + last_write_checksum: sha1:7964ab02f401064911a73b6054efcd794bc19e45 + pristine_git_object: ab81f7ec54e58858a1ed5aadb1665159044a7fab + src/funcs/approvalsList.ts: + id: b33f6c268cca + last_write_checksum: sha1:3a68cb8385bc318688328568ae1d330a08a6416f + pristine_git_object: aa81ccce98ef768475fafffe366b1d3595f40d55 + src/funcs/approvalsListForFlag.ts: + id: cc8283902c7a + last_write_checksum: sha1:03acd7aaae6b452f5ebf19ebc38da108d4a5cfd6 + pristine_git_object: 84ef6d13e1cc1522485ced9c6735cfbcac2b89e7 + src/funcs/approvalsReviewFlagRequest.ts: + id: 887decee95ef + last_write_checksum: sha1:9ad4276ce7a8231bb2c180f0bbf5fc144c469f47 + pristine_git_object: a8940244bd081dfed0ee56cd270e2d4b203f8fe6 src/funcs/codeReferencesListRepositories.ts: id: 8a43b229d197 last_write_checksum: sha1:711f7f82f812c7257e344591a713f738854a0f93 @@ -843,8 +1023,8 @@ trackedFiles: pristine_git_object: 0aebd8b0a4867e35cb3348fc52921c3c0b4725b7 src/lib/config.ts: id: 320761608fb3 - last_write_checksum: sha1:8060f84ef1eb510133a65b800a8416c65a6756cf - pristine_git_object: 51bf16a74bbc1e7e0663e3f6772d8995f7436a91 + last_write_checksum: sha1:e2872cb8000c5227cc0547ae2c29ce88c27c6982 + pristine_git_object: adfb0e6a6575e9b99304d1a157fd747760d02a6a src/lib/dlv.ts: id: b1988214835a last_write_checksum: sha1:1dd3e3fbb4550c4bf31f5ef997faff355d6f3250 @@ -927,8 +1107,8 @@ trackedFiles: pristine_git_object: 0955a573c2ce989d63c737410ab8cc28706d9f74 src/mcp-server/mcp-server.ts: id: aabbc4ab07c1 - last_write_checksum: sha1:14abc2979c582424ede0f99e2472bdf108dda818 - pristine_git_object: 9b19ebc6ff00562e476a3ff8026ce96010803368 + last_write_checksum: sha1:3d3374e7a9af9bdf8d737a7eb7726e03d20ea575 + pristine_git_object: 78af261e961c59a4b6807fe8d5f7a1e3527c39ba src/mcp-server/prompts.ts: id: 26f3d73cbf31 last_write_checksum: sha1:d6c2743fa03a583234144acfc5c3a5008a355107 @@ -943,8 +1123,8 @@ trackedFiles: pristine_git_object: cb8330e4ae705d283de6ab337eefd3b4b8191fca src/mcp-server/server.ts: id: 2784dd48e82a - last_write_checksum: sha1:48742774d3b4f7b0c129f8b0425302bd0930245a - pristine_git_object: ae6587e12709fcc6ff1078a9ead7a8178ca0be04 + last_write_checksum: sha1:6ef1642a6d9e4358c0a8006123b6a2b82056ae91 + pristine_git_object: cb8df07807ff7a0cf17e756bb76b48da47ff7a94 src/mcp-server/shared.ts: id: 074e80d4be1e last_write_checksum: sha1:56c73d4429691516e35541825e759a0285747a2b @@ -997,6 +1177,34 @@ trackedFiles: id: 6ce420678575 last_write_checksum: sha1:32234703280f640d61252e4984be7d5e6808f4ac pristine_git_object: de063968e4a73fe7575a221ffe8aa24d0c2ec5e7 + src/mcp-server/tools/approvalsApplyRequest.ts: + id: d79e0e79ab32 + last_write_checksum: sha1:2bd7ab660be97c039fff3bb92915a1ed164916b7 + pristine_git_object: a47213938fdaf108ee2cbcd854209099db334163 + src/mcp-server/tools/approvalsCreateRequest.ts: + id: 233b1e4ee413 + last_write_checksum: sha1:9d47305d1c60bb2ffac4182ef405ade2130e56ff + pristine_git_object: 3be08244b18113567b3d52569e5fbf8392c23dc4 + src/mcp-server/tools/approvalsDeleteFlagRequest.ts: + id: 6f26a4e2b534 + last_write_checksum: sha1:d6f2172ed65a582c1e077639b3c58fe7b28006ff + pristine_git_object: bc84f3826cf30afe973c27f6d1970bf8adf1a1ef + src/mcp-server/tools/approvalsGetForFlag.ts: + id: b01870cade2f + last_write_checksum: sha1:0f173624b3aaebdd2c6dd0663b91bf29461be1c9 + pristine_git_object: f99c5a633eda7aad1951aaa932a08ff5b0e35d06 + src/mcp-server/tools/approvalsList.ts: + id: 7c5c5468624a + last_write_checksum: sha1:7cfc1787a32c16d5699d68dc938b4d31cc95f41b + pristine_git_object: 094b8bd76c7a97fc76966cde4da9632392ab576c + src/mcp-server/tools/approvalsListForFlag.ts: + id: 197088720d13 + last_write_checksum: sha1:5810d493e01236449be52f2c1e82b91d17818f71 + pristine_git_object: 876408b80d12b3d94828484128ced9609be41065 + src/mcp-server/tools/approvalsReviewFlagRequest.ts: + id: 62385749c3c7 + last_write_checksum: sha1:dfbcf0f9fd6e111f62ddb021d7185b0347dba83d + pristine_git_object: b6fe4005f07e6ffde18f93b90c50738851538960 src/mcp-server/tools/codeReferencesListRepositories.ts: id: 1c9f9152f67b last_write_checksum: sha1:a022c7bcda69de555bee7f92f45d1b390aa9f2be @@ -1069,6 +1277,10 @@ trackedFiles: id: d6112c658632 last_write_checksum: sha1:2052511cfae7b6650bf341e7be2ee5bc2864c16f pristine_git_object: df02a4b7714e79aea8343a752a54d1cbc77ec689 + src/models/components/aiconfigrep.ts: + id: ff7516ea191d + last_write_checksum: sha1:405732f6c08c49345878373a92e916fb70178b9b + pristine_git_object: 120196519efcef783fede983a3211b81f9f1dc91 src/models/components/aiconfigs.ts: id: 3d27f63810aa last_write_checksum: sha1:3b9386a11975913af70fd7b47b5798f2f8653c80 @@ -1229,14 +1441,34 @@ trackedFiles: id: df03b77ebc0b last_write_checksum: sha1:f49852f62b2e94c68eb5232ece7b448ee022ca2a pristine_git_object: 6881bdeafa19c334a2c7a886d8a16c4e081f817b + src/models/components/conflict.ts: + id: b168990eed88 + last_write_checksum: sha1:2fbb516353ea5b5be39df55d313dbff27979683f + pristine_git_object: bb8d848319fc70e8bc058d4a2b93da7620bbf611 + src/models/components/copiedfromenv.ts: + id: 57023219de34 + last_write_checksum: sha1:7d12b2f67ab010f2aeeabfa468b84a3b7bf2f5e4 + pristine_git_object: 7a0f0c1ff17adfb90b1b9a274a0bd9dffdf659e5 src/models/components/corelink.ts: id: a88c3fb9d248 last_write_checksum: sha1:232021127cbd109649519f8e76abacff0bd2acfd pristine_git_object: 1a74880e07ff2e2ff40278efbf22de839a2e2b2e + src/models/components/createflagconfigapprovalrequestrequest.ts: + id: 04e1cd0d4ca7 + last_write_checksum: sha1:6bfcf396e194fe4730617a9e5a2dc1897f4300c5 + pristine_git_object: b22995a4d03dd72d76ef43a0b1d2265f0306f76a src/models/components/customproperty.ts: id: b6a6f826fc01 last_write_checksum: sha1:2770facf5cba9344c1069c4c84796f24b1378fb5 pristine_git_object: 616ac36f6eb3a3fb42f7148d0646284c149d25b3 + src/models/components/customworkflowmeta.ts: + id: e9eeecfa59e5 + last_write_checksum: sha1:cc0e4f14e0a3ad974da75841c7f34b133cc75d52 + pristine_git_object: a142f4a0c000ef34737512ea2e307b5b20ccf958 + src/models/components/customworkflowstagemeta.ts: + id: 163fc9ffa767 + last_write_checksum: sha1:1ab955952cf13788be59d5e216de3a3f1d0c3923 + pristine_git_object: 6c5b74db3486ebed1caeb7e546c87e5549985d5b src/models/components/defaults.ts: id: a776d0fdbf45 last_write_checksum: sha1:7dfb2f074d8cbfa49a9923a34a96a9fd25270768 @@ -1249,6 +1481,22 @@ trackedFiles: id: 0fe02e80bec9 last_write_checksum: sha1:89011514f4c70315c89bc59150615bfff7b5ef82 pristine_git_object: adae412c07aad0b19269c87253794ec8729befe5 + src/models/components/expandableapprovalrequestresponse.ts: + id: bbfbd486858f + last_write_checksum: sha1:407c9038d318408ff6adc230d3ee38e6469d8a2a + pristine_git_object: 3d9750c7171df102d156442445968a8f040d9294 + src/models/components/expandableapprovalrequestsresponse.ts: + id: 82332c3c73d8 + last_write_checksum: sha1:eedb642c85f8b4a6c38f5b323739bb4be16e0a85 + pristine_git_object: 46a4912ab95a58700190fd76ff554140ad7e1602 + src/models/components/expandedflagrep.ts: + id: 9fe9c7f33c9b + last_write_checksum: sha1:a36173f5ff10474c9ce3fbfbb0d1928eef8df50e + pristine_git_object: 1c85e007ba8cb00967454ee43c72cc765fad0ff2 + src/models/components/expandedresourcerep.ts: + id: c07ac61579b8 + last_write_checksum: sha1:4dc8d40a49d1185f5078abcffb933cb5e88043cb + pristine_git_object: 8791db84e8179d17b1f677af72c81cdc259d060b src/models/components/experimentallocationrep.ts: id: f3f424ebcb27 last_write_checksum: sha1:35fffee54c7e243e1d9fed58ab17668bde829b6b @@ -1293,6 +1541,14 @@ trackedFiles: id: 7824d6e24147 last_write_checksum: sha1:a4a566ba7fb85f2429e8b2dacf164d48146f2e66 pristine_git_object: ee73ee24a49885c01f4c4a60db96f8432180b077 + src/models/components/flagconfigapprovalrequestresponse.ts: + id: d669730251a1 + last_write_checksum: sha1:c3355de642ca99198dd2f9435bca116658dfd300 + pristine_git_object: 0f1ba98517ef6908b05ea694c3e2bf78d822b634 + src/models/components/flagconfigapprovalrequestsresponse.ts: + id: 0f0d1f515325 + last_write_checksum: sha1:e281df5ddb705dbbee67c7c6415b6a3efcffa633 + pristine_git_object: c5d971e5726d475b1db490611e9822e50c4a2812 src/models/components/flagconfigevaluation.ts: id: bdcd6b18c156 last_write_checksum: sha1:80d80a92ba6daaca6f3234cf5b72f4751c3ff1b0 @@ -1301,6 +1557,10 @@ trackedFiles: id: 8d6cf48f395c last_write_checksum: sha1:5ed684b095a2602d0ba898e553a450dd4747911e pristine_git_object: e863a17c1d26333d77542c1871cc9b476898fdad + src/models/components/flaglistingrep.ts: + id: f5756a34034e + last_write_checksum: sha1:e81af347229a37dae278419492ae5d34c12b2a7e + pristine_git_object: de27c71edb63076f70c9a4c7b7182b5542ad8ac5 src/models/components/flagmigrationsettingsrep.ts: id: 46021c7f0658 last_write_checksum: sha1:f3e6cf6f7893555a6c54bfdbde164c10bcea585b @@ -1319,8 +1579,16 @@ trackedFiles: pristine_git_object: f79ca268af0bcff8f774e6a8f409e8c0430744de src/models/components/index.ts: id: 0aa842dce54d - last_write_checksum: sha1:9229373918f7f4bb6e43619e93c4f8141a478410 - pristine_git_object: 8f2cf4a19e8402ef92f70071b8f34dd5de6c6e91 + last_write_checksum: sha1:d67833e566424ee37fe5348d889f5dde2b25825b + pristine_git_object: 9723012e64426c513b09d356c75363fce929e47d + src/models/components/integrationmetadata.ts: + id: a4fd2ec837b3 + last_write_checksum: sha1:42ffc9fa25803c1005e9d134ec702c1c2a95c897 + pristine_git_object: 856b2fb84b45486e8d2c51814179f420eea58c18 + src/models/components/integrationstatus.ts: + id: fdd6166558ac + last_write_checksum: sha1:9364583c6ee75eefb8865a7ff86da941974cf75d + pristine_git_object: b0e6e13dc5fc05fede19347d3a6422e3a6a250a3 src/models/components/judgeattachment.ts: id: 7db7cd145f8a last_write_checksum: sha1:2c149936872d3e4257903aae47951e9bfb01926d @@ -1389,10 +1657,22 @@ trackedFiles: id: e0b41ec8d1ee last_write_checksum: sha1:cf695b1ce43110461edacce9111a54a9fe570ab1 pristine_git_object: 2f29f9ee10b3c54c38bdab3b8e0c3ffe986f1a41 + src/models/components/postapprovalrequestapplyrequest.ts: + id: 375ef3ac4ad2 + last_write_checksum: sha1:ddbd0948462537be9f2e47b64f52a35be597d7c0 + pristine_git_object: 959bdb8b86fe8c78e54c76b0f274632be3dfafea + src/models/components/postapprovalrequestreviewrequest.ts: + id: cf70626979d3 + last_write_checksum: sha1:194ffdf147b7f7bcf32085e2c67e3b53090ba27d + pristine_git_object: ca9fde05578c215cf93a044f98b9d1221c6177c8 src/models/components/prerequisite.ts: id: 15d5461a4e24 last_write_checksum: sha1:183b324cf0996648fb4b7867d837d853463f1e4e pristine_git_object: 946c6e1dfc85ddea6dc3de4698b752821b4e3972 + src/models/components/project.ts: + id: 0a0f965206a3 + last_write_checksum: sha1:1a2fce10699640004159e93d211474fe3a1c5e5e + pristine_git_object: 5b2e74815470b8146dc8a8cb8b9fa33a990121f8 src/models/components/referencerep.ts: id: 03a9f3bd2ccf last_write_checksum: sha1:af8a40ce0a2d285d8fbc7f05868da677311ee12c @@ -1405,6 +1685,10 @@ trackedFiles: id: dd0bc2761da2 last_write_checksum: sha1:badf4924bd6d028e987a534ec20062efc16a1c1a pristine_git_object: 202b38b779e7acd7e595c2402e2ad1165751c6cc + src/models/components/reviewresponse.ts: + id: bbea8e79b0a7 + last_write_checksum: sha1:2eddecc3116f416cd1d9f1be86e56f3a918117bd + pristine_git_object: 1c62fdd8680d3729d922ee3383618802443b7bae src/models/components/rollout.ts: id: e950821b2b36 last_write_checksum: sha1:ae7676ab2fb87cb34eb3179558d318da812d7ca1 @@ -1417,10 +1701,26 @@ trackedFiles: id: 472dde81bb1c last_write_checksum: sha1:009bd7a101e5ec4b52b26eedc0283683d2a1cc66 pristine_git_object: f452d99fe997c568f3dcf5ccebf44e4e4f249a95 + src/models/components/segmentmetadata.ts: + id: a61718fcf5ea + last_write_checksum: sha1:729230c064b9dc3509896b07435c8d6c603ecf72 + pristine_git_object: c4cf8aa57d6c158f9572a9ea06d65ea66a9ac9f3 + src/models/components/segmenttarget.ts: + id: 666ff522b0ff + last_write_checksum: sha1:ea7992ca8834be70ff432f56d4f9f2660423a635 + pristine_git_object: 9d8bcc42c7b7ec5f538aaedaa4658ce45fb83247 src/models/components/target.ts: id: 8eaaafcaacef last_write_checksum: sha1:09c619d29b0e5f571a69526d8537f9a2ccf14b6a pristine_git_object: 629a1aa6132bb4229b7bb0e35bbba835f2d4be8b + src/models/components/usersegment.ts: + id: f29dcb0e52ec + last_write_checksum: sha1:8868bc89d8fa61a16fae0c9d142702e26a388efc + pristine_git_object: 3467db041d6a2ffa1b7bc25fd84cf84fa2d1ffcc + src/models/components/usersegmentrule.ts: + id: 265e9e68f0fc + last_write_checksum: sha1:70c3f6f1616a26b0cc2fdd6f6d14a48459aa5f98 + pristine_git_object: 6197af2347b6cb79f242376a4dd342458a3e613a src/models/components/variation.ts: id: 2927c1e8372f last_write_checksum: sha1:8a79fe98ede9968785583984f3e11de18025b3e1 @@ -1509,6 +1809,10 @@ trackedFiles: id: 607aca12f714 last_write_checksum: sha1:46f35c442a658e3f63d6d0159b7328b3c361abd8 pristine_git_object: da8befd62ca7f84dda9f8f2915b09471368d2d6d + src/models/operations/deleteapprovalrequestforflag.ts: + id: 368eac90413e + last_write_checksum: sha1:bb098b5b43092980ca6bd240f8efeb0d8b6b03b3 + pristine_git_object: 8e04748e080d2edc2c2ea0edb861ccd13846cf24 src/models/operations/deletefeatureflag.ts: id: 9b374bc750b0 last_write_checksum: sha1:128fb856350aa8637d2961389985bf33a06fb320 @@ -1529,6 +1833,18 @@ trackedFiles: id: 7b8bf3e3a2b8 last_write_checksum: sha1:0cf2566adf723d404e2665f07cef572f2aca87a0 pristine_git_object: 917b2b69091dec7e03bf9c3d9e08aadd6b0289b1 + src/models/operations/getapprovalforflag.ts: + id: a54e891206ab + last_write_checksum: sha1:37cb92a7116911639e3027e9b4d45b5666eb5998 + pristine_git_object: 6f244fe95468f3b0a555fbaff90d6f8fb52bbb25 + src/models/operations/getapprovalrequests.ts: + id: fb3990eee0b9 + last_write_checksum: sha1:c2cfd46305bac51c878a72478585a5e3a7da4ffc + pristine_git_object: 5140d873abd5936a3163a9b6e67b7f6bbc18a2c6 + src/models/operations/getapprovalsforflag.ts: + id: 350929974b34 + last_write_checksum: sha1:9f2c0225e91da4149d9d4dc037de28f32ceaad42 + pristine_git_object: 717cdccedb7b8d9bd567bcd00a513abd9d24c04b src/models/operations/getenvironmentsbyproject.ts: id: 12978c05182c last_write_checksum: sha1:850485c136b7715a0532328d37095b263e624359 @@ -1551,8 +1867,8 @@ trackedFiles: pristine_git_object: fee835a0b59424600ee5c4254c504fb0a477ffeb src/models/operations/index.ts: id: 0d9ffaf774d2 - last_write_checksum: sha1:3b596fbfabf90699e26e53d713b1b7c079c136ab - pristine_git_object: ae336a9924cf2d02f4d5b97d412c0b8ba2017e84 + last_write_checksum: sha1:4e936caf3d2b3449c0c9afe0780d3c1a615be181 + pristine_git_object: 69fe7d3015522e95102a972a8dcb2c12d1370926 src/models/operations/patchaiconfig.ts: id: 7a729862abd6 last_write_checksum: sha1:566329388f617b0a9f622211bff6352f2995f5f4 @@ -1577,6 +1893,18 @@ trackedFiles: id: 0d4783db7278 last_write_checksum: sha1:af8a81b320c96ea6d7841227a47b3c41f4a7d46d pristine_git_object: 1896842cf9e33bb0b947d633896092219370ec3f + src/models/operations/postapprovalrequestapplyforflag.ts: + id: eea8a58046ec + last_write_checksum: sha1:e153146620a4d1ff0ad553fcaea49daecb01a9a0 + pristine_git_object: ac4920eb58c67d5f5fbba73add5d4f31634721f0 + src/models/operations/postapprovalrequestforflag.ts: + id: f798457aa0aa + last_write_checksum: sha1:f73e5465450a6919317ebc52b77a49df7420acee + pristine_git_object: c9987cb521489036374530a5ce29ecff38c9199d + src/models/operations/postapprovalrequestreviewforflag.ts: + id: 50d2f740ae72 + last_write_checksum: sha1:6b27029cb960f1d084cfc25fcae35257692264c9 + pristine_git_object: 856bf91ed7c09451603399a94d5cf6dc1973a623 src/models/operations/postfeatureflag.ts: id: e7c7535586e2 last_write_checksum: sha1:06971ee5850983b089fc2c00d28b7b4e63343982 @@ -1585,6 +1913,10 @@ trackedFiles: id: 37e59331bfe5 last_write_checksum: sha1:10b28837a75334436fb6283f58ce2b3abff4f3a8 pristine_git_object: 9912ef6dd7d9d80ec3ca2f24c60ea2e8c11ef60b + src/sdk/approvals.ts: + id: fa2eea1d44e5 + last_write_checksum: sha1:459b17a2a1e5a216118b53c2a1885c54d3104f55 + pristine_git_object: bd079fcd6489caf075608f97eca2afab5fdfa772 src/sdk/codereferences.ts: id: 7c1554a57788 last_write_checksum: sha1:18ae11c1bc019136480460aa9227cc7f69bc0f90 @@ -1603,8 +1935,8 @@ trackedFiles: pristine_git_object: ecac2264817bb369ff2dbf0f0e9029807e67ff77 src/sdk/sdk.ts: id: 784571af2f69 - last_write_checksum: sha1:41238a864fa60d05fc423bdd90c7340afad1f9e1 - pristine_git_object: 0e739d4c1033f53fa29e1a6ab2b87ffc7c2a6f7d + last_write_checksum: sha1:a2a6fdfce39958cef0584e16282eaeb06bb230b3 + pristine_git_object: 823e5f1921d15fd8b2ef6a37d9e9b112206e2cf6 src/types/async.ts: id: fac8da972f86 last_write_checksum: sha1:3ff07b3feaf390ec1aeb18ff938e139c6c4a9585 @@ -1906,7 +2238,7 @@ examples: speakeasy-default-get-approval-requests: responses: "200": - application/json: {"items": [{"_id": "12ab3c45de678910abc12345", "_version": 1, "creationDate": 542910, "serviceKind": "", "requestorId": "12ab3c45de678910abc12345", "description": "example: request approval from someone", "reviewStatus": "pending", "allReviews": [], "notifyMemberIds": ["1234a56b7c89d012345e678f"], "appliedByMemberId": "1234a56b7c89d012345e678f", "appliedByServiceTokenId": "1234a56b7c89d012345e678f", "status": "pending", "instructions": [{"key": "", "key1": ""}, {"key": ""}], "conflicts": [{}, {}], "_links": {"key": ""}, "operatingOnId": "12ab3c45de678910abc12345", "source": {"key": "source-flag-key-123abc", "version": 1}, "customWorkflowMetadata": {"name": "Example workflow name", "stage": {"index": 0, "name": "Stage 1"}}, "approvalSettings": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "project": {"_links": {"environments": {"href": "/api/v2/projects/my-project/environments", "type": "application/json"}, "self": {"href": "/api/v2/projects/my-project", "type": "application/json"}}, "_id": "57be1db38b75bf0772d11383", "key": "project-key-123abc", "includeInSnippetByDefault": true, "name": "My Project", "_access": {"denied": [{"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}], "allowed": [{"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}]}, "tags": ["ops"], "environments": {"totalCount": 2, "items": []}}, "environments": [{"_links": {"self": {"href": "/api/v2/projects/my-project/environments/my-environment", "type": "application/json"}}, "_id": "57be1db38b75bf0772d11384", "key": "environment-key-123abc", "name": "My Environment", "apiKey": "sdk-xxx", "mobileKey": "mob-xxx", "color": "F5A623", "defaultTtl": 5, "secureMode": true, "defaultTrackEvents": false, "requireComments": true, "confirmChanges": true, "tags": ["ops"], "approvalSettings": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "resourceApprovalSettings": {"key": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "key1": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}}, "critical": true}, {"_links": {"self": {"href": "/api/v2/projects/my-project/environments/my-environment", "type": "application/json"}}, "_id": "57be1db38b75bf0772d11384", "key": "environment-key-123abc", "name": "My Environment", "apiKey": "sdk-xxx", "mobileKey": "mob-xxx", "color": "F5A623", "defaultTtl": 5, "secureMode": true, "defaultTrackEvents": false, "requireComments": true, "confirmChanges": true, "tags": ["ops"], "approvalSettings": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "resourceApprovalSettings": {"key": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "key1": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}}, "critical": true}, {"_links": {"self": {"href": "/api/v2/projects/my-project/environments/my-environment", "type": "application/json"}}, "_id": "57be1db38b75bf0772d11384", "key": "environment-key-123abc", "name": "My Environment", "apiKey": "sdk-xxx", "mobileKey": "mob-xxx", "color": "F5A623", "defaultTtl": 5, "secureMode": true, "defaultTrackEvents": false, "requireComments": true, "confirmChanges": true, "tags": ["ops"], "approvalSettings": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "resourceApprovalSettings": {"key": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "key1": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}}, "critical": true}], "flag": {"name": "My Flag", "kind": "boolean", "description": "This flag controls the example widgets", "key": "flag-key-123abc", "_version": 1, "creationDate": 673862, "variations": [{"_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05", "value": true}, {"_id": "a00bf58d-d252-476c-b915-15a74becacb4", "value": false}], "temporary": true, "tags": ["example-tag"], "_links": {"parent": {"href": "/api/v2/flags/my-project", "type": "application/json"}, "self": {"href": "/api/v2/flags/my-project/my-flag", "type": "application/json"}}, "maintainerId": "569f183514f4432160000007", "_maintainer": {"_links": {"self": {"href": "/api/v2/members/569f183514f4432160000007", "type": "application/json"}}, "_id": "569f183514f4432160000007", "firstName": "Ariel", "lastName": "Flores", "role": "admin", "email": "ariel@acme.com"}, "customProperties": {"key": {"name": "Jira issues", "value": ["is-123", "is-456"]}, "key1": {"name": "Jira issues", "value": ["is-123", "is-456"]}, "key2": {"name": "Jira issues", "value": ["is-123", "is-456"]}}, "archived": false, "defaults": {"onVariation": 0, "offVariation": 1}}, "resource": {"kind": "flag", "flag": {"name": "My Flag", "kind": "boolean", "description": "This flag controls the example widgets", "key": "flag-key-123abc", "_version": 1, "creationDate": 673862, "variations": [{"_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05", "value": true}, {"_id": "a00bf58d-d252-476c-b915-15a74becacb4", "value": false}], "temporary": true, "tags": ["example-tag"], "_links": {"parent": {"href": "/api/v2/flags/my-project", "type": "application/json"}, "self": {"href": "/api/v2/flags/my-project/my-flag", "type": "application/json"}}, "maintainerId": "569f183514f4432160000007", "_maintainer": {"_links": {"self": {"href": "/api/v2/members/569f183514f4432160000007", "type": "application/json"}}, "_id": "569f183514f4432160000007", "firstName": "Ariel", "lastName": "Flores", "role": "admin", "email": "ariel@acme.com"}, "customProperties": {"key": {"name": "Jira issues", "value": ["is-123", "is-456"]}, "key1": {"name": "Jira issues", "value": ["is-123", "is-456"]}, "key2": {"name": "Jira issues", "value": ["is-123", "is-456"]}}, "archived": false, "defaults": {"onVariation": 0, "offVariation": 1}}, "segment": {"name": "Example segment", "description": "Bundle our sample customers together", "tags": ["testing"], "creationDate": 995805, "lastModifiedDate": 712436, "key": "segment-key-123abc", "included": ["user-key-123abc"], "excluded": ["user-key-123abc"], "_links": {"key": {}, "key1": {}}, "rules": [{"_id": "1234a56b7c89d012345e678f", "clauses": [{"_id": "12ab3c45de678910fab12345", "attribute": "email", "op": "endsWith", "values": [".edu"], "negate": false}]}], "version": 1, "deleted": false, "_access": {"denied": [{"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}], "allowed": [{"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}]}, "_flags": [{"name": "Example flag", "key": "flag-key-123abc"}, {"name": "Example flag", "key": "flag-key-123abc"}], "unbounded": false, "generation": 852643, "_external": "amplitude", "_externalLink": "https://analytics.amplitude.com/org/1234/cohort/123abc", "_importInProgress": false}, "aiConfig": {"key": "aiconfig-key-123abc", "name": "AI Config 1"}}}], "totalCount": 1, "_links": {"key": {}}} + application/json: {"items": [{"_id": "12ab3c45de678910abc12345", "_version": 1, "creationDate": 542910, "serviceKind": "", "requestorId": "12ab3c45de678910abc12345", "description": "example: request approval from someone", "reviewStatus": "pending", "allReviews": [], "notifyMemberIds": ["1234a56b7c89d012345e678f"], "appliedByMemberId": "1234a56b7c89d012345e678f", "appliedByServiceTokenId": "1234a56b7c89d012345e678f", "status": "pending", "instructions": [{"key": "", "key1": ""}, {"key": ""}], "conflicts": [{}, {}], "_links": {"key": ""}, "operatingOnId": "12ab3c45de678910abc12345", "source": {"key": "source-flag-key-123abc", "version": 1}, "customWorkflowMetadata": {"name": "Example workflow name", "stage": {"index": 0, "name": "Stage 1"}}, "approvalSettings": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "project": {"_links": {"environments": {"href": "/api/v2/projects/my-project/environments", "type": "application/json"}, "self": {"href": "/api/v2/projects/my-project", "type": "application/json"}}, "_id": "57be1db38b75bf0772d11383", "key": "project-key-123abc", "includeInSnippetByDefault": true, "name": "My Project", "_access": {"denied": [{"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}], "allowed": [{"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}]}, "tags": ["ops"], "environments": {"totalCount": 2, "items": []}}, "environments": [{"_links": {"self": {"href": "/api/v2/projects/my-project/environments/my-environment", "type": "application/json"}}, "_id": "57be1db38b75bf0772d11384", "key": "environment-key-123abc", "name": "My Environment", "apiKey": "sdk-xxx", "mobileKey": "mob-xxx", "color": "F5A623", "defaultTtl": 5, "secureMode": true, "defaultTrackEvents": false, "requireComments": true, "confirmChanges": true, "tags": ["ops"], "approvalSettings": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "resourceApprovalSettings": {"key": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "key1": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}}, "critical": true}, {"_links": {"self": {"href": "/api/v2/projects/my-project/environments/my-environment", "type": "application/json"}}, "_id": "57be1db38b75bf0772d11384", "key": "environment-key-123abc", "name": "My Environment", "apiKey": "sdk-xxx", "mobileKey": "mob-xxx", "color": "F5A623", "defaultTtl": 5, "secureMode": true, "defaultTrackEvents": false, "requireComments": true, "confirmChanges": true, "tags": ["ops"], "approvalSettings": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "resourceApprovalSettings": {"key": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "key1": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}}, "critical": true}, {"_links": {"self": {"href": "/api/v2/projects/my-project/environments/my-environment", "type": "application/json"}}, "_id": "57be1db38b75bf0772d11384", "key": "environment-key-123abc", "name": "My Environment", "apiKey": "sdk-xxx", "mobileKey": "mob-xxx", "color": "F5A623", "defaultTtl": 5, "secureMode": true, "defaultTrackEvents": false, "requireComments": true, "confirmChanges": true, "tags": ["ops"], "approvalSettings": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "resourceApprovalSettings": {"key": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}, "key1": {"required": true, "bypassApprovalsForPendingChanges": false, "minNumApprovals": 1, "canReviewOwnRequest": false, "canApplyDeclinedChanges": true, "autoApplyApprovedChanges": true, "serviceKind": "launchdarkly", "serviceConfig": {}, "requiredApprovalTags": ["require-approval"], "serviceKindConfigurationId": "1ef45a85-218f-4428-a8b2-a97e5f56c258"}}, "critical": true}], "flag": {"name": "My Flag", "kind": "boolean", "description": "This flag controls the example widgets", "key": "flag-key-123abc", "_version": 1, "creationDate": 673862, "variations": [{"_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05", "value": true}, {"_id": "a00bf58d-d252-476c-b915-15a74becacb4", "value": false}], "temporary": true, "tags": ["example-tag"], "_links": {"parent": {"href": "/api/v2/flags/my-project", "type": "application/json"}, "self": {"href": "/api/v2/flags/my-project/my-flag", "type": "application/json"}}, "maintainerId": "569f183514f4432160000007", "_maintainer": {"_links": {"self": {"href": "/api/v2/members/569f183514f4432160000007", "type": "application/json"}}, "_id": "569f183514f4432160000007", "firstName": "Ariel", "lastName": "Flores", "role": "admin", "email": "ariel@acme.com"}, "customProperties": {"key": {"name": "Jira issues", "value": ["is-123", "is-456"]}, "key1": {"name": "Jira issues", "value": ["is-123", "is-456"]}, "key2": {"name": "Jira issues", "value": ["is-123", "is-456"]}}, "archived": false, "defaults": {"onVariation": 0, "offVariation": 1}}, "resource": {"kind": "flag", "aiConfig": {"key": "aiconfig-key-123abc", "name": "AI Config 1"}, "flag": {"name": "My Flag", "kind": "boolean", "description": "This flag controls the example widgets", "key": "flag-key-123abc", "_version": 1, "creationDate": 673862, "variations": [{"_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05", "value": true}, {"_id": "a00bf58d-d252-476c-b915-15a74becacb4", "value": false}], "temporary": true, "tags": ["example-tag"], "_links": {"parent": {"href": "/api/v2/flags/my-project", "type": "application/json"}, "self": {"href": "/api/v2/flags/my-project/my-flag", "type": "application/json"}}, "maintainerId": "569f183514f4432160000007", "_maintainer": {"_links": {"self": {"href": "/api/v2/members/569f183514f4432160000007", "type": "application/json"}}, "_id": "569f183514f4432160000007", "firstName": "Ariel", "lastName": "Flores", "role": "admin", "email": "ariel@acme.com"}, "customProperties": {"key": {"name": "Jira issues", "value": ["is-123", "is-456"]}, "key1": {"name": "Jira issues", "value": ["is-123", "is-456"]}, "key2": {"name": "Jira issues", "value": ["is-123", "is-456"]}}, "archived": false, "defaults": {"onVariation": 0, "offVariation": 1}}, "segment": {"name": "Example segment", "description": "Bundle our sample customers together", "tags": ["testing"], "creationDate": 995805, "lastModifiedDate": 712436, "key": "segment-key-123abc", "included": ["user-key-123abc"], "excluded": ["user-key-123abc"], "_links": {"key": {}, "key1": {}}, "rules": [{"_id": "1234a56b7c89d012345e678f", "clauses": [{"_id": "12ab3c45de678910fab12345", "attribute": "email", "op": "endsWith", "values": [".edu"], "negate": false}]}], "version": 1, "deleted": false, "_access": {"denied": [{"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}], "allowed": [{"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}, {"action": "", "reason": {"resources": ["proj/*:env/*;qa_*:/flag/*"], "actions": ["*"], "effect": "allow"}}]}, "_flags": [{"name": "Example flag", "key": "flag-key-123abc"}, {"name": "Example flag", "key": "flag-key-123abc"}], "unbounded": false, "generation": 852643, "_external": "amplitude", "_externalLink": "https://analytics.amplitude.com/org/1234/cohort/123abc", "_importInProgress": false}}}], "totalCount": 1, "_links": {"key": {}}} "400": application/json: {"code": "invalid_request", "message": "Invalid request body"} "401": diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index a8bf79bf..55ef3ddb 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false typescript: - version: 0.6.0 + version: 0.6.1 acceptHeaderEnum: true additionalDependencies: dependencies: diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index c8f1d68e..cc0facaa 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -2,8 +2,8 @@ speakeasyVersion: 1.736.1 sources: LaunchDarkly REST API: sourceNamespace: launchdarkly-rest-api - sourceRevisionDigest: sha256:660091d01912e6441740c604153fd0de5dca3b7098818b06bdf27f928b20b4a1 - sourceBlobDigest: sha256:320f0be8ba411906a7ef897a0ae7c0e86119d186cb70850c014c6552e5c08f39 + sourceRevisionDigest: sha256:e7b2ab07f2495360eefd4e1aceec796f0994cdf05976415ea45b41f58768a5f6 + sourceBlobDigest: sha256:819877dff442cc137c37a165ca8b949a41589a26f0d4b928870fb4a40d33b925 tags: - latest - "2.0" @@ -11,10 +11,10 @@ targets: launchdarkly-mcp-server: source: LaunchDarkly REST API sourceNamespace: launchdarkly-rest-api - sourceRevisionDigest: sha256:660091d01912e6441740c604153fd0de5dca3b7098818b06bdf27f928b20b4a1 - sourceBlobDigest: sha256:320f0be8ba411906a7ef897a0ae7c0e86119d186cb70850c014c6552e5c08f39 + sourceRevisionDigest: sha256:e7b2ab07f2495360eefd4e1aceec796f0994cdf05976415ea45b41f58768a5f6 + sourceBlobDigest: sha256:819877dff442cc137c37a165ca8b949a41589a26f0d4b928870fb4a40d33b925 codeSamplesNamespace: launchdarkly-rest-api-typescript-code-samples - codeSamplesRevisionDigest: sha256:462d803ace535f1c269b2831ba1f3baf7fdac6fe7289fd8cacb33ee0d57fd3a5 + codeSamplesRevisionDigest: sha256:c4cc8b6d9f832faf39b042bab82291448f7303b8e64c217235505ede65a6d991 workflow: workflowVersion: 1.0.0 speakeasyVersion: 1.736.1 diff --git a/FUNCTIONS.md b/FUNCTIONS.md index a9298490..a22489e9 100644 --- a/FUNCTIONS.md +++ b/FUNCTIONS.md @@ -20,7 +20,7 @@ specific category of applications. ```typescript import { LaunchDarklyCore } from "@launchdarkly/mcp-server/core.js"; -import { codeReferencesListRepositories } from "@launchdarkly/mcp-server/funcs/codeReferencesListRepositories.js"; +import { approvalsList } from "@launchdarkly/mcp-server/funcs/approvalsList.js"; // Use `LaunchDarklyCore` for best tree-shaking performance. // You can create one instance of it to use across an application. @@ -29,12 +29,12 @@ const launchDarkly = new LaunchDarklyCore({ }); async function run() { - const res = await codeReferencesListRepositories(launchDarkly, {}); + const res = await approvalsList(launchDarkly, {}); if (res.ok) { const { value: result } = res; console.log(result); } else { - console.log("codeReferencesListRepositories failed:", res.error); + console.log("approvalsList failed:", res.error); } } diff --git a/README.md b/README.md index ba7eaba5..e2e0a55f 100644 --- a/README.md +++ b/README.md @@ -233,6 +233,16 @@ For supported JavaScript runtimes, please consult [RUNTIMES.md](RUNTIMES.md). * [getVariation](docs/sdks/aiconfigs/README.md#getvariation) - Get AI Config variation * [updateVariation](docs/sdks/aiconfigs/README.md#updatevariation) - Update AI Config variation +### [Approvals](docs/sdks/approvals/README.md) + +* [list](docs/sdks/approvals/README.md#list) - List approval requests +* [listForFlag](docs/sdks/approvals/README.md#listforflag) - List approval requests for a flag +* [createRequest](docs/sdks/approvals/README.md#createrequest) - Create approval request for a flag +* [getForFlag](docs/sdks/approvals/README.md#getforflag) - Get approval request for a flag +* [deleteFlagRequest](docs/sdks/approvals/README.md#deleteflagrequest) - Delete approval request for a flag +* [applyRequest](docs/sdks/approvals/README.md#applyrequest) - Apply approval request for a flag +* [reviewFlagRequest](docs/sdks/approvals/README.md#reviewflagrequest) - Review approval request for a flag + ### [CodeReferences](docs/sdks/codereferences/README.md) * [listRepositories](docs/sdks/codereferences/README.md#listrepositories) - List repositories diff --git a/USAGE.md b/USAGE.md index 261b3550..0e860d6e 100644 --- a/USAGE.md +++ b/USAGE.md @@ -7,7 +7,7 @@ const launchDarkly = new LaunchDarkly({ }); async function run() { - const result = await launchDarkly.codeReferences.listRepositories({}); + const result = await launchDarkly.approvals.list({}); console.log(result); } diff --git a/docs/models/components/aiconfigrep.md b/docs/models/components/aiconfigrep.md new file mode 100644 index 00000000..b390f586 --- /dev/null +++ b/docs/models/components/aiconfigrep.md @@ -0,0 +1,19 @@ +# AIConfigRep + +## Example Usage + +```typescript +import { AIConfigRep } from "@launchdarkly/mcp-server/models/components"; + +let value: AIConfigRep = { + key: "aiconfig-key-123abc", + name: "AI Config 1", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | +| `key` | *string* | :heavy_check_mark: | The key of the AI Config | aiconfig-key-123abc | +| `name` | *string* | :heavy_check_mark: | The name of the AI Config | AI Config 1 | \ No newline at end of file diff --git a/docs/models/components/conflict.md b/docs/models/components/conflict.md new file mode 100644 index 00000000..8eec0e59 --- /dev/null +++ b/docs/models/components/conflict.md @@ -0,0 +1,16 @@ +# Conflict + +## Example Usage + +```typescript +import { Conflict } from "@launchdarkly/mcp-server/models/components"; + +let value: Conflict = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `instruction` | Record | :heavy_minus_sign: | N/A | +| `reason` | *string* | :heavy_minus_sign: | Reason why the conflict exists | \ No newline at end of file diff --git a/docs/models/components/copiedfromenv.md b/docs/models/components/copiedfromenv.md new file mode 100644 index 00000000..99ceb811 --- /dev/null +++ b/docs/models/components/copiedfromenv.md @@ -0,0 +1,19 @@ +# CopiedFromEnv + +## Example Usage + +```typescript +import { CopiedFromEnv } from "@launchdarkly/mcp-server/models/components"; + +let value: CopiedFromEnv = { + key: "source-flag-key-123abc", + version: 1, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | +| `key` | *string* | :heavy_check_mark: | Key of feature flag copied | source-flag-key-123abc | +| `version` | *number* | :heavy_minus_sign: | Version of feature flag copied | 1 | \ No newline at end of file diff --git a/docs/models/components/createflagconfigapprovalrequestrequest.md b/docs/models/components/createflagconfigapprovalrequestrequest.md new file mode 100644 index 00000000..ebe8da6e --- /dev/null +++ b/docs/models/components/createflagconfigapprovalrequestrequest.md @@ -0,0 +1,40 @@ +# CreateFlagConfigApprovalRequestRequest + +## Example Usage + +```typescript +import { CreateFlagConfigApprovalRequestRequest } from "@launchdarkly/mcp-server/models/components"; + +let value: CreateFlagConfigApprovalRequestRequest = { + comment: "optional comment", + description: "Requesting to update targeting", + instructions: [ + { + "key": "", + }, + { + "key": "", + }, + ], + notifyMemberIds: [ + "1234a56b7c89d012345e678f", + ], + notifyTeamKeys: [ + "example-reviewer-team", + ], + operatingOnId: "6297ed79dee7dc14e1f9a80c", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `comment` | *string* | :heavy_minus_sign: | Optional comment describing the approval request | optional comment | +| `description` | *string* | :heavy_check_mark: | A brief description of the changes you're requesting | Requesting to update targeting | +| `instructions` | Record[] | :heavy_check_mark: | N/A | | +| `notifyMemberIds` | *string*[] | :heavy_minus_sign: | An array of member IDs. These members are notified to review the approval request. | [
"1234a56b7c89d012345e678f"
] | +| `notifyTeamKeys` | *string*[] | :heavy_minus_sign: | An array of team keys. The members of these teams are notified to review the approval request. | [
"example-reviewer-team"
] | +| `executionDate` | *number* | :heavy_minus_sign: | N/A | | +| `operatingOnId` | *string* | :heavy_minus_sign: | The ID of a scheduled change. Include this if your instructions include editing or deleting a scheduled change. | 6297ed79dee7dc14e1f9a80c | +| `integrationConfig` | Record | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/customworkflowmeta.md b/docs/models/components/customworkflowmeta.md new file mode 100644 index 00000000..1ae9857b --- /dev/null +++ b/docs/models/components/customworkflowmeta.md @@ -0,0 +1,22 @@ +# CustomWorkflowMeta + +## Example Usage + +```typescript +import { CustomWorkflowMeta } from "@launchdarkly/mcp-server/models/components"; + +let value: CustomWorkflowMeta = { + name: "Example workflow name", + stage: { + index: 0, + name: "Stage 1", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | The name of the workflow stage that required this approval request | Example workflow name | +| `stage` | [components.CustomWorkflowStageMeta](../../models/components/customworkflowstagemeta.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/customworkflowstagemeta.md b/docs/models/components/customworkflowstagemeta.md new file mode 100644 index 00000000..3fb63420 --- /dev/null +++ b/docs/models/components/customworkflowstagemeta.md @@ -0,0 +1,19 @@ +# CustomWorkflowStageMeta + +## Example Usage + +```typescript +import { CustomWorkflowStageMeta } from "@launchdarkly/mcp-server/models/components"; + +let value: CustomWorkflowStageMeta = { + index: 0, + name: "Stage 1", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | +| `index` | *number* | :heavy_minus_sign: | The zero-based index of the workflow stage | 0 | +| `name` | *string* | :heavy_minus_sign: | The name of the workflow stage | Stage 1 | \ No newline at end of file diff --git a/docs/models/components/environment.md b/docs/models/components/environment.md index dd2b19d2..899d86f1 100644 --- a/docs/models/components/environment.md +++ b/docs/models/components/environment.md @@ -21,8 +21,34 @@ let value: Environment = { defaultTtl: 5, secureMode: true, access: { - denied: [], - allowed: [], + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], }, defaultTrackEvents: false, requireComments: true, diff --git a/docs/models/components/expandableapprovalrequestresponse.md b/docs/models/components/expandableapprovalrequestresponse.md new file mode 100644 index 00000000..ef0e3ac2 --- /dev/null +++ b/docs/models/components/expandableapprovalrequestresponse.md @@ -0,0 +1,446 @@ +# ExpandableApprovalRequestResponse + +## Example Usage + +```typescript +import { ExpandableApprovalRequestResponse } from "@launchdarkly/mcp-server/models/components"; + +let value: ExpandableApprovalRequestResponse = { + id: "12ab3c45de678910abc12345", + version: 1, + creationDate: 946084, + serviceKind: "", + requestorId: "12ab3c45de678910abc12345", + description: "example: request approval from someone", + reviewStatus: "pending", + allReviews: [ + { + id: "12ab3c45de678910abc12345", + kind: "approve", + comment: "Approved!", + memberId: "12ab3c45de678910abc12345", + serviceTokenId: "12ab3c45de678910abc12345", + }, + ], + notifyMemberIds: [ + "1234a56b7c89d012345e678f", + ], + appliedByMemberId: "1234a56b7c89d012345e678f", + appliedByServiceTokenId: "1234a56b7c89d012345e678f", + status: "pending", + instructions: [ + { + "key": "", + "key1": "", + }, + { + "key": "", + }, + ], + conflicts: [], + links: { + "key": "", + "key1": "", + "key2": "", + }, + operatingOnId: "12ab3c45de678910abc12345", + source: { + key: "source-flag-key-123abc", + version: 1, + }, + customWorkflowMetadata: { + name: "Example workflow name", + stage: { + index: 0, + name: "Stage 1", + }, + }, + approvalSettings: { + required: true, + bypassApprovalsForPendingChanges: false, + minNumApprovals: 1, + canReviewOwnRequest: false, + canApplyDeclinedChanges: true, + autoApplyApprovedChanges: true, + serviceKind: "launchdarkly", + serviceConfig: {}, + requiredApprovalTags: [ + "require-approval", + ], + serviceKindConfigurationId: "1ef45a85-218f-4428-a8b2-a97e5f56c258", + }, + project: { + links: { + "environments": { + href: "/api/v2/projects/my-project/environments", + type: "application/json", + }, + "self": { + href: "/api/v2/projects/my-project", + type: "application/json", + }, + }, + id: "57be1db38b75bf0772d11383", + key: "project-key-123abc", + includeInSnippetByDefault: true, + name: "My Project", + access: { + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + }, + tags: [ + "ops", + ], + environments: { + totalCount: 2, + items: [], + }, + }, + environments: [ + { + links: { + "self": { + href: "/api/v2/projects/my-project/environments/my-environment", + type: "application/json", + }, + }, + id: "57be1db38b75bf0772d11384", + key: "environment-key-123abc", + name: "My Environment", + apiKey: "sdk-xxx", + mobileKey: "mob-xxx", + color: "F5A623", + defaultTtl: 5, + secureMode: true, + access: { + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + }, + defaultTrackEvents: false, + requireComments: true, + confirmChanges: true, + tags: [ + "ops", + ], + approvalSettings: { + required: true, + bypassApprovalsForPendingChanges: false, + minNumApprovals: 1, + canReviewOwnRequest: false, + canApplyDeclinedChanges: true, + autoApplyApprovedChanges: true, + serviceKind: "launchdarkly", + serviceConfig: {}, + requiredApprovalTags: [ + "require-approval", + ], + serviceKindConfigurationId: "1ef45a85-218f-4428-a8b2-a97e5f56c258", + }, + resourceApprovalSettings: { + "key": { + required: true, + bypassApprovalsForPendingChanges: false, + minNumApprovals: 1, + canReviewOwnRequest: false, + canApplyDeclinedChanges: true, + autoApplyApprovedChanges: true, + serviceKind: "launchdarkly", + serviceConfig: {}, + requiredApprovalTags: [ + "require-approval", + ], + serviceKindConfigurationId: "1ef45a85-218f-4428-a8b2-a97e5f56c258", + }, + }, + critical: true, + }, + ], + flag: { + name: "My Flag", + kind: "boolean", + description: "This flag controls the example widgets", + key: "flag-key-123abc", + version: 1, + creationDate: 482529, + variations: [ + { + id: "e432f62b-55f6-49dd-a02f-eb24acf39d05", + value: true, + }, + { + id: "a00bf58d-d252-476c-b915-15a74becacb4", + value: false, + }, + ], + temporary: true, + tags: [ + "example-tag", + ], + links: { + "parent": { + href: "/api/v2/flags/my-project", + type: "application/json", + }, + "self": { + href: "/api/v2/flags/my-project/my-flag", + type: "application/json", + }, + }, + maintainerId: "569f183514f4432160000007", + maintainer: { + links: { + "self": { + href: "/api/v2/members/569f183514f4432160000007", + type: "application/json", + }, + }, + id: "569f183514f4432160000007", + firstName: "Ariel", + lastName: "Flores", + role: "admin", + email: "ariel@acme.com", + }, + customProperties: { + "key": { + name: "Jira issues", + value: [ + "is-123", + "is-456", + ], + }, + }, + archived: false, + defaults: { + onVariation: 0, + offVariation: 1, + }, + }, + resource: { + kind: "flag", + aiConfig: { + key: "aiconfig-key-123abc", + name: "AI Config 1", + }, + flag: { + name: "My Flag", + kind: "boolean", + description: "This flag controls the example widgets", + key: "flag-key-123abc", + version: 1, + creationDate: 482529, + variations: [ + { + id: "e432f62b-55f6-49dd-a02f-eb24acf39d05", + value: true, + }, + { + id: "a00bf58d-d252-476c-b915-15a74becacb4", + value: false, + }, + ], + temporary: true, + tags: [ + "example-tag", + ], + links: { + "parent": { + href: "/api/v2/flags/my-project", + type: "application/json", + }, + "self": { + href: "/api/v2/flags/my-project/my-flag", + type: "application/json", + }, + }, + maintainerId: "569f183514f4432160000007", + maintainer: { + links: { + "self": { + href: "/api/v2/members/569f183514f4432160000007", + type: "application/json", + }, + }, + id: "569f183514f4432160000007", + firstName: "Ariel", + lastName: "Flores", + role: "admin", + email: "ariel@acme.com", + }, + customProperties: { + "key": { + name: "Jira issues", + value: [ + "is-123", + "is-456", + ], + }, + }, + archived: false, + defaults: { + onVariation: 0, + offVariation: 1, + }, + }, + segment: { + name: "Example segment", + description: "Bundle our sample customers together", + tags: [ + "testing", + ], + creationDate: 561176, + lastModifiedDate: 919054, + key: "segment-key-123abc", + included: [ + "user-key-123abc", + ], + excluded: [ + "user-key-123abc", + ], + links: {}, + rules: [ + { + id: "1234a56b7c89d012345e678f", + clauses: [ + { + id: "12ab3c45de678910fab12345", + attribute: "email", + op: "endsWith", + values: [ + ".edu", + ], + negate: false, + }, + ], + }, + ], + version: 1, + deleted: false, + access: { + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + }, + flags: [ + { + name: "Example flag", + key: "flag-key-123abc", + }, + ], + unbounded: false, + generation: 523042, + external: "amplitude", + externalLink: "https://analytics.amplitude.com/org/1234/cohort/123abc", + importInProgress: false, + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The ID of this approval request | 12ab3c45de678910abc12345 | +| `version` | *number* | :heavy_check_mark: | Version of the approval request | 1 | +| `creationDate` | *number* | :heavy_check_mark: | N/A | | +| `serviceKind` | *string* | :heavy_check_mark: | N/A | | +| `requestorId` | *string* | :heavy_minus_sign: | The ID of the member who requested the approval | 12ab3c45de678910abc12345 | +| `description` | *string* | :heavy_minus_sign: | A human-friendly name for the approval request | example: request approval from someone | +| `reviewStatus` | [components.ExpandableApprovalRequestResponseReviewStatus](../../models/components/expandableapprovalrequestresponsereviewstatus.md) | :heavy_check_mark: | Current status of the review of this approval request | pending | +| `allReviews` | [components.ReviewResponse](../../models/components/reviewresponse.md)[] | :heavy_check_mark: | An array of individual reviews of this approval request | | +| `notifyMemberIds` | *string*[] | :heavy_check_mark: | An array of member IDs. These members are notified to review the approval request. | [
"1234a56b7c89d012345e678f"
] | +| `appliedDate` | *number* | :heavy_minus_sign: | N/A | | +| `appliedByMemberId` | *string* | :heavy_minus_sign: | The member ID of the member who applied the approval request | 1234a56b7c89d012345e678f | +| `appliedByServiceTokenId` | *string* | :heavy_minus_sign: | The service token ID of the service token which applied the approval request | 1234a56b7c89d012345e678f | +| `status` | [components.ExpandableApprovalRequestResponseStatus](../../models/components/expandableapprovalrequestresponsestatus.md) | :heavy_check_mark: | Current status of the approval request | pending | +| `instructions` | Record[] | :heavy_check_mark: | N/A | | +| `conflicts` | [components.Conflict](../../models/components/conflict.md)[] | :heavy_check_mark: | Details on any conflicting approval requests | | +| `links` | Record | :heavy_check_mark: | The location and content type of related resources | | +| `executionDate` | *number* | :heavy_minus_sign: | N/A | | +| `operatingOnId` | *string* | :heavy_minus_sign: | ID of scheduled change to edit or delete | 12ab3c45de678910abc12345 | +| `integrationMetadata` | [components.IntegrationMetadata](../../models/components/integrationmetadata.md) | :heavy_minus_sign: | N/A | | +| `source` | [components.CopiedFromEnv](../../models/components/copiedfromenv.md) | :heavy_minus_sign: | N/A | | +| `customWorkflowMetadata` | [components.CustomWorkflowMeta](../../models/components/customworkflowmeta.md) | :heavy_minus_sign: | N/A | | +| `resourceId` | *string* | :heavy_minus_sign: | String representation of a resource | | +| `approvalSettings` | [components.ApprovalSettings](../../models/components/approvalsettings.md) | :heavy_minus_sign: | N/A | | +| `project` | [components.Project](../../models/components/project.md) | :heavy_minus_sign: | N/A | | +| `environments` | [components.Environment](../../models/components/environment.md)[] | :heavy_minus_sign: | List of environments the approval impacts | | +| `flag` | [components.ExpandedFlagRep](../../models/components/expandedflagrep.md) | :heavy_minus_sign: | N/A | | +| `resource` | [components.ExpandedResourceRep](../../models/components/expandedresourcerep.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/expandableapprovalrequestresponsereviewstatus.md b/docs/models/components/expandableapprovalrequestresponsereviewstatus.md new file mode 100644 index 00000000..2d0eaa70 --- /dev/null +++ b/docs/models/components/expandableapprovalrequestresponsereviewstatus.md @@ -0,0 +1,17 @@ +# ExpandableApprovalRequestResponseReviewStatus + +Current status of the review of this approval request + +## Example Usage + +```typescript +import { ExpandableApprovalRequestResponseReviewStatus } from "@launchdarkly/mcp-server/models/components"; + +let value: ExpandableApprovalRequestResponseReviewStatus = "pending"; +``` + +## Values + +```typescript +"approved" | "declined" | "pending" +``` \ No newline at end of file diff --git a/docs/models/components/expandableapprovalrequestresponsestatus.md b/docs/models/components/expandableapprovalrequestresponsestatus.md new file mode 100644 index 00000000..a8926441 --- /dev/null +++ b/docs/models/components/expandableapprovalrequestresponsestatus.md @@ -0,0 +1,17 @@ +# ExpandableApprovalRequestResponseStatus + +Current status of the approval request + +## Example Usage + +```typescript +import { ExpandableApprovalRequestResponseStatus } from "@launchdarkly/mcp-server/models/components"; + +let value: ExpandableApprovalRequestResponseStatus = "pending"; +``` + +## Values + +```typescript +"pending" | "completed" | "failed" | "scheduled" +``` \ No newline at end of file diff --git a/docs/models/components/expandableapprovalrequestsresponse.md b/docs/models/components/expandableapprovalrequestsresponse.md new file mode 100644 index 00000000..1d64152d --- /dev/null +++ b/docs/models/components/expandableapprovalrequestsresponse.md @@ -0,0 +1,418 @@ +# ExpandableApprovalRequestsResponse + +## Example Usage + +```typescript +import { ExpandableApprovalRequestsResponse } from "@launchdarkly/mcp-server/models/components"; + +let value: ExpandableApprovalRequestsResponse = { + items: [ + { + id: "12ab3c45de678910abc12345", + version: 1, + creationDate: 423631, + serviceKind: "", + requestorId: "12ab3c45de678910abc12345", + description: "example: request approval from someone", + reviewStatus: "pending", + allReviews: [ + { + id: "12ab3c45de678910abc12345", + kind: "approve", + comment: "Approved!", + memberId: "12ab3c45de678910abc12345", + serviceTokenId: "12ab3c45de678910abc12345", + }, + ], + notifyMemberIds: [ + "1234a56b7c89d012345e678f", + ], + appliedByMemberId: "1234a56b7c89d012345e678f", + appliedByServiceTokenId: "1234a56b7c89d012345e678f", + status: "pending", + instructions: [], + conflicts: [], + links: {}, + operatingOnId: "12ab3c45de678910abc12345", + source: { + key: "source-flag-key-123abc", + version: 1, + }, + customWorkflowMetadata: { + name: "Example workflow name", + stage: { + index: 0, + name: "Stage 1", + }, + }, + approvalSettings: { + required: true, + bypassApprovalsForPendingChanges: false, + minNumApprovals: 1, + canReviewOwnRequest: false, + canApplyDeclinedChanges: true, + autoApplyApprovedChanges: true, + serviceKind: "launchdarkly", + serviceConfig: {}, + requiredApprovalTags: [ + "require-approval", + ], + serviceKindConfigurationId: "1ef45a85-218f-4428-a8b2-a97e5f56c258", + }, + project: { + links: { + "environments": { + href: "/api/v2/projects/my-project/environments", + type: "application/json", + }, + "self": { + href: "/api/v2/projects/my-project", + type: "application/json", + }, + }, + id: "57be1db38b75bf0772d11383", + key: "project-key-123abc", + includeInSnippetByDefault: true, + name: "My Project", + access: { + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + }, + tags: [ + "ops", + ], + environments: { + totalCount: 2, + items: [], + }, + }, + environments: [ + { + links: { + "self": { + href: "/api/v2/projects/my-project/environments/my-environment", + type: "application/json", + }, + }, + id: "57be1db38b75bf0772d11384", + key: "environment-key-123abc", + name: "My Environment", + apiKey: "sdk-xxx", + mobileKey: "mob-xxx", + color: "F5A623", + defaultTtl: 5, + secureMode: true, + access: { + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + }, + defaultTrackEvents: false, + requireComments: true, + confirmChanges: true, + tags: [ + "ops", + ], + approvalSettings: { + required: true, + bypassApprovalsForPendingChanges: false, + minNumApprovals: 1, + canReviewOwnRequest: false, + canApplyDeclinedChanges: true, + autoApplyApprovedChanges: true, + serviceKind: "launchdarkly", + serviceConfig: {}, + requiredApprovalTags: [ + "require-approval", + ], + serviceKindConfigurationId: "1ef45a85-218f-4428-a8b2-a97e5f56c258", + }, + resourceApprovalSettings: { + "key": { + required: true, + bypassApprovalsForPendingChanges: false, + minNumApprovals: 1, + canReviewOwnRequest: false, + canApplyDeclinedChanges: true, + autoApplyApprovedChanges: true, + serviceKind: "launchdarkly", + serviceConfig: {}, + requiredApprovalTags: [ + "require-approval", + ], + serviceKindConfigurationId: + "1ef45a85-218f-4428-a8b2-a97e5f56c258", + }, + }, + critical: true, + }, + ], + flag: { + name: "My Flag", + kind: "boolean", + description: "This flag controls the example widgets", + key: "flag-key-123abc", + version: 1, + creationDate: 482529, + variations: [ + { + id: "e432f62b-55f6-49dd-a02f-eb24acf39d05", + value: true, + }, + { + id: "a00bf58d-d252-476c-b915-15a74becacb4", + value: false, + }, + ], + temporary: true, + tags: [ + "example-tag", + ], + links: { + "parent": { + href: "/api/v2/flags/my-project", + type: "application/json", + }, + "self": { + href: "/api/v2/flags/my-project/my-flag", + type: "application/json", + }, + }, + maintainerId: "569f183514f4432160000007", + maintainer: { + links: { + "self": { + href: "/api/v2/members/569f183514f4432160000007", + type: "application/json", + }, + }, + id: "569f183514f4432160000007", + firstName: "Ariel", + lastName: "Flores", + role: "admin", + email: "ariel@acme.com", + }, + customProperties: { + "key": { + name: "Jira issues", + value: [ + "is-123", + "is-456", + ], + }, + }, + archived: false, + defaults: { + onVariation: 0, + offVariation: 1, + }, + }, + resource: { + kind: "flag", + aiConfig: { + key: "aiconfig-key-123abc", + name: "AI Config 1", + }, + flag: { + name: "My Flag", + kind: "boolean", + description: "This flag controls the example widgets", + key: "flag-key-123abc", + version: 1, + creationDate: 482529, + variations: [ + { + id: "e432f62b-55f6-49dd-a02f-eb24acf39d05", + value: true, + }, + { + id: "a00bf58d-d252-476c-b915-15a74becacb4", + value: false, + }, + ], + temporary: true, + tags: [ + "example-tag", + ], + links: { + "parent": { + href: "/api/v2/flags/my-project", + type: "application/json", + }, + "self": { + href: "/api/v2/flags/my-project/my-flag", + type: "application/json", + }, + }, + maintainerId: "569f183514f4432160000007", + maintainer: { + links: { + "self": { + href: "/api/v2/members/569f183514f4432160000007", + type: "application/json", + }, + }, + id: "569f183514f4432160000007", + firstName: "Ariel", + lastName: "Flores", + role: "admin", + email: "ariel@acme.com", + }, + customProperties: { + "key": { + name: "Jira issues", + value: [ + "is-123", + "is-456", + ], + }, + }, + archived: false, + defaults: { + onVariation: 0, + offVariation: 1, + }, + }, + segment: { + name: "Example segment", + description: "Bundle our sample customers together", + tags: [ + "testing", + ], + creationDate: 561176, + lastModifiedDate: 919054, + key: "segment-key-123abc", + included: [ + "user-key-123abc", + ], + excluded: [ + "user-key-123abc", + ], + links: {}, + rules: [ + { + id: "1234a56b7c89d012345e678f", + clauses: [ + { + id: "12ab3c45de678910fab12345", + attribute: "email", + op: "endsWith", + values: [ + ".edu", + ], + negate: false, + }, + ], + }, + ], + version: 1, + deleted: false, + access: { + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + }, + flags: [ + { + name: "Example flag", + key: "flag-key-123abc", + }, + ], + unbounded: false, + generation: 523042, + external: "amplitude", + externalLink: + "https://analytics.amplitude.com/org/1234/cohort/123abc", + importInProgress: false, + }, + }, + }, + ], + totalCount: 1, + links: {}, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `items` | [components.ExpandableApprovalRequestResponse](../../models/components/expandableapprovalrequestresponse.md)[] | :heavy_check_mark: | An array of approval requests | | +| `totalCount` | *number* | :heavy_check_mark: | Total number of approval requests | 1 | +| `links` | Record | :heavy_check_mark: | The location and content type of related resources | | \ No newline at end of file diff --git a/docs/models/components/expandedflagrep.md b/docs/models/components/expandedflagrep.md new file mode 100644 index 00000000..4f97ce31 --- /dev/null +++ b/docs/models/components/expandedflagrep.md @@ -0,0 +1,83 @@ +# ExpandedFlagRep + +## Example Usage + +```typescript +import { ExpandedFlagRep } from "@launchdarkly/mcp-server/models/components"; + +let value: ExpandedFlagRep = { + name: "My Flag", + kind: "boolean", + description: "This flag controls the example widgets", + key: "flag-key-123abc", + version: 1, + creationDate: 92216, + variations: [ + { + id: "e432f62b-55f6-49dd-a02f-eb24acf39d05", + value: true, + }, + { + id: "a00bf58d-d252-476c-b915-15a74becacb4", + value: false, + }, + ], + temporary: true, + tags: [ + "example-tag", + ], + links: { + "parent": { + href: "/api/v2/flags/my-project", + type: "application/json", + }, + "self": { + href: "/api/v2/flags/my-project/my-flag", + type: "application/json", + }, + }, + maintainerId: "569f183514f4432160000007", + maintainer: { + links: { + "self": { + href: "/api/v2/members/569f183514f4432160000007", + type: "application/json", + }, + }, + id: "569f183514f4432160000007", + firstName: "Ariel", + lastName: "Flores", + role: "admin", + email: "ariel@acme.com", + }, + customProperties: {}, + archived: false, + defaults: { + onVariation: 0, + offVariation: 1, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | A human-friendly name for the feature flag | My Flag | +| `kind` | [components.ExpandedFlagRepKind](../../models/components/expandedflagrepkind.md) | :heavy_check_mark: | Kind of feature flag | boolean | +| `description` | *string* | :heavy_minus_sign: | Description of the feature flag | This flag controls the example widgets | +| `key` | *string* | :heavy_check_mark: | A unique key used to reference the flag in your code | flag-key-123abc | +| `version` | *number* | :heavy_check_mark: | Version of the feature flag | 1 | +| `creationDate` | *number* | :heavy_check_mark: | N/A | | +| ~~`includeInSnippet`~~ | *boolean* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Deprecated, use clientSideAvailability. Whether this flag should be made available to the client-side JavaScript SDK | true | +| `clientSideAvailability` | [components.ClientSideAvailability](../../models/components/clientsideavailability.md) | :heavy_minus_sign: | N/A | | +| `variations` | [components.Variation](../../models/components/variation.md)[] | :heavy_check_mark: | An array of possible variations for the flag | [
{
"_id": "e432f62b-55f6-49dd-a02f-eb24acf39d05",
"value": true
},
{
"_id": "a00bf58d-d252-476c-b915-15a74becacb4",
"value": false
}
] | +| `temporary` | *boolean* | :heavy_check_mark: | Whether the flag is a temporary flag | true | +| `tags` | *string*[] | :heavy_check_mark: | Tags for the feature flag | [
"example-tag"
] | +| `links` | Record | :heavy_check_mark: | The location and content type of related resources | {
"parent": {
"href": "/api/v2/flags/my-project",
"type": "application/json"
},
"self": {
"href": "/api/v2/flags/my-project/my-flag",
"type": "application/json"
}
} | +| `maintainerId` | *string* | :heavy_minus_sign: | The ID of the member who maintains the flag | 569f183514f4432160000007 | +| `maintainer` | [components.MemberSummary](../../models/components/membersummary.md) | :heavy_minus_sign: | N/A | | +| `customProperties` | Record | :heavy_check_mark: | N/A | | +| `archived` | *boolean* | :heavy_check_mark: | Boolean indicating if the feature flag is archived | false | +| `archivedDate` | *number* | :heavy_minus_sign: | N/A | | +| `defaults` | [components.Defaults](../../models/components/defaults.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/expandedflagrepkind.md b/docs/models/components/expandedflagrepkind.md new file mode 100644 index 00000000..2460b1b1 --- /dev/null +++ b/docs/models/components/expandedflagrepkind.md @@ -0,0 +1,17 @@ +# ExpandedFlagRepKind + +Kind of feature flag + +## Example Usage + +```typescript +import { ExpandedFlagRepKind } from "@launchdarkly/mcp-server/models/components"; + +let value: ExpandedFlagRepKind = "boolean"; +``` + +## Values + +```typescript +"boolean" | "multivariate" +``` \ No newline at end of file diff --git a/docs/models/components/expandedresourcerep.md b/docs/models/components/expandedresourcerep.md new file mode 100644 index 00000000..5e92a20f --- /dev/null +++ b/docs/models/components/expandedresourcerep.md @@ -0,0 +1,160 @@ +# ExpandedResourceRep + +## Example Usage + +```typescript +import { ExpandedResourceRep } from "@launchdarkly/mcp-server/models/components"; + +let value: ExpandedResourceRep = { + kind: "flag", + aiConfig: { + key: "aiconfig-key-123abc", + name: "AI Config 1", + }, + flag: { + name: "My Flag", + kind: "boolean", + description: "This flag controls the example widgets", + key: "flag-key-123abc", + version: 1, + creationDate: 482529, + variations: [ + { + id: "e432f62b-55f6-49dd-a02f-eb24acf39d05", + value: true, + }, + { + id: "a00bf58d-d252-476c-b915-15a74becacb4", + value: false, + }, + ], + temporary: true, + tags: [ + "example-tag", + ], + links: { + "parent": { + href: "/api/v2/flags/my-project", + type: "application/json", + }, + "self": { + href: "/api/v2/flags/my-project/my-flag", + type: "application/json", + }, + }, + maintainerId: "569f183514f4432160000007", + maintainer: { + links: { + "self": { + href: "/api/v2/members/569f183514f4432160000007", + type: "application/json", + }, + }, + id: "569f183514f4432160000007", + firstName: "Ariel", + lastName: "Flores", + role: "admin", + email: "ariel@acme.com", + }, + customProperties: { + "key": { + name: "Jira issues", + value: [ + "is-123", + "is-456", + ], + }, + }, + archived: false, + defaults: { + onVariation: 0, + offVariation: 1, + }, + }, + segment: { + name: "Example segment", + description: "Bundle our sample customers together", + tags: [ + "testing", + ], + creationDate: 561176, + lastModifiedDate: 919054, + key: "segment-key-123abc", + included: [ + "user-key-123abc", + ], + excluded: [ + "user-key-123abc", + ], + links: {}, + rules: [ + { + id: "1234a56b7c89d012345e678f", + clauses: [ + { + id: "12ab3c45de678910fab12345", + attribute: "email", + op: "endsWith", + values: [ + ".edu", + ], + negate: false, + }, + ], + }, + ], + version: 1, + deleted: false, + access: { + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + }, + flags: [ + { + name: "Example flag", + key: "flag-key-123abc", + }, + ], + unbounded: false, + generation: 523042, + external: "amplitude", + externalLink: "https://analytics.amplitude.com/org/1234/cohort/123abc", + importInProgress: false, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `kind` | *string* | :heavy_check_mark: | The type of resource | flag | +| `aiConfig` | [components.AIConfigRep](../../models/components/aiconfigrep.md) | :heavy_minus_sign: | N/A | | +| `flag` | [components.ExpandedFlagRep](../../models/components/expandedflagrep.md) | :heavy_minus_sign: | N/A | | +| `segment` | [components.UserSegment](../../models/components/usersegment.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/experimentinforep.md b/docs/models/components/experimentinforep.md index 8823f27f..0957e6c1 100644 --- a/docs/models/components/experimentinforep.md +++ b/docs/models/components/experimentinforep.md @@ -33,8 +33,34 @@ let value: ExperimentInfoRep = { }, }, access: { - denied: [], - allowed: [], + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], }, tags: [], creationDate: 522106, diff --git a/docs/models/components/featureflagconfig.md b/docs/models/components/featureflagconfig.md index 667e59e6..58a66218 100644 --- a/docs/models/components/featureflagconfig.md +++ b/docs/models/components/featureflagconfig.md @@ -14,8 +14,34 @@ let value: FeatureFlagConfig = { version: 880588, site: {}, access: { - denied: [], - allowed: [], + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], }, environmentName: "", trackEvents: true, diff --git a/docs/models/components/flagconfigapprovalrequestresponse.md b/docs/models/components/flagconfigapprovalrequestresponse.md new file mode 100644 index 00000000..c334b310 --- /dev/null +++ b/docs/models/components/flagconfigapprovalrequestresponse.md @@ -0,0 +1,73 @@ +# FlagConfigApprovalRequestResponse + +## Example Usage + +```typescript +import { FlagConfigApprovalRequestResponse } from "@launchdarkly/mcp-server/models/components"; + +let value: FlagConfigApprovalRequestResponse = { + id: "12ab3c45de678910abc12345", + version: 1, + creationDate: 93478, + serviceKind: "", + requestorId: "12ab3c45de678910abc12345", + description: "example: request approval from someone", + reviewStatus: "pending", + allReviews: [], + notifyMemberIds: [ + "1234a56b7c89d012345e678f", + ], + appliedByMemberId: "1234a56b7c89d012345e678f", + appliedByServiceTokenId: "1234a56b7c89d012345e678f", + status: "pending", + instructions: [ + {}, + { + "key": "", + "key1": "", + }, + ], + conflicts: [ + {}, + ], + links: {}, + operatingOnId: "12ab3c45de678910abc12345", + source: { + key: "source-flag-key-123abc", + version: 1, + }, + customWorkflowMetadata: { + name: "Example workflow name", + stage: { + index: 0, + name: "Stage 1", + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The ID of this approval request | 12ab3c45de678910abc12345 | +| `version` | *number* | :heavy_check_mark: | Version of the approval request | 1 | +| `creationDate` | *number* | :heavy_check_mark: | N/A | | +| `serviceKind` | *string* | :heavy_check_mark: | N/A | | +| `requestorId` | *string* | :heavy_minus_sign: | The ID of the member who requested the approval | 12ab3c45de678910abc12345 | +| `description` | *string* | :heavy_minus_sign: | A human-friendly name for the approval request | example: request approval from someone | +| `reviewStatus` | [components.FlagConfigApprovalRequestResponseReviewStatus](../../models/components/flagconfigapprovalrequestresponsereviewstatus.md) | :heavy_check_mark: | Current status of the review of this approval request | pending | +| `allReviews` | [components.ReviewResponse](../../models/components/reviewresponse.md)[] | :heavy_check_mark: | An array of individual reviews of this approval request | | +| `notifyMemberIds` | *string*[] | :heavy_check_mark: | An array of member IDs. These members are notified to review the approval request. | [
"1234a56b7c89d012345e678f"
] | +| `appliedDate` | *number* | :heavy_minus_sign: | N/A | | +| `appliedByMemberId` | *string* | :heavy_minus_sign: | The member ID of the member who applied the approval request | 1234a56b7c89d012345e678f | +| `appliedByServiceTokenId` | *string* | :heavy_minus_sign: | The service token ID of the service token which applied the approval request | 1234a56b7c89d012345e678f | +| `status` | [components.FlagConfigApprovalRequestResponseStatus](../../models/components/flagconfigapprovalrequestresponsestatus.md) | :heavy_check_mark: | Current status of the approval request | pending | +| `instructions` | Record[] | :heavy_check_mark: | N/A | | +| `conflicts` | [components.Conflict](../../models/components/conflict.md)[] | :heavy_check_mark: | Details on any conflicting approval requests | | +| `links` | Record | :heavy_check_mark: | The location and content type of related resources | | +| `executionDate` | *number* | :heavy_minus_sign: | N/A | | +| `operatingOnId` | *string* | :heavy_minus_sign: | ID of scheduled change to edit or delete | 12ab3c45de678910abc12345 | +| `integrationMetadata` | [components.IntegrationMetadata](../../models/components/integrationmetadata.md) | :heavy_minus_sign: | N/A | | +| `source` | [components.CopiedFromEnv](../../models/components/copiedfromenv.md) | :heavy_minus_sign: | N/A | | +| `customWorkflowMetadata` | [components.CustomWorkflowMeta](../../models/components/customworkflowmeta.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/flagconfigapprovalrequestresponsereviewstatus.md b/docs/models/components/flagconfigapprovalrequestresponsereviewstatus.md new file mode 100644 index 00000000..f3687338 --- /dev/null +++ b/docs/models/components/flagconfigapprovalrequestresponsereviewstatus.md @@ -0,0 +1,17 @@ +# FlagConfigApprovalRequestResponseReviewStatus + +Current status of the review of this approval request + +## Example Usage + +```typescript +import { FlagConfigApprovalRequestResponseReviewStatus } from "@launchdarkly/mcp-server/models/components"; + +let value: FlagConfigApprovalRequestResponseReviewStatus = "pending"; +``` + +## Values + +```typescript +"approved" | "declined" | "pending" +``` \ No newline at end of file diff --git a/docs/models/components/flagconfigapprovalrequestresponsestatus.md b/docs/models/components/flagconfigapprovalrequestresponsestatus.md new file mode 100644 index 00000000..98f4bce7 --- /dev/null +++ b/docs/models/components/flagconfigapprovalrequestresponsestatus.md @@ -0,0 +1,17 @@ +# FlagConfigApprovalRequestResponseStatus + +Current status of the approval request + +## Example Usage + +```typescript +import { FlagConfigApprovalRequestResponseStatus } from "@launchdarkly/mcp-server/models/components"; + +let value: FlagConfigApprovalRequestResponseStatus = "pending"; +``` + +## Values + +```typescript +"pending" | "completed" | "failed" | "scheduled" +``` \ No newline at end of file diff --git a/docs/models/components/flagconfigapprovalrequestsresponse.md b/docs/models/components/flagconfigapprovalrequestsresponse.md new file mode 100644 index 00000000..53924b4b --- /dev/null +++ b/docs/models/components/flagconfigapprovalrequestsresponse.md @@ -0,0 +1,66 @@ +# FlagConfigApprovalRequestsResponse + +## Example Usage + +```typescript +import { FlagConfigApprovalRequestsResponse } from "@launchdarkly/mcp-server/models/components"; + +let value: FlagConfigApprovalRequestsResponse = { + items: [ + { + id: "12ab3c45de678910abc12345", + version: 1, + creationDate: 711910, + serviceKind: "", + requestorId: "12ab3c45de678910abc12345", + description: "example: request approval from someone", + reviewStatus: "pending", + allReviews: [ + { + id: "12ab3c45de678910abc12345", + kind: "approve", + comment: "Approved!", + memberId: "12ab3c45de678910abc12345", + serviceTokenId: "12ab3c45de678910abc12345", + }, + ], + notifyMemberIds: [ + "1234a56b7c89d012345e678f", + ], + appliedByMemberId: "1234a56b7c89d012345e678f", + appliedByServiceTokenId: "1234a56b7c89d012345e678f", + status: "pending", + instructions: [ + { + "key": "", + "key1": "", + }, + ], + conflicts: [], + links: { + "key": "", + }, + operatingOnId: "12ab3c45de678910abc12345", + source: { + key: "source-flag-key-123abc", + version: 1, + }, + customWorkflowMetadata: { + name: "Example workflow name", + stage: { + index: 0, + name: "Stage 1", + }, + }, + }, + ], + links: {}, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | +| `items` | [components.FlagConfigApprovalRequestResponse](../../models/components/flagconfigapprovalrequestresponse.md)[] | :heavy_check_mark: | An array of approval requests | +| `links` | Record | :heavy_check_mark: | The location and content type of related resources | \ No newline at end of file diff --git a/docs/models/components/flaglistingrep.md b/docs/models/components/flaglistingrep.md new file mode 100644 index 00000000..f33fe450 --- /dev/null +++ b/docs/models/components/flaglistingrep.md @@ -0,0 +1,21 @@ +# FlagListingRep + +## Example Usage + +```typescript +import { FlagListingRep } from "@launchdarkly/mcp-server/models/components"; + +let value: FlagListingRep = { + name: "Example flag", + key: "flag-key-123abc", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------------------------------ | +| `name` | *string* | :heavy_check_mark: | The flag name | Example flag | +| `key` | *string* | :heavy_check_mark: | The flag key | flag-key-123abc | +| `links` | Record | :heavy_minus_sign: | N/A | | +| `site` | [components.Link](../../models/components/link.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/integrationmetadata.md b/docs/models/components/integrationmetadata.md new file mode 100644 index 00000000..845970ee --- /dev/null +++ b/docs/models/components/integrationmetadata.md @@ -0,0 +1,26 @@ +# IntegrationMetadata + +## Example Usage + +```typescript +import { IntegrationMetadata } from "@launchdarkly/mcp-server/models/components"; + +let value: IntegrationMetadata = { + externalId: "", + externalStatus: { + display: "", + value: "", + }, + externalUrl: "https://insecure-reasoning.net", + lastChecked: 854557, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | +| `externalId` | *string* | :heavy_check_mark: | N/A | +| `externalStatus` | [components.IntegrationStatus](../../models/components/integrationstatus.md) | :heavy_check_mark: | N/A | +| `externalUrl` | *string* | :heavy_check_mark: | N/A | +| `lastChecked` | *number* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/integrationstatus.md b/docs/models/components/integrationstatus.md new file mode 100644 index 00000000..40106664 --- /dev/null +++ b/docs/models/components/integrationstatus.md @@ -0,0 +1,19 @@ +# IntegrationStatus + +## Example Usage + +```typescript +import { IntegrationStatus } from "@launchdarkly/mcp-server/models/components"; + +let value: IntegrationStatus = { + display: "", + value: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `display` | *string* | :heavy_check_mark: | N/A | +| `value` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/components/legacyexperimentrep.md b/docs/models/components/legacyexperimentrep.md index 89e8610f..0d5ea511 100644 --- a/docs/models/components/legacyexperimentrep.md +++ b/docs/models/components/legacyexperimentrep.md @@ -30,8 +30,34 @@ let value: LegacyExperimentRep = { }, }, access: { - denied: [], - allowed: [], + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], }, tags: [], creationDate: 522106, diff --git a/docs/models/components/metriclistingrep.md b/docs/models/components/metriclistingrep.md index ecd5131f..46e09656 100644 --- a/docs/models/components/metriclistingrep.md +++ b/docs/models/components/metriclistingrep.md @@ -28,8 +28,34 @@ let value: MetricListingRep = { }, }, access: { - denied: [], - allowed: [], + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], }, tags: [], creationDate: 68842, diff --git a/docs/models/components/postapprovalrequestapplyrequest.md b/docs/models/components/postapprovalrequestapplyrequest.md new file mode 100644 index 00000000..4675fc8f --- /dev/null +++ b/docs/models/components/postapprovalrequestapplyrequest.md @@ -0,0 +1,17 @@ +# PostApprovalRequestApplyRequest + +## Example Usage + +```typescript +import { PostApprovalRequestApplyRequest } from "@launchdarkly/mcp-server/models/components"; + +let value: PostApprovalRequestApplyRequest = { + comment: "Looks good, thanks for updating", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | +| `comment` | *string* | :heavy_minus_sign: | Optional comment about the approval request | Looks good, thanks for updating | \ No newline at end of file diff --git a/docs/models/components/postapprovalrequestreviewrequest.md b/docs/models/components/postapprovalrequestreviewrequest.md new file mode 100644 index 00000000..9f8250fb --- /dev/null +++ b/docs/models/components/postapprovalrequestreviewrequest.md @@ -0,0 +1,19 @@ +# PostApprovalRequestReviewRequest + +## Example Usage + +```typescript +import { PostApprovalRequestReviewRequest } from "@launchdarkly/mcp-server/models/components"; + +let value: PostApprovalRequestReviewRequest = { + kind: "approve", + comment: "Looks good, thanks for updating", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | +| `kind` | [components.PostApprovalRequestReviewRequestKind](../../models/components/postapprovalrequestreviewrequestkind.md) | :heavy_minus_sign: | The type of review for this approval request | approve | +| `comment` | *string* | :heavy_minus_sign: | Optional comment about the approval request | Looks good, thanks for updating | \ No newline at end of file diff --git a/docs/models/components/postapprovalrequestreviewrequestkind.md b/docs/models/components/postapprovalrequestreviewrequestkind.md new file mode 100644 index 00000000..204063b5 --- /dev/null +++ b/docs/models/components/postapprovalrequestreviewrequestkind.md @@ -0,0 +1,17 @@ +# PostApprovalRequestReviewRequestKind + +The type of review for this approval request + +## Example Usage + +```typescript +import { PostApprovalRequestReviewRequestKind } from "@launchdarkly/mcp-server/models/components"; + +let value: PostApprovalRequestReviewRequestKind = "approve"; +``` + +## Values + +```typescript +"approve" | "comment" | "decline" +``` \ No newline at end of file diff --git a/docs/models/components/project.md b/docs/models/components/project.md new file mode 100644 index 00000000..c5e02780 --- /dev/null +++ b/docs/models/components/project.md @@ -0,0 +1,76 @@ +# Project + +## Example Usage + +```typescript +import { Project } from "@launchdarkly/mcp-server/models/components"; + +let value: Project = { + links: { + "environments": { + href: "/api/v2/projects/my-project/environments", + type: "application/json", + }, + "self": { + href: "/api/v2/projects/my-project", + type: "application/json", + }, + }, + id: "57be1db38b75bf0772d11383", + key: "project-key-123abc", + includeInSnippetByDefault: true, + name: "My Project", + access: { + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + }, + tags: [ + "ops", + ], + environments: { + totalCount: 2, + items: [], + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `links` | Record | :heavy_check_mark: | The location and content type of related resources | {
"environments": {
"href": "/api/v2/projects/my-project/environments",
"type": "application/json"
},
"self": {
"href": "/api/v2/projects/my-project",
"type": "application/json"
}
} | +| `id` | *string* | :heavy_check_mark: | The ID of this project | 57be1db38b75bf0772d11383 | +| `key` | *string* | :heavy_check_mark: | The key of this project | project-key-123abc | +| `includeInSnippetByDefault` | *boolean* | :heavy_check_mark: | Whether or not flags created in this project are made available to the client-side JavaScript SDK by default | true | +| `defaultClientSideAvailability` | [components.ClientSideAvailability](../../models/components/clientsideavailability.md) | :heavy_minus_sign: | N/A | | +| `name` | *string* | :heavy_check_mark: | A human-friendly name for the project | My Project | +| `access` | [components.Access](../../models/components/access.md) | :heavy_minus_sign: | N/A | | +| `tags` | *string*[] | :heavy_check_mark: | A list of tags for the project | [
"ops"
] | +| `defaultReleasePipelineKey` | *string* | :heavy_minus_sign: | The key of the default release pipeline for this project | | +| `environments` | [components.Environments](../../models/components/environments.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/docs/models/components/repositorycollectionrep.md b/docs/models/components/repositorycollectionrep.md index 80315327..74b47465 100644 --- a/docs/models/components/repositorycollectionrep.md +++ b/docs/models/components/repositorycollectionrep.md @@ -42,8 +42,34 @@ let value: RepositoryCollectionRep = { "key1": "", }, access: { - denied: [], - allowed: [], + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], }, }, ], diff --git a/docs/models/components/repositoryrep.md b/docs/models/components/repositoryrep.md index 5236c83b..c080fcb4 100644 --- a/docs/models/components/repositoryrep.md +++ b/docs/models/components/repositoryrep.md @@ -40,8 +40,34 @@ let value: RepositoryRep = { "key2": "", }, access: { - denied: [], - allowed: [], + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], }, }; ``` diff --git a/docs/models/components/reviewresponse.md b/docs/models/components/reviewresponse.md new file mode 100644 index 00000000..93d74df3 --- /dev/null +++ b/docs/models/components/reviewresponse.md @@ -0,0 +1,26 @@ +# ReviewResponse + +## Example Usage + +```typescript +import { ReviewResponse } from "@launchdarkly/mcp-server/models/components"; + +let value: ReviewResponse = { + id: "12ab3c45de678910abc12345", + kind: "approve", + comment: "Approved!", + memberId: "12ab3c45de678910abc12345", + serviceTokenId: "12ab3c45de678910abc12345", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The approval request ID | 12ab3c45de678910abc12345 | +| `kind` | [components.ReviewResponseKind](../../models/components/reviewresponsekind.md) | :heavy_check_mark: | The type of review action to take | approve | +| `creationDate` | *number* | :heavy_minus_sign: | N/A | | +| `comment` | *string* | :heavy_minus_sign: | A comment describing the approval response | Approved! | +| `memberId` | *string* | :heavy_minus_sign: | ID of account member that reviewed request | 12ab3c45de678910abc12345 | +| `serviceTokenId` | *string* | :heavy_minus_sign: | ID of account service token that reviewed request | 12ab3c45de678910abc12345 | \ No newline at end of file diff --git a/docs/models/components/reviewresponsekind.md b/docs/models/components/reviewresponsekind.md new file mode 100644 index 00000000..a39b7cc8 --- /dev/null +++ b/docs/models/components/reviewresponsekind.md @@ -0,0 +1,17 @@ +# ReviewResponseKind + +The type of review action to take + +## Example Usage + +```typescript +import { ReviewResponseKind } from "@launchdarkly/mcp-server/models/components"; + +let value: ReviewResponseKind = "approve"; +``` + +## Values + +```typescript +"approve" | "decline" | "comment" +``` \ No newline at end of file diff --git a/docs/models/components/segmentmetadata.md b/docs/models/components/segmentmetadata.md new file mode 100644 index 00000000..71d11e3d --- /dev/null +++ b/docs/models/components/segmentmetadata.md @@ -0,0 +1,21 @@ +# SegmentMetadata + +## Example Usage + +```typescript +import { SegmentMetadata } from "@launchdarkly/mcp-server/models/components"; + +let value: SegmentMetadata = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `envId` | *string* | :heavy_minus_sign: | N/A | +| `segmentId` | *string* | :heavy_minus_sign: | N/A | +| `version` | *number* | :heavy_minus_sign: | N/A | +| `includedCount` | *number* | :heavy_minus_sign: | N/A | +| `excludedCount` | *number* | :heavy_minus_sign: | N/A | +| `lastModified` | *number* | :heavy_minus_sign: | N/A | +| `deleted` | *boolean* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/segmenttarget.md b/docs/models/components/segmenttarget.md new file mode 100644 index 00000000..a57cc5fb --- /dev/null +++ b/docs/models/components/segmenttarget.md @@ -0,0 +1,16 @@ +# SegmentTarget + +## Example Usage + +```typescript +import { SegmentTarget } from "@launchdarkly/mcp-server/models/components"; + +let value: SegmentTarget = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `values` | *string*[] | :heavy_minus_sign: | N/A | +| `contextKind` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/usersegment.md b/docs/models/components/usersegment.md new file mode 100644 index 00000000..367f725c --- /dev/null +++ b/docs/models/components/usersegment.md @@ -0,0 +1,112 @@ +# UserSegment + +## Example Usage + +```typescript +import { UserSegment } from "@launchdarkly/mcp-server/models/components"; + +let value: UserSegment = { + name: "Example segment", + description: "Bundle our sample customers together", + tags: [ + "testing", + ], + creationDate: 640026, + lastModifiedDate: 789555, + key: "segment-key-123abc", + included: [ + "user-key-123abc", + ], + excluded: [ + "user-key-123abc", + ], + links: {}, + rules: [ + { + id: "1234a56b7c89d012345e678f", + clauses: [ + { + id: "12ab3c45de678910fab12345", + attribute: "email", + op: "endsWith", + values: [ + ".edu", + ], + negate: false, + }, + ], + }, + ], + version: 1, + deleted: false, + access: { + denied: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + allowed: [ + { + action: "", + reason: { + resources: [ + "proj/*:env/*;qa_*:/flag/*", + ], + actions: [ + "*", + ], + effect: "allow", + }, + }, + ], + }, + flags: [ + { + name: "Example flag", + key: "flag-key-123abc", + }, + ], + unbounded: false, + generation: 619739, + external: "amplitude", + externalLink: "https://analytics.amplitude.com/org/1234/cohort/123abc", + importInProgress: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `name` | *string* | :heavy_check_mark: | A human-friendly name for the segment. | Example segment | +| `description` | *string* | :heavy_minus_sign: | A description of the segment's purpose. Defaults to null and is omitted in the response if not provided. | Bundle our sample customers together | +| `tags` | *string*[] | :heavy_check_mark: | Tags for the segment. Defaults to an empty array. | [
"testing"
] | +| `creationDate` | *number* | :heavy_check_mark: | N/A | | +| `lastModifiedDate` | *number* | :heavy_check_mark: | N/A | | +| `key` | *string* | :heavy_check_mark: | A unique key used to reference the segment | segment-key-123abc | +| `included` | *string*[] | :heavy_minus_sign: | An array of keys for included targets. Included individual targets are always segment members, regardless of segment rules. For list-based segments over 15,000 entries, also called big segments, this array is either empty or omitted. | [
"user-key-123abc"
] | +| `excluded` | *string*[] | :heavy_minus_sign: | An array of keys for excluded targets. Segment rules bypass individual excluded targets, so they will never be included based on rules. Excluded targets may still be included explicitly. This value is omitted for list-based segments over 15,000 entries, also called big segments. | [
"user-key-123abc"
] | +| `includedContexts` | [components.SegmentTarget](../../models/components/segmenttarget.md)[] | :heavy_minus_sign: | N/A | | +| `excludedContexts` | [components.SegmentTarget](../../models/components/segmenttarget.md)[] | :heavy_minus_sign: | N/A | | +| `links` | Record | :heavy_check_mark: | The location and content type of related resources | | +| `rules` | [components.UserSegmentRule](../../models/components/usersegmentrule.md)[] | :heavy_check_mark: | An array of the targeting rules for this segment. | [
{
"_id": "1234a56b7c89d012345e678f",
"clauses": [
{
"_id": "12ab3c45de678910fab12345",
"attribute": "email",
"negate": false,
"op": "endsWith",
"values": [
".edu"
]
}
]
}
] | +| `version` | *number* | :heavy_check_mark: | Version of the segment | 1 | +| `deleted` | *boolean* | :heavy_check_mark: | Whether the segment has been deleted | false | +| `access` | [components.Access](../../models/components/access.md) | :heavy_minus_sign: | N/A | | +| `flags` | [components.FlagListingRep](../../models/components/flaglistingrep.md)[] | :heavy_minus_sign: | A list of flags targeting this segment. Only included when getting a single segment, using the getSegment endpoint. | | +| `unbounded` | *boolean* | :heavy_minus_sign: | Whether this is a standard segment (false) or a big segment (true). Standard segments include rule-based segments and smaller list-based segments. Big segments include larger list-based segments and synced segments. If omitted, the segment is a standard segment. | false | +| `unboundedContextKind` | *string* | :heavy_minus_sign: | For big segments, the targeted context kind. | | +| `generation` | *number* | :heavy_check_mark: | For big segments, how many times this segment has been created. | | +| `unboundedMetadata` | [components.SegmentMetadata](../../models/components/segmentmetadata.md) | :heavy_minus_sign: | N/A | | +| `external` | *string* | :heavy_minus_sign: | The external data store backing this segment. Only applies to synced segments. | amplitude | +| `externalLink` | *string* | :heavy_minus_sign: | The URL for the external data store backing this segment. Only applies to synced segments. | https://analytics.amplitude.com/org/1234/cohort/123abc | +| `importInProgress` | *boolean* | :heavy_minus_sign: | Whether an import is currently in progress for the specified segment. Only applies to big segments. | false | \ No newline at end of file diff --git a/docs/models/components/usersegmentrule.md b/docs/models/components/usersegmentrule.md new file mode 100644 index 00000000..b8301feb --- /dev/null +++ b/docs/models/components/usersegmentrule.md @@ -0,0 +1,22 @@ +# UserSegmentRule + +## Example Usage + +```typescript +import { UserSegmentRule } from "@launchdarkly/mcp-server/models/components"; + +let value: UserSegmentRule = { + clauses: [], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | N/A | +| `clauses` | [components.Clause](../../models/components/clause.md)[] | :heavy_check_mark: | N/A | +| `weight` | *number* | :heavy_minus_sign: | N/A | +| `rolloutContextKind` | *string* | :heavy_minus_sign: | N/A | +| `bucketBy` | *string* | :heavy_minus_sign: | N/A | +| `description` | *string* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/deleteapprovalrequestforflagrequest.md b/docs/models/operations/deleteapprovalrequestforflagrequest.md new file mode 100644 index 00000000..dc63787e --- /dev/null +++ b/docs/models/operations/deleteapprovalrequestforflagrequest.md @@ -0,0 +1,23 @@ +# DeleteApprovalRequestForFlagRequest + +## Example Usage + +```typescript +import { DeleteApprovalRequestForFlagRequest } from "@launchdarkly/mcp-server/models/operations"; + +let value: DeleteApprovalRequestForFlagRequest = { + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `projectKey` | *string* | :heavy_check_mark: | The project key | +| `featureFlagKey` | *string* | :heavy_check_mark: | The feature flag key | +| `environmentKey` | *string* | :heavy_check_mark: | The environment key | +| `id` | *string* | :heavy_check_mark: | The feature flag approval request ID | \ No newline at end of file diff --git a/docs/models/operations/getapprovalforflagrequest.md b/docs/models/operations/getapprovalforflagrequest.md new file mode 100644 index 00000000..e60bcc14 --- /dev/null +++ b/docs/models/operations/getapprovalforflagrequest.md @@ -0,0 +1,23 @@ +# GetApprovalForFlagRequest + +## Example Usage + +```typescript +import { GetApprovalForFlagRequest } from "@launchdarkly/mcp-server/models/operations"; + +let value: GetApprovalForFlagRequest = { + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `projectKey` | *string* | :heavy_check_mark: | The project key | +| `featureFlagKey` | *string* | :heavy_check_mark: | The feature flag key | +| `environmentKey` | *string* | :heavy_check_mark: | The environment key | +| `id` | *string* | :heavy_check_mark: | The feature flag approval request ID | \ No newline at end of file diff --git a/docs/models/operations/getapprovalrequestsrequest.md b/docs/models/operations/getapprovalrequestsrequest.md new file mode 100644 index 00000000..cb049c02 --- /dev/null +++ b/docs/models/operations/getapprovalrequestsrequest.md @@ -0,0 +1,18 @@ +# GetApprovalRequestsRequest + +## Example Usage + +```typescript +import { GetApprovalRequestsRequest } from "@launchdarkly/mcp-server/models/operations"; + +let value: GetApprovalRequestsRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `filter` | *string* | :heavy_minus_sign: | A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above. | +| `expand` | *string* | :heavy_minus_sign: | A comma-separated list of fields to expand in the response. Supported fields are explained above. | +| `limit` | *number* | :heavy_minus_sign: | The number of approvals to return. Defaults to 20. Maximum limit is 200. | +| `offset` | *number* | :heavy_minus_sign: | Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. | \ No newline at end of file diff --git a/docs/models/operations/getapprovalsforflagrequest.md b/docs/models/operations/getapprovalsforflagrequest.md new file mode 100644 index 00000000..28de9a45 --- /dev/null +++ b/docs/models/operations/getapprovalsforflagrequest.md @@ -0,0 +1,21 @@ +# GetApprovalsForFlagRequest + +## Example Usage + +```typescript +import { GetApprovalsForFlagRequest } from "@launchdarkly/mcp-server/models/operations"; + +let value: GetApprovalsForFlagRequest = { + projectKey: "", + featureFlagKey: "", + environmentKey: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------- | -------------------- | -------------------- | -------------------- | +| `projectKey` | *string* | :heavy_check_mark: | The project key | +| `featureFlagKey` | *string* | :heavy_check_mark: | The feature flag key | +| `environmentKey` | *string* | :heavy_check_mark: | The environment key | \ No newline at end of file diff --git a/docs/models/operations/postapprovalrequestapplyforflagrequest.md b/docs/models/operations/postapprovalrequestapplyforflagrequest.md new file mode 100644 index 00000000..2424937f --- /dev/null +++ b/docs/models/operations/postapprovalrequestapplyforflagrequest.md @@ -0,0 +1,27 @@ +# PostApprovalRequestApplyForFlagRequest + +## Example Usage + +```typescript +import { PostApprovalRequestApplyForFlagRequest } from "@launchdarkly/mcp-server/models/operations"; + +let value: PostApprovalRequestApplyForFlagRequest = { + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", + postApprovalRequestApplyRequest: { + comment: "Looks good, thanks for updating", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | +| `projectKey` | *string* | :heavy_check_mark: | The project key | +| `featureFlagKey` | *string* | :heavy_check_mark: | The feature flag key | +| `environmentKey` | *string* | :heavy_check_mark: | The environment key | +| `id` | *string* | :heavy_check_mark: | The feature flag approval request ID | +| `postApprovalRequestApplyRequest` | [components.PostApprovalRequestApplyRequest](../../models/components/postapprovalrequestapplyrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/postapprovalrequestforflagrequest.md b/docs/models/operations/postapprovalrequestforflagrequest.md new file mode 100644 index 00000000..8ede1b92 --- /dev/null +++ b/docs/models/operations/postapprovalrequestforflagrequest.md @@ -0,0 +1,38 @@ +# PostApprovalRequestForFlagRequest + +## Example Usage + +```typescript +import { PostApprovalRequestForFlagRequest } from "@launchdarkly/mcp-server/models/operations"; + +let value: PostApprovalRequestForFlagRequest = { + projectKey: "", + featureFlagKey: "", + environmentKey: "", + createFlagConfigApprovalRequestRequest: { + comment: "optional comment", + description: "Requesting to update targeting", + instructions: [ + { + "key": "", + }, + ], + notifyMemberIds: [ + "1234a56b7c89d012345e678f", + ], + notifyTeamKeys: [ + "example-reviewer-team", + ], + operatingOnId: "6297ed79dee7dc14e1f9a80c", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | +| `projectKey` | *string* | :heavy_check_mark: | The project key | +| `featureFlagKey` | *string* | :heavy_check_mark: | The feature flag key | +| `environmentKey` | *string* | :heavy_check_mark: | The environment key | +| `createFlagConfigApprovalRequestRequest` | [components.CreateFlagConfigApprovalRequestRequest](../../models/components/createflagconfigapprovalrequestrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/postapprovalrequestreviewforflagrequest.md b/docs/models/operations/postapprovalrequestreviewforflagrequest.md new file mode 100644 index 00000000..c764f5eb --- /dev/null +++ b/docs/models/operations/postapprovalrequestreviewforflagrequest.md @@ -0,0 +1,28 @@ +# PostApprovalRequestReviewForFlagRequest + +## Example Usage + +```typescript +import { PostApprovalRequestReviewForFlagRequest } from "@launchdarkly/mcp-server/models/operations"; + +let value: PostApprovalRequestReviewForFlagRequest = { + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", + postApprovalRequestReviewRequest: { + kind: "approve", + comment: "Looks good, thanks for updating", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | +| `projectKey` | *string* | :heavy_check_mark: | The project key | +| `featureFlagKey` | *string* | :heavy_check_mark: | The feature flag key | +| `environmentKey` | *string* | :heavy_check_mark: | The environment key | +| `id` | *string* | :heavy_check_mark: | The feature flag approval request ID | +| `postApprovalRequestReviewRequest` | [components.PostApprovalRequestReviewRequest](../../models/components/postapprovalrequestreviewrequest.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/approvals/README.md b/docs/sdks/approvals/README.md new file mode 100644 index 00000000..1e002300 --- /dev/null +++ b/docs/sdks/approvals/README.md @@ -0,0 +1,665 @@ +# Approvals + +## Overview + +An account member can request approval on changes to a flag or AI Config's targeting or variations, or to a segment's targeting. Members may be required to request approval depending on the settings in their LaunchDarkly project. Members can optionally request an approval even if it is not required. + +An approval request prevents a change from being applied without approval from another member. Select up to ten members as reviewers. Reviewers receive an email notification, but anyone with sufficient permissions can review a pending approval request. A change needs at least one approval before you can apply it. To learn more, read [Approvals](https://launchdarkly.com/docs/home/releases/approvals). + +Changes that conflict will fail if approved and applied, and the flag or segment will not be updated. + +Several of the endpoints in the approvals API require an approval request ID. The approval request ID is returned as part of the [Create approval request](https://launchdarkly.com/docs/api/approvals/post-approval-request) and [List approval requests for a flag](https://launchdarkly.com/docs/api/approvals/get-approvals-for-flag) responses. It is the `_id` field, or the `_id` field of each element in the `items` array. If you created the approval request as part of a [workflow](https://launchdarkly.com/docs/api/workflows), you can also use a workflow ID as the approval request ID. The workflow ID is returned as part of the [Create workflow](https://launchdarkly.com/docs/api/workflows/post-workflow) and [Get workflows](https://launchdarkly.com/docs/api/workflows/get-workflows) responses. It is the `_id` field, or the `_id` field of each element in the `items` array. + + +### Available Operations + +* [list](#list) - List approval requests +* [listForFlag](#listforflag) - List approval requests for a flag +* [createRequest](#createrequest) - Create approval request for a flag +* [getForFlag](#getforflag) - Get approval request for a flag +* [deleteFlagRequest](#deleteflagrequest) - Delete approval request for a flag +* [applyRequest](#applyrequest) - Apply approval request for a flag +* [reviewFlagRequest](#reviewflagrequest) - Review approval request for a flag + +## list + +Get all approval requests. + +### Filtering approvals + +LaunchDarkly supports the `filter` query param for filtering, with the following fields: + +- `notifyMemberIds` filters for only approvals that are assigned to a member in the specified list. For example: `filter=notifyMemberIds anyOf ["memberId1", "memberId2"]`. +- `requestorId` filters for only approvals that correspond to the ID of the member who requested the approval. For example: `filter=requestorId equals 457034721476302714390214`. +- `resourceId` filters for only approvals that correspond to the the specified resource identifier. For example: `filter=resourceId equals proj/my-project:env/my-environment:flag/my-flag`. +- `resourceKind` filters for only approvals that correspond to the specified resource kind. For example: `filter=resourceKind equals flag`. Currently, `flag`, `segment`, and `aiConfig` resource kinds are supported. +- `reviewStatus` filters for only approvals which correspond to the review status in the specified list. The possible values are `approved`, `declined`, and `pending`. For example: `filter=reviewStatus anyOf ["pending", "approved"]`. +- `status` filters for only approvals which correspond to the status in the specified list. The possible values are `pending`, `scheduled`, `failed`, and `completed`. For example: `filter=status anyOf ["pending", "scheduled"]`. + +You can also apply multiple filters at once. For example, setting `filter=projectKey equals my-project, reviewStatus anyOf ["pending","approved"]` matches approval requests which correspond to the `my-project` project key, and a review status of either `pending` or `approved`. + +### Expanding approval response + +LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: + +- `flag` includes the flag the approval request belongs to +- `project` includes the project the approval request belongs to +- `environments` includes the environments the approval request relates to + +For example, `expand=project,flag` includes the `project` and `flag` fields in the response. + + +### Example Usage + + +```typescript +import { LaunchDarkly } from "@launchdarkly/mcp-server"; + +const launchDarkly = new LaunchDarkly({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const result = await launchDarkly.approvals.list({}); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LaunchDarklyCore } from "@launchdarkly/mcp-server/core.js"; +import { approvalsList } from "@launchdarkly/mcp-server/funcs/approvalsList.js"; + +// Use `LaunchDarklyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const launchDarkly = new LaunchDarklyCore({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const res = await approvalsList(launchDarkly, {}); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("approvalsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetApprovalRequestsRequest](../../models/operations/getapprovalrequestsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.ExpandableApprovalRequestsResponse](../../models/components/expandableapprovalrequestsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------- | ----------------------------- | ----------------------------- | +| errors.InvalidRequestErrorRep | 400 | application/json | +| errors.UnauthorizedErrorRep | 401 | application/json | +| errors.ForbiddenErrorRep | 403 | application/json | +| errors.RateLimitedErrorRep | 429 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## listForFlag + +Get all approval requests for a feature flag. + +### Example Usage + + +```typescript +import { LaunchDarkly } from "@launchdarkly/mcp-server"; + +const launchDarkly = new LaunchDarkly({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const result = await launchDarkly.approvals.listForFlag({ + projectKey: "", + featureFlagKey: "", + environmentKey: "", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LaunchDarklyCore } from "@launchdarkly/mcp-server/core.js"; +import { approvalsListForFlag } from "@launchdarkly/mcp-server/funcs/approvalsListForFlag.js"; + +// Use `LaunchDarklyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const launchDarkly = new LaunchDarklyCore({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const res = await approvalsListForFlag(launchDarkly, { + projectKey: "", + featureFlagKey: "", + environmentKey: "", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("approvalsListForFlag failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetApprovalsForFlagRequest](../../models/operations/getapprovalsforflagrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.FlagConfigApprovalRequestsResponse](../../models/components/flagconfigapprovalrequestsresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------- | --------------------------- | --------------------------- | +| errors.UnauthorizedErrorRep | 401 | application/json | +| errors.ForbiddenErrorRep | 403 | application/json | +| errors.NotFoundErrorRep | 404 | application/json | +| errors.RateLimitedErrorRep | 429 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## createRequest + +Create an approval request for a feature flag. + +### Example Usage + + +```typescript +import { LaunchDarkly } from "@launchdarkly/mcp-server"; + +const launchDarkly = new LaunchDarkly({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const result = await launchDarkly.approvals.createRequest({ + projectKey: "", + featureFlagKey: "", + environmentKey: "", + createFlagConfigApprovalRequestRequest: { + comment: "optional comment", + description: "Requesting to update targeting", + instructions: [ + { + "key": "", + "key1": "", + "key2": "", + }, + ], + notifyMemberIds: [ + "1234a56b7c89d012345e678f", + ], + notifyTeamKeys: [ + "example-reviewer-team", + ], + operatingOnId: "6297ed79dee7dc14e1f9a80c", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LaunchDarklyCore } from "@launchdarkly/mcp-server/core.js"; +import { approvalsCreateRequest } from "@launchdarkly/mcp-server/funcs/approvalsCreateRequest.js"; + +// Use `LaunchDarklyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const launchDarkly = new LaunchDarklyCore({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const res = await approvalsCreateRequest(launchDarkly, { + projectKey: "", + featureFlagKey: "", + environmentKey: "", + createFlagConfigApprovalRequestRequest: { + comment: "optional comment", + description: "Requesting to update targeting", + instructions: [ + { + "key": "", + "key1": "", + "key2": "", + }, + ], + notifyMemberIds: [ + "1234a56b7c89d012345e678f", + ], + notifyTeamKeys: [ + "example-reviewer-team", + ], + operatingOnId: "6297ed79dee7dc14e1f9a80c", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("approvalsCreateRequest failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.PostApprovalRequestForFlagRequest](../../models/operations/postapprovalrequestforflagrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.FlagConfigApprovalRequestResponse](../../models/components/flagconfigapprovalrequestresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------- | ----------------------------- | ----------------------------- | +| errors.InvalidRequestErrorRep | 400 | application/json | +| errors.UnauthorizedErrorRep | 401 | application/json | +| errors.ForbiddenErrorRep | 403 | application/json | +| errors.RateLimitedErrorRep | 429 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## getForFlag + +Get a single approval request for a feature flag. + +### Example Usage + + +```typescript +import { LaunchDarkly } from "@launchdarkly/mcp-server"; + +const launchDarkly = new LaunchDarkly({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const result = await launchDarkly.approvals.getForFlag({ + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LaunchDarklyCore } from "@launchdarkly/mcp-server/core.js"; +import { approvalsGetForFlag } from "@launchdarkly/mcp-server/funcs/approvalsGetForFlag.js"; + +// Use `LaunchDarklyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const launchDarkly = new LaunchDarklyCore({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const res = await approvalsGetForFlag(launchDarkly, { + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("approvalsGetForFlag failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetApprovalForFlagRequest](../../models/operations/getapprovalforflagrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.FlagConfigApprovalRequestResponse](../../models/components/flagconfigapprovalrequestresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------- | --------------------------- | --------------------------- | +| errors.UnauthorizedErrorRep | 401 | application/json | +| errors.ForbiddenErrorRep | 403 | application/json | +| errors.NotFoundErrorRep | 404 | application/json | +| errors.RateLimitedErrorRep | 429 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## deleteFlagRequest + +Delete an approval request for a feature flag. + +### Example Usage + + +```typescript +import { LaunchDarkly } from "@launchdarkly/mcp-server"; + +const launchDarkly = new LaunchDarkly({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + await launchDarkly.approvals.deleteFlagRequest({ + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LaunchDarklyCore } from "@launchdarkly/mcp-server/core.js"; +import { approvalsDeleteFlagRequest } from "@launchdarkly/mcp-server/funcs/approvalsDeleteFlagRequest.js"; + +// Use `LaunchDarklyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const launchDarkly = new LaunchDarklyCore({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const res = await approvalsDeleteFlagRequest(launchDarkly, { + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("approvalsDeleteFlagRequest failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteApprovalRequestForFlagRequest](../../models/operations/deleteapprovalrequestforflagrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------- | --------------------------- | --------------------------- | +| errors.UnauthorizedErrorRep | 401 | application/json | +| errors.ForbiddenErrorRep | 403 | application/json | +| errors.NotFoundErrorRep | 404 | application/json | +| errors.RateLimitedErrorRep | 429 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## applyRequest + +Apply an approval request that has been approved. This endpoint requires a feature flag key, and can only be used for applying approval requests on flags. + +### Example Usage + + +```typescript +import { LaunchDarkly } from "@launchdarkly/mcp-server"; + +const launchDarkly = new LaunchDarkly({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const result = await launchDarkly.approvals.applyRequest({ + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", + postApprovalRequestApplyRequest: { + comment: "Looks good, thanks for updating", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LaunchDarklyCore } from "@launchdarkly/mcp-server/core.js"; +import { approvalsApplyRequest } from "@launchdarkly/mcp-server/funcs/approvalsApplyRequest.js"; + +// Use `LaunchDarklyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const launchDarkly = new LaunchDarklyCore({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const res = await approvalsApplyRequest(launchDarkly, { + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", + postApprovalRequestApplyRequest: { + comment: "Looks good, thanks for updating", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("approvalsApplyRequest failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.PostApprovalRequestApplyForFlagRequest](../../models/operations/postapprovalrequestapplyforflagrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.FlagConfigApprovalRequestResponse](../../models/components/flagconfigapprovalrequestresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------- | ----------------------------- | ----------------------------- | +| errors.InvalidRequestErrorRep | 400 | application/json | +| errors.UnauthorizedErrorRep | 401 | application/json | +| errors.ForbiddenErrorRep | 403 | application/json | +| errors.NotFoundErrorRep | 404 | application/json | +| errors.RateLimitedErrorRep | 429 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | + +## reviewFlagRequest + +Review an approval request by approving or denying changes. + +### Example Usage + + +```typescript +import { LaunchDarkly } from "@launchdarkly/mcp-server"; + +const launchDarkly = new LaunchDarkly({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const result = await launchDarkly.approvals.reviewFlagRequest({ + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", + postApprovalRequestReviewRequest: { + kind: "approve", + comment: "Looks good, thanks for updating", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { LaunchDarklyCore } from "@launchdarkly/mcp-server/core.js"; +import { approvalsReviewFlagRequest } from "@launchdarkly/mcp-server/funcs/approvalsReviewFlagRequest.js"; + +// Use `LaunchDarklyCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const launchDarkly = new LaunchDarklyCore({ + apiKey: process.env["LAUNCHDARKLY_API_KEY"] ?? "", +}); + +async function run() { + const res = await approvalsReviewFlagRequest(launchDarkly, { + projectKey: "", + featureFlagKey: "", + environmentKey: "", + id: "", + postApprovalRequestReviewRequest: { + kind: "approve", + comment: "Looks good, thanks for updating", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("approvalsReviewFlagRequest failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.PostApprovalRequestReviewForFlagRequest](../../models/operations/postapprovalrequestreviewforflagrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.FlagConfigApprovalRequestResponse](../../models/components/flagconfigapprovalrequestresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------------- | ----------------------------- | ----------------------------- | +| errors.InvalidRequestErrorRep | 400 | application/json | +| errors.UnauthorizedErrorRep | 401 | application/json | +| errors.ForbiddenErrorRep | 403 | application/json | +| errors.NotFoundErrorRep | 404 | application/json | +| errors.RateLimitedErrorRep | 429 | application/json | +| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/examples/codeReferencesListRepositories.example.ts b/examples/approvalsList.example.ts similarity index 76% rename from examples/codeReferencesListRepositories.example.ts rename to examples/approvalsList.example.ts index b8dd9cda..8b9011a7 100644 --- a/examples/codeReferencesListRepositories.example.ts +++ b/examples/approvalsList.example.ts @@ -8,7 +8,7 @@ dotenv.config(); * Example usage of the @launchdarkly/mcp-server SDK * * To run this example from the examples directory: - * npm run build && npx tsx codeReferencesListRepositories.example.ts + * npm run build && npx tsx approvalsList.example.ts */ import { LaunchDarkly } from "@launchdarkly/mcp-server"; @@ -18,7 +18,7 @@ const launchDarkly = new LaunchDarkly({ }); async function main() { - const result = await launchDarkly.codeReferences.listRepositories({}); + const result = await launchDarkly.approvals.list({}); console.log(result); } diff --git a/examples/package-lock.json b/examples/package-lock.json index 11044565..f671171e 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "@launchdarkly/mcp-server", - "version": "0.6.0", + "version": "0.6.1", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.26.0", diff --git a/jsr.json b/jsr.json index 26ca5f13..2bbfb1ca 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@launchdarkly/mcp-server", - "version": "0.6.0", + "version": "0.6.1", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 114669f4..dc14e48a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@launchdarkly/mcp-server", - "version": "0.6.0", + "version": "0.6.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@launchdarkly/mcp-server", - "version": "0.6.0", + "version": "0.6.1", "license": "MIT", "dependencies": { "@modelcontextprotocol/sdk": "^1.26.0", diff --git a/package.json b/package.json index e4b50d14..3c1c18fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@launchdarkly/mcp-server", - "version": "0.6.0", + "version": "0.6.1", "author": "LaunchDarkly", "keywords": [ "feature-flags", diff --git a/schemas/mcp-enable-tools.yaml b/schemas/mcp-enable-tools.yaml index c2bcf934..fca7c7cd 100644 --- a/schemas/mcp-enable-tools.yaml +++ b/schemas/mcp-enable-tools.yaml @@ -196,6 +196,85 @@ actions: disabled: false scopes: - write + - target: $["paths"]["/api/v2/approval-requests"]["get"] + update: + x-speakeasy-mcp: + name: list-approval-requests + description: > + Lists all pending approval requests across the account. Enables AI agents + to discover outstanding change requests that need review, providing visibility + into the approval pipeline before making flag modifications. + disabled: false + scopes: + - read + - target: $["paths"]["/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests"]["get"] + update: + x-speakeasy-mcp: + name: list-flag-approval-requests + description: > + Lists all approval requests for a specific feature flag in a given + environment. Useful for agents to check if there are pending changes awaiting + review before attempting direct modifications. + disabled: false + scopes: + - read + - target: $["paths"]["/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests"]["post"] + update: + x-speakeasy-mcp: + name: create-flag-approval-request + description: > + Creates an approval request for changes to a feature flag's targeting + or variations in a specific environment. Required when the environment has + mandatory approvals enabled, allowing agents to submit changes for review + instead of applying them directly. + disabled: false + scopes: + - write + - target: $["paths"]["/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}"]["get"] + update: + x-speakeasy-mcp: + name: get-flag-approval-request + description: > + Retrieves details of a specific approval request for a feature flag, + including its current status, reviewers, and the proposed changes. Allows + agents to inspect pending changes before deciding to review or apply them. + disabled: false + scopes: + - read + - target: $["paths"]["/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}"]["delete"] + update: + x-speakeasy-mcp: + name: delete-flag-approval-request + description: > + Deletes an approval request for a feature flag. Used by agents to + withdraw a pending change request that is no longer needed or was created + in error. + disabled: false + scopes: + - write + - target: $["paths"]["/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/apply"]["post"] + update: + x-speakeasy-mcp: + name: apply-flag-approval-request + description: > + Applies an approved approval request, executing the proposed changes + to the feature flag. Can only be used after the request has received the + required number of approvals. Completes the approval workflow by making + the changes live. + disabled: false + scopes: + - write + - target: $["paths"]["/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/reviews"]["post"] + update: + x-speakeasy-mcp: + name: review-flag-approval-request + description: > + Submits a review (approve, decline, or comment) on a pending approval + request for a feature flag. Enables agents to participate in the approval + workflow by providing feedback or granting approval for proposed changes. + disabled: false + scopes: + - write - target: $.paths.*[?@['x-speakeasy-mcp'].disabled != false] update: x-speakeasy-ignore: true diff --git a/schemas/output.json b/schemas/output.json index 2c647467..edfbf1cd 100644 --- a/schemas/output.json +++ b/schemas/output.json @@ -1605,7 +1605,14 @@ } ], "operationId": "getApprovalRequests", - "x-speakeasy-ignore": true, + "x-speakeasy-mcp": { + "name": "list-approval-requests", + "description": "Lists all pending approval requests across the account. Enables AI agents to discover outstanding change requests that need review, providing visibility into the approval pipeline before making flag modifications.\n", + "disabled": false, + "scopes": [ + "read" + ] + }, "x-speakeasy-name-override": "list" }, "post": { @@ -16552,7 +16559,14 @@ } ], "operationId": "getApprovalsForFlag", - "x-speakeasy-ignore": true, + "x-speakeasy-mcp": { + "name": "list-flag-approval-requests", + "description": "Lists all approval requests for a specific feature flag in a given environment. Useful for agents to check if there are pending changes awaiting review before attempting direct modifications.\n", + "disabled": false, + "scopes": [ + "read" + ] + }, "x-speakeasy-name-override": "listForFlag" }, "post": { @@ -16659,7 +16673,14 @@ "required": true }, "operationId": "postApprovalRequestForFlag", - "x-speakeasy-ignore": true, + "x-speakeasy-mcp": { + "name": "create-flag-approval-request", + "description": "Creates an approval request for changes to a feature flag's targeting or variations in a specific environment. Required when the environment has mandatory approvals enabled, allowing agents to submit changes for review instead of applying them directly.\n", + "disabled": false, + "scopes": [ + "write" + ] + }, "x-speakeasy-name-override": "createRequest" } }, @@ -16888,7 +16909,14 @@ } ], "operationId": "getApprovalForFlag", - "x-speakeasy-ignore": true, + "x-speakeasy-mcp": { + "name": "get-flag-approval-request", + "description": "Retrieves details of a specific approval request for a feature flag, including its current status, reviewers, and the proposed changes. Allows agents to inspect pending changes before deciding to review or apply them.\n", + "disabled": false, + "scopes": [ + "read" + ] + }, "x-speakeasy-name-override": "getForFlag" }, "patch": { @@ -17097,7 +17125,14 @@ } ], "operationId": "deleteApprovalRequestForFlag", - "x-speakeasy-ignore": true, + "x-speakeasy-mcp": { + "name": "delete-flag-approval-request", + "description": "Deletes an approval request for a feature flag. Used by agents to withdraw a pending change request that is no longer needed or was created in error.\n", + "disabled": false, + "scopes": [ + "write" + ] + }, "x-speakeasy-name-override": "deleteFlagRequest" } }, @@ -17227,7 +17262,14 @@ "required": true }, "operationId": "postApprovalRequestApplyForFlag", - "x-speakeasy-ignore": true, + "x-speakeasy-mcp": { + "name": "apply-flag-approval-request", + "description": "Applies an approved approval request, executing the proposed changes to the feature flag. Can only be used after the request has received the required number of approvals. Completes the approval workflow by making the changes live.\n", + "disabled": false, + "scopes": [ + "write" + ] + }, "x-speakeasy-name-override": "applyRequest" } }, @@ -17357,7 +17399,14 @@ "required": true }, "operationId": "postApprovalRequestReviewForFlag", - "x-speakeasy-ignore": true, + "x-speakeasy-mcp": { + "name": "review-flag-approval-request", + "description": "Submits a review (approve, decline, or comment) on a pending approval request for a feature flag. Enables agents to participate in the approval workflow by providing feedback or granting approval for proposed changes.\n", + "disabled": false, + "scopes": [ + "write" + ] + }, "x-speakeasy-name-override": "reviewFlagRequest" } }, diff --git a/src/funcs/approvalsApplyRequest.ts b/src/funcs/approvalsApplyRequest.ts new file mode 100644 index 00000000..96ffe069 --- /dev/null +++ b/src/funcs/approvalsApplyRequest.ts @@ -0,0 +1,212 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { LaunchDarklyCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { LaunchDarklyError } from "../models/errors/launchdarklyerror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Apply approval request for a flag + * + * @remarks + * Apply an approval request that has been approved. This endpoint requires a feature flag key, and can only be used for applying approval requests on flags. + */ +export function approvalsApplyRequest( + client: LaunchDarklyCore, + request: operations.PostApprovalRequestApplyForFlagRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.FlagConfigApprovalRequestResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: LaunchDarklyCore, + request: operations.PostApprovalRequestApplyForFlagRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.FlagConfigApprovalRequestResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.PostApprovalRequestApplyForFlagRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.postApprovalRequestApplyRequest, { + explode: true, + }); + + const pathParams = { + environmentKey: encodeSimple("environmentKey", payload.environmentKey, { + explode: false, + charEncoding: "percent", + }), + featureFlagKey: encodeSimple("featureFlagKey", payload.featureFlagKey, { + explode: false, + charEncoding: "percent", + }), + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + projectKey: encodeSimple("projectKey", payload.projectKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/apply", + )(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "postApprovalRequestApplyForFlag", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.FlagConfigApprovalRequestResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.FlagConfigApprovalRequestResponse$inboundSchema), + M.jsonErr(400, errors.InvalidRequestErrorRep$inboundSchema), + M.jsonErr(401, errors.UnauthorizedErrorRep$inboundSchema), + M.jsonErr(403, errors.ForbiddenErrorRep$inboundSchema), + M.jsonErr(404, errors.NotFoundErrorRep$inboundSchema), + M.jsonErr(429, errors.RateLimitedErrorRep$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/approvalsCreateRequest.ts b/src/funcs/approvalsCreateRequest.ts new file mode 100644 index 00000000..2439d842 --- /dev/null +++ b/src/funcs/approvalsCreateRequest.ts @@ -0,0 +1,204 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { LaunchDarklyCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { LaunchDarklyError } from "../models/errors/launchdarklyerror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Create approval request for a flag + * + * @remarks + * Create an approval request for a feature flag. + */ +export function approvalsCreateRequest( + client: LaunchDarklyCore, + request: operations.PostApprovalRequestForFlagRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.FlagConfigApprovalRequestResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: LaunchDarklyCore, + request: operations.PostApprovalRequestForFlagRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.FlagConfigApprovalRequestResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.PostApprovalRequestForFlagRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON( + "body", + payload.createFlagConfigApprovalRequestRequest, + { explode: true }, + ); + + const pathParams = { + environmentKey: encodeSimple("environmentKey", payload.environmentKey, { + explode: false, + charEncoding: "percent", + }), + featureFlagKey: encodeSimple("featureFlagKey", payload.featureFlagKey, { + explode: false, + charEncoding: "percent", + }), + projectKey: encodeSimple("projectKey", payload.projectKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests", + )(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "postApprovalRequestForFlag", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "403", "429", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.FlagConfigApprovalRequestResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(201, components.FlagConfigApprovalRequestResponse$inboundSchema), + M.jsonErr(400, errors.InvalidRequestErrorRep$inboundSchema), + M.jsonErr(401, errors.UnauthorizedErrorRep$inboundSchema), + M.jsonErr(403, errors.ForbiddenErrorRep$inboundSchema), + M.jsonErr(429, errors.RateLimitedErrorRep$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/approvalsDeleteFlagRequest.ts b/src/funcs/approvalsDeleteFlagRequest.ts new file mode 100644 index 00000000..40f8526b --- /dev/null +++ b/src/funcs/approvalsDeleteFlagRequest.ts @@ -0,0 +1,205 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { LaunchDarklyCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { LaunchDarklyError } from "../models/errors/launchdarklyerror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Delete approval request for a flag + * + * @remarks + * Delete an approval request for a feature flag. + */ +export function approvalsDeleteFlagRequest( + client: LaunchDarklyCore, + request: operations.DeleteApprovalRequestForFlagRequest, + options?: RequestOptions, +): APIPromise< + Result< + void, + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: LaunchDarklyCore, + request: operations.DeleteApprovalRequestForFlagRequest, + options?: RequestOptions, +): Promise< + [ + Result< + void, + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.DeleteApprovalRequestForFlagRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + environmentKey: encodeSimple("environmentKey", payload.environmentKey, { + explode: false, + charEncoding: "percent", + }), + featureFlagKey: encodeSimple("featureFlagKey", payload.featureFlagKey, { + explode: false, + charEncoding: "percent", + }), + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + projectKey: encodeSimple("projectKey", payload.projectKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "deleteApprovalRequestForFlag", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "DELETE", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["401", "403", "404", "429", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + void, + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.nil(204, z.void()), + M.jsonErr(401, errors.UnauthorizedErrorRep$inboundSchema), + M.jsonErr(403, errors.ForbiddenErrorRep$inboundSchema), + M.jsonErr(404, errors.NotFoundErrorRep$inboundSchema), + M.jsonErr(429, errors.RateLimitedErrorRep$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/approvalsGetForFlag.ts b/src/funcs/approvalsGetForFlag.ts new file mode 100644 index 00000000..ab81f7ec --- /dev/null +++ b/src/funcs/approvalsGetForFlag.ts @@ -0,0 +1,202 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { LaunchDarklyCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { LaunchDarklyError } from "../models/errors/launchdarklyerror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get approval request for a flag + * + * @remarks + * Get a single approval request for a feature flag. + */ +export function approvalsGetForFlag( + client: LaunchDarklyCore, + request: operations.GetApprovalForFlagRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.FlagConfigApprovalRequestResponse, + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: LaunchDarklyCore, + request: operations.GetApprovalForFlagRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.FlagConfigApprovalRequestResponse, + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.GetApprovalForFlagRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + environmentKey: encodeSimple("environmentKey", payload.environmentKey, { + explode: false, + charEncoding: "percent", + }), + featureFlagKey: encodeSimple("featureFlagKey", payload.featureFlagKey, { + explode: false, + charEncoding: "percent", + }), + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + projectKey: encodeSimple("projectKey", payload.projectKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getApprovalForFlag", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["401", "403", "404", "429", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.FlagConfigApprovalRequestResponse, + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.FlagConfigApprovalRequestResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedErrorRep$inboundSchema), + M.jsonErr(403, errors.ForbiddenErrorRep$inboundSchema), + M.jsonErr(404, errors.NotFoundErrorRep$inboundSchema), + M.jsonErr(429, errors.RateLimitedErrorRep$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/approvalsList.ts b/src/funcs/approvalsList.ts new file mode 100644 index 00000000..aa81ccce --- /dev/null +++ b/src/funcs/approvalsList.ts @@ -0,0 +1,213 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { LaunchDarklyCore } from "../core.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { LaunchDarklyError } from "../models/errors/launchdarklyerror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * List approval requests + * + * @remarks + * Get all approval requests. + * + * ### Filtering approvals + * + * LaunchDarkly supports the `filter` query param for filtering, with the following fields: + * + * - `notifyMemberIds` filters for only approvals that are assigned to a member in the specified list. For example: `filter=notifyMemberIds anyOf ["memberId1", "memberId2"]`. + * - `requestorId` filters for only approvals that correspond to the ID of the member who requested the approval. For example: `filter=requestorId equals 457034721476302714390214`. + * - `resourceId` filters for only approvals that correspond to the the specified resource identifier. For example: `filter=resourceId equals proj/my-project:env/my-environment:flag/my-flag`. + * - `resourceKind` filters for only approvals that correspond to the specified resource kind. For example: `filter=resourceKind equals flag`. Currently, `flag`, `segment`, and `aiConfig` resource kinds are supported. + * - `reviewStatus` filters for only approvals which correspond to the review status in the specified list. The possible values are `approved`, `declined`, and `pending`. For example: `filter=reviewStatus anyOf ["pending", "approved"]`. + * - `status` filters for only approvals which correspond to the status in the specified list. The possible values are `pending`, `scheduled`, `failed`, and `completed`. For example: `filter=status anyOf ["pending", "scheduled"]`. + * + * You can also apply multiple filters at once. For example, setting `filter=projectKey equals my-project, reviewStatus anyOf ["pending","approved"]` matches approval requests which correspond to the `my-project` project key, and a review status of either `pending` or `approved`. + * + * ### Expanding approval response + * + * LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: + * + * - `flag` includes the flag the approval request belongs to + * - `project` includes the project the approval request belongs to + * - `environments` includes the environments the approval request relates to + * + * For example, `expand=project,flag` includes the `project` and `flag` fields in the response. + */ +export function approvalsList( + client: LaunchDarklyCore, + request: operations.GetApprovalRequestsRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.ExpandableApprovalRequestsResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: LaunchDarklyCore, + request: operations.GetApprovalRequestsRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.ExpandableApprovalRequestsResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.GetApprovalRequestsRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/api/v2/approval-requests")(); + + const query = encodeFormQuery({ + "expand": payload.expand, + "filter": payload.filter, + "limit": payload.limit, + "offset": payload.offset, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getApprovalRequests", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "403", "429", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.ExpandableApprovalRequestsResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.ExpandableApprovalRequestsResponse$inboundSchema), + M.jsonErr(400, errors.InvalidRequestErrorRep$inboundSchema), + M.jsonErr(401, errors.UnauthorizedErrorRep$inboundSchema), + M.jsonErr(403, errors.ForbiddenErrorRep$inboundSchema), + M.jsonErr(429, errors.RateLimitedErrorRep$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/approvalsListForFlag.ts b/src/funcs/approvalsListForFlag.ts new file mode 100644 index 00000000..84ef6d13 --- /dev/null +++ b/src/funcs/approvalsListForFlag.ts @@ -0,0 +1,199 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { LaunchDarklyCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { LaunchDarklyError } from "../models/errors/launchdarklyerror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * List approval requests for a flag + * + * @remarks + * Get all approval requests for a feature flag. + */ +export function approvalsListForFlag( + client: LaunchDarklyCore, + request: operations.GetApprovalsForFlagRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.FlagConfigApprovalRequestsResponse, + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: LaunchDarklyCore, + request: operations.GetApprovalsForFlagRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.FlagConfigApprovalRequestsResponse, + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.GetApprovalsForFlagRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + environmentKey: encodeSimple("environmentKey", payload.environmentKey, { + explode: false, + charEncoding: "percent", + }), + featureFlagKey: encodeSimple("featureFlagKey", payload.featureFlagKey, { + explode: false, + charEncoding: "percent", + }), + projectKey: encodeSimple("projectKey", payload.projectKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests", + )(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "getApprovalsForFlag", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["401", "403", "404", "429", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.FlagConfigApprovalRequestsResponse, + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.FlagConfigApprovalRequestsResponse$inboundSchema), + M.jsonErr(401, errors.UnauthorizedErrorRep$inboundSchema), + M.jsonErr(403, errors.ForbiddenErrorRep$inboundSchema), + M.jsonErr(404, errors.NotFoundErrorRep$inboundSchema), + M.jsonErr(429, errors.RateLimitedErrorRep$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/approvalsReviewFlagRequest.ts b/src/funcs/approvalsReviewFlagRequest.ts new file mode 100644 index 00000000..a8940244 --- /dev/null +++ b/src/funcs/approvalsReviewFlagRequest.ts @@ -0,0 +1,212 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { LaunchDarklyCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import * as errors from "../models/errors/index.js"; +import { LaunchDarklyError } from "../models/errors/launchdarklyerror.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Review approval request for a flag + * + * @remarks + * Review an approval request by approving or denying changes. + */ +export function approvalsReviewFlagRequest( + client: LaunchDarklyCore, + request: operations.PostApprovalRequestReviewForFlagRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.FlagConfigApprovalRequestResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: LaunchDarklyCore, + request: operations.PostApprovalRequestReviewForFlagRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.FlagConfigApprovalRequestResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => + operations.PostApprovalRequestReviewForFlagRequest$outboundSchema.parse( + value, + ), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.postApprovalRequestReviewRequest, { + explode: true, + }); + + const pathParams = { + environmentKey: encodeSimple("environmentKey", payload.environmentKey, { + explode: false, + charEncoding: "percent", + }), + featureFlagKey: encodeSimple("featureFlagKey", payload.featureFlagKey, { + explode: false, + charEncoding: "percent", + }), + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + projectKey: encodeSimple("projectKey", payload.projectKey, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc( + "/api/v2/projects/{projectKey}/flags/{featureFlagKey}/environments/{environmentKey}/approval-requests/{id}/reviews", + )(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "postApprovalRequestReviewForFlag", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["400", "401", "403", "404", "429", "4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + components.FlagConfigApprovalRequestResponse, + | errors.InvalidRequestErrorRep + | errors.UnauthorizedErrorRep + | errors.ForbiddenErrorRep + | errors.NotFoundErrorRep + | errors.RateLimitedErrorRep + | LaunchDarklyError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.FlagConfigApprovalRequestResponse$inboundSchema), + M.jsonErr(400, errors.InvalidRequestErrorRep$inboundSchema), + M.jsonErr(401, errors.UnauthorizedErrorRep$inboundSchema), + M.jsonErr(403, errors.ForbiddenErrorRep$inboundSchema), + M.jsonErr(404, errors.NotFoundErrorRep$inboundSchema), + M.jsonErr(429, errors.RateLimitedErrorRep$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/lib/config.ts b/src/lib/config.ts index 51bf16a7..adfb0e6a 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -69,8 +69,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "2.0", - sdkVersion: "0.6.0", + sdkVersion: "0.6.1", genVersion: "2.845.15", userAgent: - "speakeasy-sdk/typescript 0.6.0 2.845.15 2.0 @launchdarkly/mcp-server", + "speakeasy-sdk/typescript 0.6.1 2.845.15 2.0 @launchdarkly/mcp-server", } as const; diff --git a/src/mcp-server/mcp-server.ts b/src/mcp-server/mcp-server.ts index 9b19ebc6..78af261e 100644 --- a/src/mcp-server/mcp-server.ts +++ b/src/mcp-server/mcp-server.ts @@ -19,7 +19,7 @@ const routes = buildRouteMap({ export const app = buildApplication(routes, { name: "mcp", versionInfo: { - currentVersion: "0.6.0", + currentVersion: "0.6.1", }, }); diff --git a/src/mcp-server/server.ts b/src/mcp-server/server.ts index ae6587e1..cb8df078 100644 --- a/src/mcp-server/server.ts +++ b/src/mcp-server/server.ts @@ -24,6 +24,13 @@ import { tool$aiConfigsList } from "./tools/aiConfigsList.js"; import { tool$aiConfigsUpdate } from "./tools/aiConfigsUpdate.js"; import { tool$aiConfigsUpdateTargeting } from "./tools/aiConfigsUpdateTargeting.js"; import { tool$aiConfigsUpdateVariation } from "./tools/aiConfigsUpdateVariation.js"; +import { tool$approvalsApplyRequest } from "./tools/approvalsApplyRequest.js"; +import { tool$approvalsCreateRequest } from "./tools/approvalsCreateRequest.js"; +import { tool$approvalsDeleteFlagRequest } from "./tools/approvalsDeleteFlagRequest.js"; +import { tool$approvalsGetForFlag } from "./tools/approvalsGetForFlag.js"; +import { tool$approvalsList } from "./tools/approvalsList.js"; +import { tool$approvalsListForFlag } from "./tools/approvalsListForFlag.js"; +import { tool$approvalsReviewFlagRequest } from "./tools/approvalsReviewFlagRequest.js"; import { tool$codeReferencesListRepositories } from "./tools/codeReferencesListRepositories.js"; import { tool$environmentsListByProject } from "./tools/environmentsListByProject.js"; import { tool$featureFlagsCreate } from "./tools/featureFlagsCreate.js"; @@ -43,7 +50,7 @@ export function createMCPServer(deps: { }) { const server = new McpServer({ name: "LaunchDarkly", - version: "0.6.0", + version: "0.6.1", }); const client = new LaunchDarklyCore({ @@ -73,6 +80,13 @@ export function createMCPServer(deps: { const register = { tool, resource, resourceTemplate, prompt }; void register; // suppress unused warnings + tool(tool$approvalsList); + tool(tool$approvalsListForFlag); + tool(tool$approvalsCreateRequest); + tool(tool$approvalsGetForFlag); + tool(tool$approvalsDeleteFlagRequest); + tool(tool$approvalsApplyRequest); + tool(tool$approvalsReviewFlagRequest); tool(tool$codeReferencesListRepositories); tool(tool$featureFlagsGetStatus); tool(tool$featureFlagsList); diff --git a/src/mcp-server/tools/approvalsApplyRequest.ts b/src/mcp-server/tools/approvalsApplyRequest.ts new file mode 100644 index 00000000..a4721393 --- /dev/null +++ b/src/mcp-server/tools/approvalsApplyRequest.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { approvalsApplyRequest } from "../../funcs/approvalsApplyRequest.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.PostApprovalRequestApplyForFlagRequest$inboundSchema, +}; + +export const tool$approvalsApplyRequest: ToolDefinition = { + name: "apply-flag-approval-request", + description: + `Applies an approved approval request, executing the proposed changes to the feature flag. Can only be used after the request has received the required number of approvals. Completes the approval workflow by making the changes live. +`, + scopes: ["write"], + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await approvalsApplyRequest( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/approvalsCreateRequest.ts b/src/mcp-server/tools/approvalsCreateRequest.ts new file mode 100644 index 00000000..3be08244 --- /dev/null +++ b/src/mcp-server/tools/approvalsCreateRequest.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { approvalsCreateRequest } from "../../funcs/approvalsCreateRequest.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.PostApprovalRequestForFlagRequest$inboundSchema, +}; + +export const tool$approvalsCreateRequest: ToolDefinition = { + name: "create-flag-approval-request", + description: + `Creates an approval request for changes to a feature flag's targeting or variations in a specific environment. Required when the environment has mandatory approvals enabled, allowing agents to submit changes for review instead of applying them directly. +`, + scopes: ["write"], + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await approvalsCreateRequest( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/approvalsDeleteFlagRequest.ts b/src/mcp-server/tools/approvalsDeleteFlagRequest.ts new file mode 100644 index 00000000..bc84f382 --- /dev/null +++ b/src/mcp-server/tools/approvalsDeleteFlagRequest.ts @@ -0,0 +1,36 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { approvalsDeleteFlagRequest } from "../../funcs/approvalsDeleteFlagRequest.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.DeleteApprovalRequestForFlagRequest$inboundSchema, +}; + +export const tool$approvalsDeleteFlagRequest: ToolDefinition = { + name: "delete-flag-approval-request", + description: + `Deletes an approval request for a feature flag. Used by agents to withdraw a pending change request that is no longer needed or was created in error. +`, + scopes: ["write"], + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await approvalsDeleteFlagRequest( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + return formatResult(void 0, apiCall); + }, +}; diff --git a/src/mcp-server/tools/approvalsGetForFlag.ts b/src/mcp-server/tools/approvalsGetForFlag.ts new file mode 100644 index 00000000..f99c5a63 --- /dev/null +++ b/src/mcp-server/tools/approvalsGetForFlag.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { approvalsGetForFlag } from "../../funcs/approvalsGetForFlag.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetApprovalForFlagRequest$inboundSchema, +}; + +export const tool$approvalsGetForFlag: ToolDefinition = { + name: "get-flag-approval-request", + description: + `Retrieves details of a specific approval request for a feature flag, including its current status, reviewers, and the proposed changes. Allows agents to inspect pending changes before deciding to review or apply them. +`, + scopes: ["read"], + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await approvalsGetForFlag( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/approvalsList.ts b/src/mcp-server/tools/approvalsList.ts new file mode 100644 index 00000000..094b8bd7 --- /dev/null +++ b/src/mcp-server/tools/approvalsList.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { approvalsList } from "../../funcs/approvalsList.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetApprovalRequestsRequest$inboundSchema, +}; + +export const tool$approvalsList: ToolDefinition = { + name: "list-approval-requests", + description: + `Lists all pending approval requests across the account. Enables AI agents to discover outstanding change requests that need review, providing visibility into the approval pipeline before making flag modifications. +`, + scopes: ["read"], + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await approvalsList( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/approvalsListForFlag.ts b/src/mcp-server/tools/approvalsListForFlag.ts new file mode 100644 index 00000000..876408b8 --- /dev/null +++ b/src/mcp-server/tools/approvalsListForFlag.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { approvalsListForFlag } from "../../funcs/approvalsListForFlag.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetApprovalsForFlagRequest$inboundSchema, +}; + +export const tool$approvalsListForFlag: ToolDefinition = { + name: "list-flag-approval-requests", + description: + `Lists all approval requests for a specific feature flag in a given environment. Useful for agents to check if there are pending changes awaiting review before attempting direct modifications. +`, + scopes: ["read"], + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await approvalsListForFlag( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/approvalsReviewFlagRequest.ts b/src/mcp-server/tools/approvalsReviewFlagRequest.ts new file mode 100644 index 00000000..b6fe4005 --- /dev/null +++ b/src/mcp-server/tools/approvalsReviewFlagRequest.ts @@ -0,0 +1,38 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { approvalsReviewFlagRequest } from "../../funcs/approvalsReviewFlagRequest.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.PostApprovalRequestReviewForFlagRequest$inboundSchema, +}; + +export const tool$approvalsReviewFlagRequest: ToolDefinition = { + name: "review-flag-approval-request", + description: + `Submits a review (approve, decline, or comment) on a pending approval request for a feature flag. Enables agents to participate in the approval workflow by providing feedback or granting approval for proposed changes. +`, + scopes: ["write"], + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await approvalsReviewFlagRequest( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/models/components/aiconfigrep.ts b/src/models/components/aiconfigrep.ts new file mode 100644 index 00000000..12019651 --- /dev/null +++ b/src/models/components/aiconfigrep.ts @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type AIConfigRep = { + /** + * The key of the AI Config + */ + key: string; + /** + * The name of the AI Config + */ + name: string; +}; + +/** @internal */ +export const AIConfigRep$inboundSchema: z.ZodType< + AIConfigRep, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + name: z.string(), +}); +/** @internal */ +export type AIConfigRep$Outbound = { + key: string; + name: string; +}; + +/** @internal */ +export const AIConfigRep$outboundSchema: z.ZodType< + AIConfigRep$Outbound, + z.ZodTypeDef, + AIConfigRep +> = z.object({ + key: z.string(), + name: z.string(), +}); + +export function aiConfigRepToJSON(aiConfigRep: AIConfigRep): string { + return JSON.stringify(AIConfigRep$outboundSchema.parse(aiConfigRep)); +} +export function aiConfigRepFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => AIConfigRep$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'AIConfigRep' from JSON`, + ); +} diff --git a/src/models/components/conflict.ts b/src/models/components/conflict.ts new file mode 100644 index 00000000..bb8d8483 --- /dev/null +++ b/src/models/components/conflict.ts @@ -0,0 +1,54 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type Conflict = { + instruction?: { [k: string]: any } | undefined; + /** + * Reason why the conflict exists + */ + reason?: string | undefined; +}; + +/** @internal */ +export const Conflict$inboundSchema: z.ZodType< + Conflict, + z.ZodTypeDef, + unknown +> = z.object({ + instruction: z.record(z.any()).optional(), + reason: z.string().optional(), +}); +/** @internal */ +export type Conflict$Outbound = { + instruction?: { [k: string]: any } | undefined; + reason?: string | undefined; +}; + +/** @internal */ +export const Conflict$outboundSchema: z.ZodType< + Conflict$Outbound, + z.ZodTypeDef, + Conflict +> = z.object({ + instruction: z.record(z.any()).optional(), + reason: z.string().optional(), +}); + +export function conflictToJSON(conflict: Conflict): string { + return JSON.stringify(Conflict$outboundSchema.parse(conflict)); +} +export function conflictFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Conflict$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Conflict' from JSON`, + ); +} diff --git a/src/models/components/copiedfromenv.ts b/src/models/components/copiedfromenv.ts new file mode 100644 index 00000000..7a0f0c1f --- /dev/null +++ b/src/models/components/copiedfromenv.ts @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type CopiedFromEnv = { + /** + * Key of feature flag copied + */ + key: string; + /** + * Version of feature flag copied + */ + version?: number | undefined; +}; + +/** @internal */ +export const CopiedFromEnv$inboundSchema: z.ZodType< + CopiedFromEnv, + z.ZodTypeDef, + unknown +> = z.object({ + key: z.string(), + version: z.number().int().optional(), +}); +/** @internal */ +export type CopiedFromEnv$Outbound = { + key: string; + version?: number | undefined; +}; + +/** @internal */ +export const CopiedFromEnv$outboundSchema: z.ZodType< + CopiedFromEnv$Outbound, + z.ZodTypeDef, + CopiedFromEnv +> = z.object({ + key: z.string(), + version: z.number().int().optional(), +}); + +export function copiedFromEnvToJSON(copiedFromEnv: CopiedFromEnv): string { + return JSON.stringify(CopiedFromEnv$outboundSchema.parse(copiedFromEnv)); +} +export function copiedFromEnvFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CopiedFromEnv$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CopiedFromEnv' from JSON`, + ); +} diff --git a/src/models/components/createflagconfigapprovalrequestrequest.ts b/src/models/components/createflagconfigapprovalrequestrequest.ts new file mode 100644 index 00000000..b22995a4 --- /dev/null +++ b/src/models/components/createflagconfigapprovalrequestrequest.ts @@ -0,0 +1,98 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type CreateFlagConfigApprovalRequestRequest = { + /** + * Optional comment describing the approval request + */ + comment?: string | undefined; + /** + * A brief description of the changes you're requesting + */ + description: string; + instructions: Array<{ [k: string]: any }>; + /** + * An array of member IDs. These members are notified to review the approval request. + */ + notifyMemberIds?: Array | undefined; + /** + * An array of team keys. The members of these teams are notified to review the approval request. + */ + notifyTeamKeys?: Array | undefined; + executionDate?: number | undefined; + /** + * The ID of a scheduled change. Include this if your instructions include editing or deleting a scheduled change. + */ + operatingOnId?: string | undefined; + integrationConfig?: { [k: string]: any } | undefined; +}; + +/** @internal */ +export const CreateFlagConfigApprovalRequestRequest$inboundSchema: z.ZodType< + CreateFlagConfigApprovalRequestRequest, + z.ZodTypeDef, + unknown +> = z.object({ + comment: z.string().optional(), + description: z.string(), + instructions: z.array(z.record(z.any())), + notifyMemberIds: z.array(z.string()).optional(), + notifyTeamKeys: z.array(z.string()).optional(), + executionDate: z.number().int().optional(), + operatingOnId: z.string().optional(), + integrationConfig: z.record(z.any()).optional(), +}); +/** @internal */ +export type CreateFlagConfigApprovalRequestRequest$Outbound = { + comment?: string | undefined; + description: string; + instructions: Array<{ [k: string]: any }>; + notifyMemberIds?: Array | undefined; + notifyTeamKeys?: Array | undefined; + executionDate?: number | undefined; + operatingOnId?: string | undefined; + integrationConfig?: { [k: string]: any } | undefined; +}; + +/** @internal */ +export const CreateFlagConfigApprovalRequestRequest$outboundSchema: z.ZodType< + CreateFlagConfigApprovalRequestRequest$Outbound, + z.ZodTypeDef, + CreateFlagConfigApprovalRequestRequest +> = z.object({ + comment: z.string().optional(), + description: z.string(), + instructions: z.array(z.record(z.any())), + notifyMemberIds: z.array(z.string()).optional(), + notifyTeamKeys: z.array(z.string()).optional(), + executionDate: z.number().int().optional(), + operatingOnId: z.string().optional(), + integrationConfig: z.record(z.any()).optional(), +}); + +export function createFlagConfigApprovalRequestRequestToJSON( + createFlagConfigApprovalRequestRequest: + CreateFlagConfigApprovalRequestRequest, +): string { + return JSON.stringify( + CreateFlagConfigApprovalRequestRequest$outboundSchema.parse( + createFlagConfigApprovalRequestRequest, + ), + ); +} +export function createFlagConfigApprovalRequestRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + CreateFlagConfigApprovalRequestRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateFlagConfigApprovalRequestRequest' from JSON`, + ); +} diff --git a/src/models/components/customworkflowmeta.ts b/src/models/components/customworkflowmeta.ts new file mode 100644 index 00000000..a142f4a0 --- /dev/null +++ b/src/models/components/customworkflowmeta.ts @@ -0,0 +1,64 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + CustomWorkflowStageMeta, + CustomWorkflowStageMeta$inboundSchema, + CustomWorkflowStageMeta$Outbound, + CustomWorkflowStageMeta$outboundSchema, +} from "./customworkflowstagemeta.js"; + +export type CustomWorkflowMeta = { + /** + * The name of the workflow stage that required this approval request + */ + name?: string | undefined; + stage?: CustomWorkflowStageMeta | undefined; +}; + +/** @internal */ +export const CustomWorkflowMeta$inboundSchema: z.ZodType< + CustomWorkflowMeta, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string().optional(), + stage: CustomWorkflowStageMeta$inboundSchema.optional(), +}); +/** @internal */ +export type CustomWorkflowMeta$Outbound = { + name?: string | undefined; + stage?: CustomWorkflowStageMeta$Outbound | undefined; +}; + +/** @internal */ +export const CustomWorkflowMeta$outboundSchema: z.ZodType< + CustomWorkflowMeta$Outbound, + z.ZodTypeDef, + CustomWorkflowMeta +> = z.object({ + name: z.string().optional(), + stage: CustomWorkflowStageMeta$outboundSchema.optional(), +}); + +export function customWorkflowMetaToJSON( + customWorkflowMeta: CustomWorkflowMeta, +): string { + return JSON.stringify( + CustomWorkflowMeta$outboundSchema.parse(customWorkflowMeta), + ); +} +export function customWorkflowMetaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CustomWorkflowMeta$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CustomWorkflowMeta' from JSON`, + ); +} diff --git a/src/models/components/customworkflowstagemeta.ts b/src/models/components/customworkflowstagemeta.ts new file mode 100644 index 00000000..6c5b74db --- /dev/null +++ b/src/models/components/customworkflowstagemeta.ts @@ -0,0 +1,61 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type CustomWorkflowStageMeta = { + /** + * The zero-based index of the workflow stage + */ + index?: number | undefined; + /** + * The name of the workflow stage + */ + name?: string | undefined; +}; + +/** @internal */ +export const CustomWorkflowStageMeta$inboundSchema: z.ZodType< + CustomWorkflowStageMeta, + z.ZodTypeDef, + unknown +> = z.object({ + index: z.number().int().optional(), + name: z.string().optional(), +}); +/** @internal */ +export type CustomWorkflowStageMeta$Outbound = { + index?: number | undefined; + name?: string | undefined; +}; + +/** @internal */ +export const CustomWorkflowStageMeta$outboundSchema: z.ZodType< + CustomWorkflowStageMeta$Outbound, + z.ZodTypeDef, + CustomWorkflowStageMeta +> = z.object({ + index: z.number().int().optional(), + name: z.string().optional(), +}); + +export function customWorkflowStageMetaToJSON( + customWorkflowStageMeta: CustomWorkflowStageMeta, +): string { + return JSON.stringify( + CustomWorkflowStageMeta$outboundSchema.parse(customWorkflowStageMeta), + ); +} +export function customWorkflowStageMetaFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CustomWorkflowStageMeta$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CustomWorkflowStageMeta' from JSON`, + ); +} diff --git a/src/models/components/expandableapprovalrequestresponse.ts b/src/models/components/expandableapprovalrequestresponse.ts new file mode 100644 index 00000000..3d9750c7 --- /dev/null +++ b/src/models/components/expandableapprovalrequestresponse.ts @@ -0,0 +1,325 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + ApprovalSettings, + ApprovalSettings$inboundSchema, + ApprovalSettings$Outbound, + ApprovalSettings$outboundSchema, +} from "./approvalsettings.js"; +import { + Conflict, + Conflict$inboundSchema, + Conflict$Outbound, + Conflict$outboundSchema, +} from "./conflict.js"; +import { + CopiedFromEnv, + CopiedFromEnv$inboundSchema, + CopiedFromEnv$Outbound, + CopiedFromEnv$outboundSchema, +} from "./copiedfromenv.js"; +import { + CustomWorkflowMeta, + CustomWorkflowMeta$inboundSchema, + CustomWorkflowMeta$Outbound, + CustomWorkflowMeta$outboundSchema, +} from "./customworkflowmeta.js"; +import { + Environment, + Environment$inboundSchema, + Environment$Outbound, + Environment$outboundSchema, +} from "./environment.js"; +import { + ExpandedFlagRep, + ExpandedFlagRep$inboundSchema, + ExpandedFlagRep$Outbound, + ExpandedFlagRep$outboundSchema, +} from "./expandedflagrep.js"; +import { + ExpandedResourceRep, + ExpandedResourceRep$inboundSchema, + ExpandedResourceRep$Outbound, + ExpandedResourceRep$outboundSchema, +} from "./expandedresourcerep.js"; +import { + IntegrationMetadata, + IntegrationMetadata$inboundSchema, + IntegrationMetadata$Outbound, + IntegrationMetadata$outboundSchema, +} from "./integrationmetadata.js"; +import { + Project, + Project$inboundSchema, + Project$Outbound, + Project$outboundSchema, +} from "./project.js"; +import { + ReviewResponse, + ReviewResponse$inboundSchema, + ReviewResponse$Outbound, + ReviewResponse$outboundSchema, +} from "./reviewresponse.js"; + +/** + * Current status of the review of this approval request + */ +export const ExpandableApprovalRequestResponseReviewStatus = { + Approved: "approved", + Declined: "declined", + Pending: "pending", +} as const; +/** + * Current status of the review of this approval request + */ +export type ExpandableApprovalRequestResponseReviewStatus = ClosedEnum< + typeof ExpandableApprovalRequestResponseReviewStatus +>; + +/** + * Current status of the approval request + */ +export const ExpandableApprovalRequestResponseStatus = { + Pending: "pending", + Completed: "completed", + Failed: "failed", + Scheduled: "scheduled", +} as const; +/** + * Current status of the approval request + */ +export type ExpandableApprovalRequestResponseStatus = ClosedEnum< + typeof ExpandableApprovalRequestResponseStatus +>; + +export type ExpandableApprovalRequestResponse = { + /** + * The ID of this approval request + */ + id: string; + /** + * Version of the approval request + */ + version: number; + creationDate: number; + serviceKind: string; + /** + * The ID of the member who requested the approval + */ + requestorId?: string | undefined; + /** + * A human-friendly name for the approval request + */ + description?: string | undefined; + /** + * Current status of the review of this approval request + */ + reviewStatus: ExpandableApprovalRequestResponseReviewStatus; + /** + * An array of individual reviews of this approval request + */ + allReviews: Array; + /** + * An array of member IDs. These members are notified to review the approval request. + */ + notifyMemberIds: Array; + appliedDate?: number | undefined; + /** + * The member ID of the member who applied the approval request + */ + appliedByMemberId?: string | undefined; + /** + * The service token ID of the service token which applied the approval request + */ + appliedByServiceTokenId?: string | undefined; + /** + * Current status of the approval request + */ + status: ExpandableApprovalRequestResponseStatus; + instructions: Array<{ [k: string]: any }>; + /** + * Details on any conflicting approval requests + */ + conflicts: Array; + /** + * The location and content type of related resources + */ + links: { [k: string]: any }; + executionDate?: number | undefined; + /** + * ID of scheduled change to edit or delete + */ + operatingOnId?: string | undefined; + integrationMetadata?: IntegrationMetadata | undefined; + source?: CopiedFromEnv | undefined; + customWorkflowMetadata?: CustomWorkflowMeta | undefined; + /** + * String representation of a resource + */ + resourceId?: string | undefined; + approvalSettings?: ApprovalSettings | undefined; + project?: Project | undefined; + /** + * List of environments the approval impacts + */ + environments?: Array | undefined; + flag?: ExpandedFlagRep | undefined; + resource?: ExpandedResourceRep | undefined; +}; + +/** @internal */ +export const ExpandableApprovalRequestResponseReviewStatus$inboundSchema: + z.ZodNativeEnum = z + .nativeEnum(ExpandableApprovalRequestResponseReviewStatus); +/** @internal */ +export const ExpandableApprovalRequestResponseReviewStatus$outboundSchema: + z.ZodNativeEnum = + ExpandableApprovalRequestResponseReviewStatus$inboundSchema; + +/** @internal */ +export const ExpandableApprovalRequestResponseStatus$inboundSchema: + z.ZodNativeEnum = z + .nativeEnum(ExpandableApprovalRequestResponseStatus); +/** @internal */ +export const ExpandableApprovalRequestResponseStatus$outboundSchema: + z.ZodNativeEnum = + ExpandableApprovalRequestResponseStatus$inboundSchema; + +/** @internal */ +export const ExpandableApprovalRequestResponse$inboundSchema: z.ZodType< + ExpandableApprovalRequestResponse, + z.ZodTypeDef, + unknown +> = z.object({ + _id: z.string(), + _version: z.number().int(), + creationDate: z.number().int(), + serviceKind: z.string(), + requestorId: z.string().optional(), + description: z.string().optional(), + reviewStatus: ExpandableApprovalRequestResponseReviewStatus$inboundSchema, + allReviews: z.array(ReviewResponse$inboundSchema), + notifyMemberIds: z.array(z.string()), + appliedDate: z.number().int().optional(), + appliedByMemberId: z.string().optional(), + appliedByServiceTokenId: z.string().optional(), + status: ExpandableApprovalRequestResponseStatus$inboundSchema, + instructions: z.array(z.record(z.any())), + conflicts: z.array(Conflict$inboundSchema), + _links: z.record(z.any()), + executionDate: z.number().int().optional(), + operatingOnId: z.string().optional(), + integrationMetadata: IntegrationMetadata$inboundSchema.optional(), + source: CopiedFromEnv$inboundSchema.optional(), + customWorkflowMetadata: CustomWorkflowMeta$inboundSchema.optional(), + resourceId: z.string().optional(), + approvalSettings: ApprovalSettings$inboundSchema.optional(), + project: Project$inboundSchema.optional(), + environments: z.array(Environment$inboundSchema).optional(), + flag: ExpandedFlagRep$inboundSchema.optional(), + resource: ExpandedResourceRep$inboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + "_id": "id", + "_version": "version", + "_links": "links", + }); +}); +/** @internal */ +export type ExpandableApprovalRequestResponse$Outbound = { + _id: string; + _version: number; + creationDate: number; + serviceKind: string; + requestorId?: string | undefined; + description?: string | undefined; + reviewStatus: string; + allReviews: Array; + notifyMemberIds: Array; + appliedDate?: number | undefined; + appliedByMemberId?: string | undefined; + appliedByServiceTokenId?: string | undefined; + status: string; + instructions: Array<{ [k: string]: any }>; + conflicts: Array; + _links: { [k: string]: any }; + executionDate?: number | undefined; + operatingOnId?: string | undefined; + integrationMetadata?: IntegrationMetadata$Outbound | undefined; + source?: CopiedFromEnv$Outbound | undefined; + customWorkflowMetadata?: CustomWorkflowMeta$Outbound | undefined; + resourceId?: string | undefined; + approvalSettings?: ApprovalSettings$Outbound | undefined; + project?: Project$Outbound | undefined; + environments?: Array | undefined; + flag?: ExpandedFlagRep$Outbound | undefined; + resource?: ExpandedResourceRep$Outbound | undefined; +}; + +/** @internal */ +export const ExpandableApprovalRequestResponse$outboundSchema: z.ZodType< + ExpandableApprovalRequestResponse$Outbound, + z.ZodTypeDef, + ExpandableApprovalRequestResponse +> = z.object({ + id: z.string(), + version: z.number().int(), + creationDate: z.number().int(), + serviceKind: z.string(), + requestorId: z.string().optional(), + description: z.string().optional(), + reviewStatus: ExpandableApprovalRequestResponseReviewStatus$outboundSchema, + allReviews: z.array(ReviewResponse$outboundSchema), + notifyMemberIds: z.array(z.string()), + appliedDate: z.number().int().optional(), + appliedByMemberId: z.string().optional(), + appliedByServiceTokenId: z.string().optional(), + status: ExpandableApprovalRequestResponseStatus$outboundSchema, + instructions: z.array(z.record(z.any())), + conflicts: z.array(Conflict$outboundSchema), + links: z.record(z.any()), + executionDate: z.number().int().optional(), + operatingOnId: z.string().optional(), + integrationMetadata: IntegrationMetadata$outboundSchema.optional(), + source: CopiedFromEnv$outboundSchema.optional(), + customWorkflowMetadata: CustomWorkflowMeta$outboundSchema.optional(), + resourceId: z.string().optional(), + approvalSettings: ApprovalSettings$outboundSchema.optional(), + project: Project$outboundSchema.optional(), + environments: z.array(Environment$outboundSchema).optional(), + flag: ExpandedFlagRep$outboundSchema.optional(), + resource: ExpandedResourceRep$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + id: "_id", + version: "_version", + links: "_links", + }); +}); + +export function expandableApprovalRequestResponseToJSON( + expandableApprovalRequestResponse: ExpandableApprovalRequestResponse, +): string { + return JSON.stringify( + ExpandableApprovalRequestResponse$outboundSchema.parse( + expandableApprovalRequestResponse, + ), + ); +} +export function expandableApprovalRequestResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ExpandableApprovalRequestResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ExpandableApprovalRequestResponse' from JSON`, + ); +} diff --git a/src/models/components/expandableapprovalrequestsresponse.ts b/src/models/components/expandableapprovalrequestsresponse.ts new file mode 100644 index 00000000..46a4912a --- /dev/null +++ b/src/models/components/expandableapprovalrequestsresponse.ts @@ -0,0 +1,92 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + ExpandableApprovalRequestResponse, + ExpandableApprovalRequestResponse$inboundSchema, + ExpandableApprovalRequestResponse$Outbound, + ExpandableApprovalRequestResponse$outboundSchema, +} from "./expandableapprovalrequestresponse.js"; +import { + Link, + Link$inboundSchema, + Link$Outbound, + Link$outboundSchema, +} from "./link.js"; + +export type ExpandableApprovalRequestsResponse = { + /** + * An array of approval requests + */ + items: Array; + /** + * Total number of approval requests + */ + totalCount: number; + /** + * The location and content type of related resources + */ + links: { [k: string]: Link }; +}; + +/** @internal */ +export const ExpandableApprovalRequestsResponse$inboundSchema: z.ZodType< + ExpandableApprovalRequestsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + items: z.array(ExpandableApprovalRequestResponse$inboundSchema), + totalCount: z.number().int(), + _links: z.record(Link$inboundSchema), +}).transform((v) => { + return remap$(v, { + "_links": "links", + }); +}); +/** @internal */ +export type ExpandableApprovalRequestsResponse$Outbound = { + items: Array; + totalCount: number; + _links: { [k: string]: Link$Outbound }; +}; + +/** @internal */ +export const ExpandableApprovalRequestsResponse$outboundSchema: z.ZodType< + ExpandableApprovalRequestsResponse$Outbound, + z.ZodTypeDef, + ExpandableApprovalRequestsResponse +> = z.object({ + items: z.array(ExpandableApprovalRequestResponse$outboundSchema), + totalCount: z.number().int(), + links: z.record(Link$outboundSchema), +}).transform((v) => { + return remap$(v, { + links: "_links", + }); +}); + +export function expandableApprovalRequestsResponseToJSON( + expandableApprovalRequestsResponse: ExpandableApprovalRequestsResponse, +): string { + return JSON.stringify( + ExpandableApprovalRequestsResponse$outboundSchema.parse( + expandableApprovalRequestsResponse, + ), + ); +} +export function expandableApprovalRequestsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + ExpandableApprovalRequestsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ExpandableApprovalRequestsResponse' from JSON`, + ); +} diff --git a/src/models/components/expandedflagrep.ts b/src/models/components/expandedflagrep.ts new file mode 100644 index 00000000..1c85e007 --- /dev/null +++ b/src/models/components/expandedflagrep.ts @@ -0,0 +1,226 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + ClientSideAvailability, + ClientSideAvailability$inboundSchema, + ClientSideAvailability$Outbound, + ClientSideAvailability$outboundSchema, +} from "./clientsideavailability.js"; +import { + CustomProperty, + CustomProperty$inboundSchema, + CustomProperty$Outbound, + CustomProperty$outboundSchema, +} from "./customproperty.js"; +import { + Defaults, + Defaults$inboundSchema, + Defaults$Outbound, + Defaults$outboundSchema, +} from "./defaults.js"; +import { + Link, + Link$inboundSchema, + Link$Outbound, + Link$outboundSchema, +} from "./link.js"; +import { + MemberSummary, + MemberSummary$inboundSchema, + MemberSummary$Outbound, + MemberSummary$outboundSchema, +} from "./membersummary.js"; +import { + Variation, + Variation$inboundSchema, + Variation$Outbound, + Variation$outboundSchema, +} from "./variation.js"; + +/** + * Kind of feature flag + */ +export const ExpandedFlagRepKind = { + Boolean: "boolean", + Multivariate: "multivariate", +} as const; +/** + * Kind of feature flag + */ +export type ExpandedFlagRepKind = ClosedEnum; + +export type ExpandedFlagRep = { + /** + * A human-friendly name for the feature flag + */ + name: string; + /** + * Kind of feature flag + */ + kind: ExpandedFlagRepKind; + /** + * Description of the feature flag + */ + description?: string | undefined; + /** + * A unique key used to reference the flag in your code + */ + key: string; + /** + * Version of the feature flag + */ + version: number; + creationDate: number; + /** + * Deprecated, use clientSideAvailability. Whether this flag should be made available to the client-side JavaScript SDK + * + * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. + */ + includeInSnippet?: boolean | undefined; + clientSideAvailability?: ClientSideAvailability | undefined; + /** + * An array of possible variations for the flag + */ + variations: Array; + /** + * Whether the flag is a temporary flag + */ + temporary: boolean; + /** + * Tags for the feature flag + */ + tags: Array; + /** + * The location and content type of related resources + */ + links: { [k: string]: Link }; + /** + * The ID of the member who maintains the flag + */ + maintainerId?: string | undefined; + maintainer?: MemberSummary | undefined; + customProperties: { [k: string]: CustomProperty }; + /** + * Boolean indicating if the feature flag is archived + */ + archived: boolean; + archivedDate?: number | undefined; + defaults?: Defaults | undefined; +}; + +/** @internal */ +export const ExpandedFlagRepKind$inboundSchema: z.ZodNativeEnum< + typeof ExpandedFlagRepKind +> = z.nativeEnum(ExpandedFlagRepKind); +/** @internal */ +export const ExpandedFlagRepKind$outboundSchema: z.ZodNativeEnum< + typeof ExpandedFlagRepKind +> = ExpandedFlagRepKind$inboundSchema; + +/** @internal */ +export const ExpandedFlagRep$inboundSchema: z.ZodType< + ExpandedFlagRep, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), + kind: ExpandedFlagRepKind$inboundSchema, + description: z.string().optional(), + key: z.string(), + _version: z.number().int(), + creationDate: z.number().int(), + includeInSnippet: z.boolean().optional(), + clientSideAvailability: ClientSideAvailability$inboundSchema.optional(), + variations: z.array(Variation$inboundSchema), + temporary: z.boolean(), + tags: z.array(z.string()), + _links: z.record(Link$inboundSchema), + maintainerId: z.string().optional(), + _maintainer: MemberSummary$inboundSchema.optional(), + customProperties: z.record(CustomProperty$inboundSchema), + archived: z.boolean(), + archivedDate: z.number().int().optional(), + defaults: Defaults$inboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + "_version": "version", + "_links": "links", + "_maintainer": "maintainer", + }); +}); +/** @internal */ +export type ExpandedFlagRep$Outbound = { + name: string; + kind: string; + description?: string | undefined; + key: string; + _version: number; + creationDate: number; + includeInSnippet?: boolean | undefined; + clientSideAvailability?: ClientSideAvailability$Outbound | undefined; + variations: Array; + temporary: boolean; + tags: Array; + _links: { [k: string]: Link$Outbound }; + maintainerId?: string | undefined; + _maintainer?: MemberSummary$Outbound | undefined; + customProperties: { [k: string]: CustomProperty$Outbound }; + archived: boolean; + archivedDate?: number | undefined; + defaults?: Defaults$Outbound | undefined; +}; + +/** @internal */ +export const ExpandedFlagRep$outboundSchema: z.ZodType< + ExpandedFlagRep$Outbound, + z.ZodTypeDef, + ExpandedFlagRep +> = z.object({ + name: z.string(), + kind: ExpandedFlagRepKind$outboundSchema, + description: z.string().optional(), + key: z.string(), + version: z.number().int(), + creationDate: z.number().int(), + includeInSnippet: z.boolean().optional(), + clientSideAvailability: ClientSideAvailability$outboundSchema.optional(), + variations: z.array(Variation$outboundSchema), + temporary: z.boolean(), + tags: z.array(z.string()), + links: z.record(Link$outboundSchema), + maintainerId: z.string().optional(), + maintainer: MemberSummary$outboundSchema.optional(), + customProperties: z.record(CustomProperty$outboundSchema), + archived: z.boolean(), + archivedDate: z.number().int().optional(), + defaults: Defaults$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + version: "_version", + links: "_links", + maintainer: "_maintainer", + }); +}); + +export function expandedFlagRepToJSON( + expandedFlagRep: ExpandedFlagRep, +): string { + return JSON.stringify(ExpandedFlagRep$outboundSchema.parse(expandedFlagRep)); +} +export function expandedFlagRepFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ExpandedFlagRep$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ExpandedFlagRep' from JSON`, + ); +} diff --git a/src/models/components/expandedresourcerep.ts b/src/models/components/expandedresourcerep.ts new file mode 100644 index 00000000..8791db84 --- /dev/null +++ b/src/models/components/expandedresourcerep.ts @@ -0,0 +1,84 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + AIConfigRep, + AIConfigRep$inboundSchema, + AIConfigRep$Outbound, + AIConfigRep$outboundSchema, +} from "./aiconfigrep.js"; +import { + ExpandedFlagRep, + ExpandedFlagRep$inboundSchema, + ExpandedFlagRep$Outbound, + ExpandedFlagRep$outboundSchema, +} from "./expandedflagrep.js"; +import { + UserSegment, + UserSegment$inboundSchema, + UserSegment$Outbound, + UserSegment$outboundSchema, +} from "./usersegment.js"; + +export type ExpandedResourceRep = { + /** + * The type of resource + */ + kind: string; + aiConfig?: AIConfigRep | undefined; + flag?: ExpandedFlagRep | undefined; + segment?: UserSegment | undefined; +}; + +/** @internal */ +export const ExpandedResourceRep$inboundSchema: z.ZodType< + ExpandedResourceRep, + z.ZodTypeDef, + unknown +> = z.object({ + kind: z.string(), + aiConfig: AIConfigRep$inboundSchema.optional(), + flag: ExpandedFlagRep$inboundSchema.optional(), + segment: UserSegment$inboundSchema.optional(), +}); +/** @internal */ +export type ExpandedResourceRep$Outbound = { + kind: string; + aiConfig?: AIConfigRep$Outbound | undefined; + flag?: ExpandedFlagRep$Outbound | undefined; + segment?: UserSegment$Outbound | undefined; +}; + +/** @internal */ +export const ExpandedResourceRep$outboundSchema: z.ZodType< + ExpandedResourceRep$Outbound, + z.ZodTypeDef, + ExpandedResourceRep +> = z.object({ + kind: z.string(), + aiConfig: AIConfigRep$outboundSchema.optional(), + flag: ExpandedFlagRep$outboundSchema.optional(), + segment: UserSegment$outboundSchema.optional(), +}); + +export function expandedResourceRepToJSON( + expandedResourceRep: ExpandedResourceRep, +): string { + return JSON.stringify( + ExpandedResourceRep$outboundSchema.parse(expandedResourceRep), + ); +} +export function expandedResourceRepFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ExpandedResourceRep$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ExpandedResourceRep' from JSON`, + ); +} diff --git a/src/models/components/flagconfigapprovalrequestresponse.ts b/src/models/components/flagconfigapprovalrequestresponse.ts new file mode 100644 index 00000000..0f1ba985 --- /dev/null +++ b/src/models/components/flagconfigapprovalrequestresponse.ts @@ -0,0 +1,265 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + Conflict, + Conflict$inboundSchema, + Conflict$Outbound, + Conflict$outboundSchema, +} from "./conflict.js"; +import { + CopiedFromEnv, + CopiedFromEnv$inboundSchema, + CopiedFromEnv$Outbound, + CopiedFromEnv$outboundSchema, +} from "./copiedfromenv.js"; +import { + CustomWorkflowMeta, + CustomWorkflowMeta$inboundSchema, + CustomWorkflowMeta$Outbound, + CustomWorkflowMeta$outboundSchema, +} from "./customworkflowmeta.js"; +import { + IntegrationMetadata, + IntegrationMetadata$inboundSchema, + IntegrationMetadata$Outbound, + IntegrationMetadata$outboundSchema, +} from "./integrationmetadata.js"; +import { + ReviewResponse, + ReviewResponse$inboundSchema, + ReviewResponse$Outbound, + ReviewResponse$outboundSchema, +} from "./reviewresponse.js"; + +/** + * Current status of the review of this approval request + */ +export const FlagConfigApprovalRequestResponseReviewStatus = { + Approved: "approved", + Declined: "declined", + Pending: "pending", +} as const; +/** + * Current status of the review of this approval request + */ +export type FlagConfigApprovalRequestResponseReviewStatus = ClosedEnum< + typeof FlagConfigApprovalRequestResponseReviewStatus +>; + +/** + * Current status of the approval request + */ +export const FlagConfigApprovalRequestResponseStatus = { + Pending: "pending", + Completed: "completed", + Failed: "failed", + Scheduled: "scheduled", +} as const; +/** + * Current status of the approval request + */ +export type FlagConfigApprovalRequestResponseStatus = ClosedEnum< + typeof FlagConfigApprovalRequestResponseStatus +>; + +export type FlagConfigApprovalRequestResponse = { + /** + * The ID of this approval request + */ + id: string; + /** + * Version of the approval request + */ + version: number; + creationDate: number; + serviceKind: string; + /** + * The ID of the member who requested the approval + */ + requestorId?: string | undefined; + /** + * A human-friendly name for the approval request + */ + description?: string | undefined; + /** + * Current status of the review of this approval request + */ + reviewStatus: FlagConfigApprovalRequestResponseReviewStatus; + /** + * An array of individual reviews of this approval request + */ + allReviews: Array; + /** + * An array of member IDs. These members are notified to review the approval request. + */ + notifyMemberIds: Array; + appliedDate?: number | undefined; + /** + * The member ID of the member who applied the approval request + */ + appliedByMemberId?: string | undefined; + /** + * The service token ID of the service token which applied the approval request + */ + appliedByServiceTokenId?: string | undefined; + /** + * Current status of the approval request + */ + status: FlagConfigApprovalRequestResponseStatus; + instructions: Array<{ [k: string]: any }>; + /** + * Details on any conflicting approval requests + */ + conflicts: Array; + /** + * The location and content type of related resources + */ + links: { [k: string]: any }; + executionDate?: number | undefined; + /** + * ID of scheduled change to edit or delete + */ + operatingOnId?: string | undefined; + integrationMetadata?: IntegrationMetadata | undefined; + source?: CopiedFromEnv | undefined; + customWorkflowMetadata?: CustomWorkflowMeta | undefined; +}; + +/** @internal */ +export const FlagConfigApprovalRequestResponseReviewStatus$inboundSchema: + z.ZodNativeEnum = z + .nativeEnum(FlagConfigApprovalRequestResponseReviewStatus); +/** @internal */ +export const FlagConfigApprovalRequestResponseReviewStatus$outboundSchema: + z.ZodNativeEnum = + FlagConfigApprovalRequestResponseReviewStatus$inboundSchema; + +/** @internal */ +export const FlagConfigApprovalRequestResponseStatus$inboundSchema: + z.ZodNativeEnum = z + .nativeEnum(FlagConfigApprovalRequestResponseStatus); +/** @internal */ +export const FlagConfigApprovalRequestResponseStatus$outboundSchema: + z.ZodNativeEnum = + FlagConfigApprovalRequestResponseStatus$inboundSchema; + +/** @internal */ +export const FlagConfigApprovalRequestResponse$inboundSchema: z.ZodType< + FlagConfigApprovalRequestResponse, + z.ZodTypeDef, + unknown +> = z.object({ + _id: z.string(), + _version: z.number().int(), + creationDate: z.number().int(), + serviceKind: z.string(), + requestorId: z.string().optional(), + description: z.string().optional(), + reviewStatus: FlagConfigApprovalRequestResponseReviewStatus$inboundSchema, + allReviews: z.array(ReviewResponse$inboundSchema), + notifyMemberIds: z.array(z.string()), + appliedDate: z.number().int().optional(), + appliedByMemberId: z.string().optional(), + appliedByServiceTokenId: z.string().optional(), + status: FlagConfigApprovalRequestResponseStatus$inboundSchema, + instructions: z.array(z.record(z.any())), + conflicts: z.array(Conflict$inboundSchema), + _links: z.record(z.any()), + executionDate: z.number().int().optional(), + operatingOnId: z.string().optional(), + integrationMetadata: IntegrationMetadata$inboundSchema.optional(), + source: CopiedFromEnv$inboundSchema.optional(), + customWorkflowMetadata: CustomWorkflowMeta$inboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + "_id": "id", + "_version": "version", + "_links": "links", + }); +}); +/** @internal */ +export type FlagConfigApprovalRequestResponse$Outbound = { + _id: string; + _version: number; + creationDate: number; + serviceKind: string; + requestorId?: string | undefined; + description?: string | undefined; + reviewStatus: string; + allReviews: Array; + notifyMemberIds: Array; + appliedDate?: number | undefined; + appliedByMemberId?: string | undefined; + appliedByServiceTokenId?: string | undefined; + status: string; + instructions: Array<{ [k: string]: any }>; + conflicts: Array; + _links: { [k: string]: any }; + executionDate?: number | undefined; + operatingOnId?: string | undefined; + integrationMetadata?: IntegrationMetadata$Outbound | undefined; + source?: CopiedFromEnv$Outbound | undefined; + customWorkflowMetadata?: CustomWorkflowMeta$Outbound | undefined; +}; + +/** @internal */ +export const FlagConfigApprovalRequestResponse$outboundSchema: z.ZodType< + FlagConfigApprovalRequestResponse$Outbound, + z.ZodTypeDef, + FlagConfigApprovalRequestResponse +> = z.object({ + id: z.string(), + version: z.number().int(), + creationDate: z.number().int(), + serviceKind: z.string(), + requestorId: z.string().optional(), + description: z.string().optional(), + reviewStatus: FlagConfigApprovalRequestResponseReviewStatus$outboundSchema, + allReviews: z.array(ReviewResponse$outboundSchema), + notifyMemberIds: z.array(z.string()), + appliedDate: z.number().int().optional(), + appliedByMemberId: z.string().optional(), + appliedByServiceTokenId: z.string().optional(), + status: FlagConfigApprovalRequestResponseStatus$outboundSchema, + instructions: z.array(z.record(z.any())), + conflicts: z.array(Conflict$outboundSchema), + links: z.record(z.any()), + executionDate: z.number().int().optional(), + operatingOnId: z.string().optional(), + integrationMetadata: IntegrationMetadata$outboundSchema.optional(), + source: CopiedFromEnv$outboundSchema.optional(), + customWorkflowMetadata: CustomWorkflowMeta$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + id: "_id", + version: "_version", + links: "_links", + }); +}); + +export function flagConfigApprovalRequestResponseToJSON( + flagConfigApprovalRequestResponse: FlagConfigApprovalRequestResponse, +): string { + return JSON.stringify( + FlagConfigApprovalRequestResponse$outboundSchema.parse( + flagConfigApprovalRequestResponse, + ), + ); +} +export function flagConfigApprovalRequestResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => FlagConfigApprovalRequestResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'FlagConfigApprovalRequestResponse' from JSON`, + ); +} diff --git a/src/models/components/flagconfigapprovalrequestsresponse.ts b/src/models/components/flagconfigapprovalrequestsresponse.ts new file mode 100644 index 00000000..c5d971e5 --- /dev/null +++ b/src/models/components/flagconfigapprovalrequestsresponse.ts @@ -0,0 +1,85 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + FlagConfigApprovalRequestResponse, + FlagConfigApprovalRequestResponse$inboundSchema, + FlagConfigApprovalRequestResponse$Outbound, + FlagConfigApprovalRequestResponse$outboundSchema, +} from "./flagconfigapprovalrequestresponse.js"; +import { + Link, + Link$inboundSchema, + Link$Outbound, + Link$outboundSchema, +} from "./link.js"; + +export type FlagConfigApprovalRequestsResponse = { + /** + * An array of approval requests + */ + items: Array; + /** + * The location and content type of related resources + */ + links: { [k: string]: Link }; +}; + +/** @internal */ +export const FlagConfigApprovalRequestsResponse$inboundSchema: z.ZodType< + FlagConfigApprovalRequestsResponse, + z.ZodTypeDef, + unknown +> = z.object({ + items: z.array(FlagConfigApprovalRequestResponse$inboundSchema), + _links: z.record(Link$inboundSchema), +}).transform((v) => { + return remap$(v, { + "_links": "links", + }); +}); +/** @internal */ +export type FlagConfigApprovalRequestsResponse$Outbound = { + items: Array; + _links: { [k: string]: Link$Outbound }; +}; + +/** @internal */ +export const FlagConfigApprovalRequestsResponse$outboundSchema: z.ZodType< + FlagConfigApprovalRequestsResponse$Outbound, + z.ZodTypeDef, + FlagConfigApprovalRequestsResponse +> = z.object({ + items: z.array(FlagConfigApprovalRequestResponse$outboundSchema), + links: z.record(Link$outboundSchema), +}).transform((v) => { + return remap$(v, { + links: "_links", + }); +}); + +export function flagConfigApprovalRequestsResponseToJSON( + flagConfigApprovalRequestsResponse: FlagConfigApprovalRequestsResponse, +): string { + return JSON.stringify( + FlagConfigApprovalRequestsResponse$outboundSchema.parse( + flagConfigApprovalRequestsResponse, + ), + ); +} +export function flagConfigApprovalRequestsResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + FlagConfigApprovalRequestsResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'FlagConfigApprovalRequestsResponse' from JSON`, + ); +} diff --git a/src/models/components/flaglistingrep.ts b/src/models/components/flaglistingrep.ts new file mode 100644 index 00000000..de27c71e --- /dev/null +++ b/src/models/components/flaglistingrep.ts @@ -0,0 +1,82 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + Link, + Link$inboundSchema, + Link$Outbound, + Link$outboundSchema, +} from "./link.js"; + +export type FlagListingRep = { + /** + * The flag name + */ + name: string; + /** + * The flag key + */ + key: string; + links?: { [k: string]: Link } | undefined; + site?: Link | undefined; +}; + +/** @internal */ +export const FlagListingRep$inboundSchema: z.ZodType< + FlagListingRep, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), + key: z.string(), + _links: z.record(Link$inboundSchema).optional(), + _site: Link$inboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + "_links": "links", + "_site": "site", + }); +}); +/** @internal */ +export type FlagListingRep$Outbound = { + name: string; + key: string; + _links?: { [k: string]: Link$Outbound } | undefined; + _site?: Link$Outbound | undefined; +}; + +/** @internal */ +export const FlagListingRep$outboundSchema: z.ZodType< + FlagListingRep$Outbound, + z.ZodTypeDef, + FlagListingRep +> = z.object({ + name: z.string(), + key: z.string(), + links: z.record(Link$outboundSchema).optional(), + site: Link$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + links: "_links", + site: "_site", + }); +}); + +export function flagListingRepToJSON(flagListingRep: FlagListingRep): string { + return JSON.stringify(FlagListingRep$outboundSchema.parse(flagListingRep)); +} +export function flagListingRepFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => FlagListingRep$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'FlagListingRep' from JSON`, + ); +} diff --git a/src/models/components/index.ts b/src/models/components/index.ts index 8f2cf4a1..9723012e 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -12,6 +12,7 @@ export * from "./aiconfigdependency.js"; export * from "./aiconfigmaintainer.js"; export * from "./aiconfigpatch.js"; export * from "./aiconfigpost.js"; +export * from "./aiconfigrep.js"; export * from "./aiconfigs.js"; export * from "./aiconfigsaccess.js"; export * from "./aiconfigsaccessallowedreason.js"; @@ -52,11 +53,20 @@ export * from "./branchrep.js"; export * from "./clause.js"; export * from "./clientsideavailability.js"; export * from "./clientsideavailabilitypost.js"; +export * from "./conflict.js"; +export * from "./copiedfromenv.js"; export * from "./corelink.js"; +export * from "./createflagconfigapprovalrequestrequest.js"; export * from "./customproperty.js"; +export * from "./customworkflowmeta.js"; +export * from "./customworkflowstagemeta.js"; export * from "./defaults.js"; export * from "./environment.js"; export * from "./environments.js"; +export * from "./expandableapprovalrequestresponse.js"; +export * from "./expandableapprovalrequestsresponse.js"; +export * from "./expandedflagrep.js"; +export * from "./expandedresourcerep.js"; export * from "./experimentallocationrep.js"; export * from "./experimentenabledperiodrep.js"; export * from "./experimentenvironmentsettingrep.js"; @@ -68,12 +78,17 @@ export * from "./featureflags.js"; export * from "./featureflagstatus.js"; export * from "./featureflagstatusacrossenvironments.js"; export * from "./filter.js"; +export * from "./flagconfigapprovalrequestresponse.js"; +export * from "./flagconfigapprovalrequestsresponse.js"; export * from "./flagconfigevaluation.js"; export * from "./flagconfigmigrationsettingsrep.js"; +export * from "./flaglistingrep.js"; export * from "./flagmigrationsettingsrep.js"; export * from "./flagprerequisitepost.js"; export * from "./flagsummary.js"; export * from "./hunkrep.js"; +export * from "./integrationmetadata.js"; +export * from "./integrationstatus.js"; export * from "./judgeattachment.js"; export * from "./judgeconfiguration.js"; export * from "./legacyexperimentrep.js"; @@ -91,14 +106,22 @@ export * from "./parentandselflinks.js"; export * from "./parentlink.js"; export * from "./patchoperation.js"; export * from "./patchwithcomment.js"; +export * from "./postapprovalrequestapplyrequest.js"; +export * from "./postapprovalrequestreviewrequest.js"; export * from "./prerequisite.js"; +export * from "./project.js"; export * from "./referencerep.js"; export * from "./repositorycollectionrep.js"; export * from "./repositoryrep.js"; +export * from "./reviewresponse.js"; export * from "./rollout.js"; export * from "./rule.js"; export * from "./security.js"; +export * from "./segmentmetadata.js"; +export * from "./segmenttarget.js"; export * from "./target.js"; +export * from "./usersegment.js"; +export * from "./usersegmentrule.js"; export * from "./variation.js"; export * from "./variationorrolloutrep.js"; export * from "./variationsummary.js"; diff --git a/src/models/components/integrationmetadata.ts b/src/models/components/integrationmetadata.ts new file mode 100644 index 00000000..856b2fb8 --- /dev/null +++ b/src/models/components/integrationmetadata.ts @@ -0,0 +1,69 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + IntegrationStatus, + IntegrationStatus$inboundSchema, + IntegrationStatus$Outbound, + IntegrationStatus$outboundSchema, +} from "./integrationstatus.js"; + +export type IntegrationMetadata = { + externalId: string; + externalStatus: IntegrationStatus; + externalUrl: string; + lastChecked: number; +}; + +/** @internal */ +export const IntegrationMetadata$inboundSchema: z.ZodType< + IntegrationMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + externalId: z.string(), + externalStatus: IntegrationStatus$inboundSchema, + externalUrl: z.string(), + lastChecked: z.number().int(), +}); +/** @internal */ +export type IntegrationMetadata$Outbound = { + externalId: string; + externalStatus: IntegrationStatus$Outbound; + externalUrl: string; + lastChecked: number; +}; + +/** @internal */ +export const IntegrationMetadata$outboundSchema: z.ZodType< + IntegrationMetadata$Outbound, + z.ZodTypeDef, + IntegrationMetadata +> = z.object({ + externalId: z.string(), + externalStatus: IntegrationStatus$outboundSchema, + externalUrl: z.string(), + lastChecked: z.number().int(), +}); + +export function integrationMetadataToJSON( + integrationMetadata: IntegrationMetadata, +): string { + return JSON.stringify( + IntegrationMetadata$outboundSchema.parse(integrationMetadata), + ); +} +export function integrationMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => IntegrationMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'IntegrationMetadata' from JSON`, + ); +} diff --git a/src/models/components/integrationstatus.ts b/src/models/components/integrationstatus.ts new file mode 100644 index 00000000..b0e6e13d --- /dev/null +++ b/src/models/components/integrationstatus.ts @@ -0,0 +1,55 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type IntegrationStatus = { + display: string; + value: string; +}; + +/** @internal */ +export const IntegrationStatus$inboundSchema: z.ZodType< + IntegrationStatus, + z.ZodTypeDef, + unknown +> = z.object({ + display: z.string(), + value: z.string(), +}); +/** @internal */ +export type IntegrationStatus$Outbound = { + display: string; + value: string; +}; + +/** @internal */ +export const IntegrationStatus$outboundSchema: z.ZodType< + IntegrationStatus$Outbound, + z.ZodTypeDef, + IntegrationStatus +> = z.object({ + display: z.string(), + value: z.string(), +}); + +export function integrationStatusToJSON( + integrationStatus: IntegrationStatus, +): string { + return JSON.stringify( + IntegrationStatus$outboundSchema.parse(integrationStatus), + ); +} +export function integrationStatusFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => IntegrationStatus$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'IntegrationStatus' from JSON`, + ); +} diff --git a/src/models/components/postapprovalrequestapplyrequest.ts b/src/models/components/postapprovalrequestapplyrequest.ts new file mode 100644 index 00000000..959bdb8b --- /dev/null +++ b/src/models/components/postapprovalrequestapplyrequest.ts @@ -0,0 +1,56 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type PostApprovalRequestApplyRequest = { + /** + * Optional comment about the approval request + */ + comment?: string | undefined; +}; + +/** @internal */ +export const PostApprovalRequestApplyRequest$inboundSchema: z.ZodType< + PostApprovalRequestApplyRequest, + z.ZodTypeDef, + unknown +> = z.object({ + comment: z.string().optional(), +}); +/** @internal */ +export type PostApprovalRequestApplyRequest$Outbound = { + comment?: string | undefined; +}; + +/** @internal */ +export const PostApprovalRequestApplyRequest$outboundSchema: z.ZodType< + PostApprovalRequestApplyRequest$Outbound, + z.ZodTypeDef, + PostApprovalRequestApplyRequest +> = z.object({ + comment: z.string().optional(), +}); + +export function postApprovalRequestApplyRequestToJSON( + postApprovalRequestApplyRequest: PostApprovalRequestApplyRequest, +): string { + return JSON.stringify( + PostApprovalRequestApplyRequest$outboundSchema.parse( + postApprovalRequestApplyRequest, + ), + ); +} +export function postApprovalRequestApplyRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostApprovalRequestApplyRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostApprovalRequestApplyRequest' from JSON`, + ); +} diff --git a/src/models/components/postapprovalrequestreviewrequest.ts b/src/models/components/postapprovalrequestreviewrequest.ts new file mode 100644 index 00000000..ca9fde05 --- /dev/null +++ b/src/models/components/postapprovalrequestreviewrequest.ts @@ -0,0 +1,89 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +/** + * The type of review for this approval request + */ +export const PostApprovalRequestReviewRequestKind = { + Approve: "approve", + Comment: "comment", + Decline: "decline", +} as const; +/** + * The type of review for this approval request + */ +export type PostApprovalRequestReviewRequestKind = ClosedEnum< + typeof PostApprovalRequestReviewRequestKind +>; + +export type PostApprovalRequestReviewRequest = { + /** + * The type of review for this approval request + */ + kind?: PostApprovalRequestReviewRequestKind | undefined; + /** + * Optional comment about the approval request + */ + comment?: string | undefined; +}; + +/** @internal */ +export const PostApprovalRequestReviewRequestKind$inboundSchema: + z.ZodNativeEnum = z.nativeEnum( + PostApprovalRequestReviewRequestKind, + ); +/** @internal */ +export const PostApprovalRequestReviewRequestKind$outboundSchema: + z.ZodNativeEnum = + PostApprovalRequestReviewRequestKind$inboundSchema; + +/** @internal */ +export const PostApprovalRequestReviewRequest$inboundSchema: z.ZodType< + PostApprovalRequestReviewRequest, + z.ZodTypeDef, + unknown +> = z.object({ + kind: PostApprovalRequestReviewRequestKind$inboundSchema.optional(), + comment: z.string().optional(), +}); +/** @internal */ +export type PostApprovalRequestReviewRequest$Outbound = { + kind?: string | undefined; + comment?: string | undefined; +}; + +/** @internal */ +export const PostApprovalRequestReviewRequest$outboundSchema: z.ZodType< + PostApprovalRequestReviewRequest$Outbound, + z.ZodTypeDef, + PostApprovalRequestReviewRequest +> = z.object({ + kind: PostApprovalRequestReviewRequestKind$outboundSchema.optional(), + comment: z.string().optional(), +}); + +export function postApprovalRequestReviewRequestToJSON( + postApprovalRequestReviewRequest: PostApprovalRequestReviewRequest, +): string { + return JSON.stringify( + PostApprovalRequestReviewRequest$outboundSchema.parse( + postApprovalRequestReviewRequest, + ), + ); +} +export function postApprovalRequestReviewRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostApprovalRequestReviewRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostApprovalRequestReviewRequest' from JSON`, + ); +} diff --git a/src/models/components/project.ts b/src/models/components/project.ts new file mode 100644 index 00000000..5b2e7481 --- /dev/null +++ b/src/models/components/project.ts @@ -0,0 +1,140 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + Access, + Access$inboundSchema, + Access$Outbound, + Access$outboundSchema, +} from "./access.js"; +import { + ClientSideAvailability, + ClientSideAvailability$inboundSchema, + ClientSideAvailability$Outbound, + ClientSideAvailability$outboundSchema, +} from "./clientsideavailability.js"; +import { + Environments, + Environments$inboundSchema, + Environments$Outbound, + Environments$outboundSchema, +} from "./environments.js"; +import { + Link, + Link$inboundSchema, + Link$Outbound, + Link$outboundSchema, +} from "./link.js"; + +export type Project = { + /** + * The location and content type of related resources + */ + links: { [k: string]: Link }; + /** + * The ID of this project + */ + id: string; + /** + * The key of this project + */ + key: string; + /** + * Whether or not flags created in this project are made available to the client-side JavaScript SDK by default + */ + includeInSnippetByDefault: boolean; + defaultClientSideAvailability?: ClientSideAvailability | undefined; + /** + * A human-friendly name for the project + */ + name: string; + access?: Access | undefined; + /** + * A list of tags for the project + */ + tags: Array; + /** + * The key of the default release pipeline for this project + */ + defaultReleasePipelineKey?: string | undefined; + environments?: Environments | undefined; +}; + +/** @internal */ +export const Project$inboundSchema: z.ZodType = + z.object({ + _links: z.record(Link$inboundSchema), + _id: z.string(), + key: z.string(), + includeInSnippetByDefault: z.boolean(), + defaultClientSideAvailability: ClientSideAvailability$inboundSchema + .optional(), + name: z.string(), + _access: Access$inboundSchema.optional(), + tags: z.array(z.string()), + defaultReleasePipelineKey: z.string().optional(), + environments: Environments$inboundSchema.optional(), + }).transform((v) => { + return remap$(v, { + "_links": "links", + "_id": "id", + "_access": "access", + }); + }); +/** @internal */ +export type Project$Outbound = { + _links: { [k: string]: Link$Outbound }; + _id: string; + key: string; + includeInSnippetByDefault: boolean; + defaultClientSideAvailability?: ClientSideAvailability$Outbound | undefined; + name: string; + _access?: Access$Outbound | undefined; + tags: Array; + defaultReleasePipelineKey?: string | undefined; + environments?: Environments$Outbound | undefined; +}; + +/** @internal */ +export const Project$outboundSchema: z.ZodType< + Project$Outbound, + z.ZodTypeDef, + Project +> = z.object({ + links: z.record(Link$outboundSchema), + id: z.string(), + key: z.string(), + includeInSnippetByDefault: z.boolean(), + defaultClientSideAvailability: ClientSideAvailability$outboundSchema + .optional(), + name: z.string(), + access: Access$outboundSchema.optional(), + tags: z.array(z.string()), + defaultReleasePipelineKey: z.string().optional(), + environments: Environments$outboundSchema.optional(), +}).transform((v) => { + return remap$(v, { + links: "_links", + id: "_id", + access: "_access", + }); +}); + +export function projectToJSON(project: Project): string { + return JSON.stringify(Project$outboundSchema.parse(project)); +} +export function projectFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => Project$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'Project' from JSON`, + ); +} diff --git a/src/models/components/reviewresponse.ts b/src/models/components/reviewresponse.ts new file mode 100644 index 00000000..1c62fdd8 --- /dev/null +++ b/src/models/components/reviewresponse.ts @@ -0,0 +1,114 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +/** + * The type of review action to take + */ +export const ReviewResponseKind = { + Approve: "approve", + Decline: "decline", + Comment: "comment", +} as const; +/** + * The type of review action to take + */ +export type ReviewResponseKind = ClosedEnum; + +export type ReviewResponse = { + /** + * The approval request ID + */ + id: string; + /** + * The type of review action to take + */ + kind: ReviewResponseKind; + creationDate?: number | undefined; + /** + * A comment describing the approval response + */ + comment?: string | undefined; + /** + * ID of account member that reviewed request + */ + memberId?: string | undefined; + /** + * ID of account service token that reviewed request + */ + serviceTokenId?: string | undefined; +}; + +/** @internal */ +export const ReviewResponseKind$inboundSchema: z.ZodNativeEnum< + typeof ReviewResponseKind +> = z.nativeEnum(ReviewResponseKind); +/** @internal */ +export const ReviewResponseKind$outboundSchema: z.ZodNativeEnum< + typeof ReviewResponseKind +> = ReviewResponseKind$inboundSchema; + +/** @internal */ +export const ReviewResponse$inboundSchema: z.ZodType< + ReviewResponse, + z.ZodTypeDef, + unknown +> = z.object({ + _id: z.string(), + kind: ReviewResponseKind$inboundSchema, + creationDate: z.number().int().optional(), + comment: z.string().optional(), + memberId: z.string().optional(), + serviceTokenId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "_id": "id", + }); +}); +/** @internal */ +export type ReviewResponse$Outbound = { + _id: string; + kind: string; + creationDate?: number | undefined; + comment?: string | undefined; + memberId?: string | undefined; + serviceTokenId?: string | undefined; +}; + +/** @internal */ +export const ReviewResponse$outboundSchema: z.ZodType< + ReviewResponse$Outbound, + z.ZodTypeDef, + ReviewResponse +> = z.object({ + id: z.string(), + kind: ReviewResponseKind$outboundSchema, + creationDate: z.number().int().optional(), + comment: z.string().optional(), + memberId: z.string().optional(), + serviceTokenId: z.string().optional(), +}).transform((v) => { + return remap$(v, { + id: "_id", + }); +}); + +export function reviewResponseToJSON(reviewResponse: ReviewResponse): string { + return JSON.stringify(ReviewResponse$outboundSchema.parse(reviewResponse)); +} +export function reviewResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ReviewResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ReviewResponse' from JSON`, + ); +} diff --git a/src/models/components/segmentmetadata.ts b/src/models/components/segmentmetadata.ts new file mode 100644 index 00000000..c4cf8aa5 --- /dev/null +++ b/src/models/components/segmentmetadata.ts @@ -0,0 +1,73 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type SegmentMetadata = { + envId?: string | undefined; + segmentId?: string | undefined; + version?: number | undefined; + includedCount?: number | undefined; + excludedCount?: number | undefined; + lastModified?: number | undefined; + deleted?: boolean | undefined; +}; + +/** @internal */ +export const SegmentMetadata$inboundSchema: z.ZodType< + SegmentMetadata, + z.ZodTypeDef, + unknown +> = z.object({ + envId: z.string().optional(), + segmentId: z.string().optional(), + version: z.number().int().optional(), + includedCount: z.number().int().optional(), + excludedCount: z.number().int().optional(), + lastModified: z.number().int().optional(), + deleted: z.boolean().optional(), +}); +/** @internal */ +export type SegmentMetadata$Outbound = { + envId?: string | undefined; + segmentId?: string | undefined; + version?: number | undefined; + includedCount?: number | undefined; + excludedCount?: number | undefined; + lastModified?: number | undefined; + deleted?: boolean | undefined; +}; + +/** @internal */ +export const SegmentMetadata$outboundSchema: z.ZodType< + SegmentMetadata$Outbound, + z.ZodTypeDef, + SegmentMetadata +> = z.object({ + envId: z.string().optional(), + segmentId: z.string().optional(), + version: z.number().int().optional(), + includedCount: z.number().int().optional(), + excludedCount: z.number().int().optional(), + lastModified: z.number().int().optional(), + deleted: z.boolean().optional(), +}); + +export function segmentMetadataToJSON( + segmentMetadata: SegmentMetadata, +): string { + return JSON.stringify(SegmentMetadata$outboundSchema.parse(segmentMetadata)); +} +export function segmentMetadataFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SegmentMetadata$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SegmentMetadata' from JSON`, + ); +} diff --git a/src/models/components/segmenttarget.ts b/src/models/components/segmenttarget.ts new file mode 100644 index 00000000..9d8bcc42 --- /dev/null +++ b/src/models/components/segmenttarget.ts @@ -0,0 +1,51 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type SegmentTarget = { + values?: Array | undefined; + contextKind?: string | undefined; +}; + +/** @internal */ +export const SegmentTarget$inboundSchema: z.ZodType< + SegmentTarget, + z.ZodTypeDef, + unknown +> = z.object({ + values: z.array(z.string()).optional(), + contextKind: z.string().optional(), +}); +/** @internal */ +export type SegmentTarget$Outbound = { + values?: Array | undefined; + contextKind?: string | undefined; +}; + +/** @internal */ +export const SegmentTarget$outboundSchema: z.ZodType< + SegmentTarget$Outbound, + z.ZodTypeDef, + SegmentTarget +> = z.object({ + values: z.array(z.string()).optional(), + contextKind: z.string().optional(), +}); + +export function segmentTargetToJSON(segmentTarget: SegmentTarget): string { + return JSON.stringify(SegmentTarget$outboundSchema.parse(segmentTarget)); +} +export function segmentTargetFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => SegmentTarget$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'SegmentTarget' from JSON`, + ); +} diff --git a/src/models/components/usersegment.ts b/src/models/components/usersegment.ts new file mode 100644 index 00000000..3467db04 --- /dev/null +++ b/src/models/components/usersegment.ts @@ -0,0 +1,243 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + Access, + Access$inboundSchema, + Access$Outbound, + Access$outboundSchema, +} from "./access.js"; +import { + FlagListingRep, + FlagListingRep$inboundSchema, + FlagListingRep$Outbound, + FlagListingRep$outboundSchema, +} from "./flaglistingrep.js"; +import { + Link, + Link$inboundSchema, + Link$Outbound, + Link$outboundSchema, +} from "./link.js"; +import { + SegmentMetadata, + SegmentMetadata$inboundSchema, + SegmentMetadata$Outbound, + SegmentMetadata$outboundSchema, +} from "./segmentmetadata.js"; +import { + SegmentTarget, + SegmentTarget$inboundSchema, + SegmentTarget$Outbound, + SegmentTarget$outboundSchema, +} from "./segmenttarget.js"; +import { + UserSegmentRule, + UserSegmentRule$inboundSchema, + UserSegmentRule$Outbound, + UserSegmentRule$outboundSchema, +} from "./usersegmentrule.js"; + +export type UserSegment = { + /** + * A human-friendly name for the segment. + */ + name: string; + /** + * A description of the segment's purpose. Defaults to null and is omitted in the response if not provided. + */ + description?: string | undefined; + /** + * Tags for the segment. Defaults to an empty array. + */ + tags: Array; + creationDate: number; + lastModifiedDate: number; + /** + * A unique key used to reference the segment + */ + key: string; + /** + * An array of keys for included targets. Included individual targets are always segment members, regardless of segment rules. For list-based segments over 15,000 entries, also called big segments, this array is either empty or omitted. + */ + included?: Array | undefined; + /** + * An array of keys for excluded targets. Segment rules bypass individual excluded targets, so they will never be included based on rules. Excluded targets may still be included explicitly. This value is omitted for list-based segments over 15,000 entries, also called big segments. + */ + excluded?: Array | undefined; + includedContexts?: Array | undefined; + excludedContexts?: Array | undefined; + /** + * The location and content type of related resources + */ + links: { [k: string]: Link }; + /** + * An array of the targeting rules for this segment. + */ + rules: Array; + /** + * Version of the segment + */ + version: number; + /** + * Whether the segment has been deleted + */ + deleted: boolean; + access?: Access | undefined; + /** + * A list of flags targeting this segment. Only included when getting a single segment, using the getSegment endpoint. + */ + flags?: Array | undefined; + /** + * Whether this is a standard segment (false) or a big segment (true). Standard segments include rule-based segments and smaller list-based segments. Big segments include larger list-based segments and synced segments. If omitted, the segment is a standard segment. + */ + unbounded?: boolean | undefined; + /** + * For big segments, the targeted context kind. + */ + unboundedContextKind?: string | undefined; + /** + * For big segments, how many times this segment has been created. + */ + generation: number; + unboundedMetadata?: SegmentMetadata | undefined; + /** + * The external data store backing this segment. Only applies to synced segments. + */ + external?: string | undefined; + /** + * The URL for the external data store backing this segment. Only applies to synced segments. + */ + externalLink?: string | undefined; + /** + * Whether an import is currently in progress for the specified segment. Only applies to big segments. + */ + importInProgress?: boolean | undefined; +}; + +/** @internal */ +export const UserSegment$inboundSchema: z.ZodType< + UserSegment, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), + description: z.string().optional(), + tags: z.array(z.string()), + creationDate: z.number().int(), + lastModifiedDate: z.number().int(), + key: z.string(), + included: z.array(z.string()).optional(), + excluded: z.array(z.string()).optional(), + includedContexts: z.array(SegmentTarget$inboundSchema).optional(), + excludedContexts: z.array(SegmentTarget$inboundSchema).optional(), + _links: z.record(Link$inboundSchema), + rules: z.array(UserSegmentRule$inboundSchema), + version: z.number().int(), + deleted: z.boolean(), + _access: Access$inboundSchema.optional(), + _flags: z.array(FlagListingRep$inboundSchema).optional(), + unbounded: z.boolean().optional(), + unboundedContextKind: z.string().optional(), + generation: z.number().int(), + _unboundedMetadata: SegmentMetadata$inboundSchema.optional(), + _external: z.string().optional(), + _externalLink: z.string().optional(), + _importInProgress: z.boolean().optional(), +}).transform((v) => { + return remap$(v, { + "_links": "links", + "_access": "access", + "_flags": "flags", + "_unboundedMetadata": "unboundedMetadata", + "_external": "external", + "_externalLink": "externalLink", + "_importInProgress": "importInProgress", + }); +}); +/** @internal */ +export type UserSegment$Outbound = { + name: string; + description?: string | undefined; + tags: Array; + creationDate: number; + lastModifiedDate: number; + key: string; + included?: Array | undefined; + excluded?: Array | undefined; + includedContexts?: Array | undefined; + excludedContexts?: Array | undefined; + _links: { [k: string]: Link$Outbound }; + rules: Array; + version: number; + deleted: boolean; + _access?: Access$Outbound | undefined; + _flags?: Array | undefined; + unbounded?: boolean | undefined; + unboundedContextKind?: string | undefined; + generation: number; + _unboundedMetadata?: SegmentMetadata$Outbound | undefined; + _external?: string | undefined; + _externalLink?: string | undefined; + _importInProgress?: boolean | undefined; +}; + +/** @internal */ +export const UserSegment$outboundSchema: z.ZodType< + UserSegment$Outbound, + z.ZodTypeDef, + UserSegment +> = z.object({ + name: z.string(), + description: z.string().optional(), + tags: z.array(z.string()), + creationDate: z.number().int(), + lastModifiedDate: z.number().int(), + key: z.string(), + included: z.array(z.string()).optional(), + excluded: z.array(z.string()).optional(), + includedContexts: z.array(SegmentTarget$outboundSchema).optional(), + excludedContexts: z.array(SegmentTarget$outboundSchema).optional(), + links: z.record(Link$outboundSchema), + rules: z.array(UserSegmentRule$outboundSchema), + version: z.number().int(), + deleted: z.boolean(), + access: Access$outboundSchema.optional(), + flags: z.array(FlagListingRep$outboundSchema).optional(), + unbounded: z.boolean().optional(), + unboundedContextKind: z.string().optional(), + generation: z.number().int(), + unboundedMetadata: SegmentMetadata$outboundSchema.optional(), + external: z.string().optional(), + externalLink: z.string().optional(), + importInProgress: z.boolean().optional(), +}).transform((v) => { + return remap$(v, { + links: "_links", + access: "_access", + flags: "_flags", + unboundedMetadata: "_unboundedMetadata", + external: "_external", + externalLink: "_externalLink", + importInProgress: "_importInProgress", + }); +}); + +export function userSegmentToJSON(userSegment: UserSegment): string { + return JSON.stringify(UserSegment$outboundSchema.parse(userSegment)); +} +export function userSegmentFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UserSegment$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UserSegment' from JSON`, + ); +} diff --git a/src/models/components/usersegmentrule.ts b/src/models/components/usersegmentrule.ts new file mode 100644 index 00000000..6197af23 --- /dev/null +++ b/src/models/components/usersegmentrule.ts @@ -0,0 +1,84 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + Clause, + Clause$inboundSchema, + Clause$Outbound, + Clause$outboundSchema, +} from "./clause.js"; + +export type UserSegmentRule = { + id?: string | undefined; + clauses: Array; + weight?: number | undefined; + rolloutContextKind?: string | undefined; + bucketBy?: string | undefined; + description?: string | undefined; +}; + +/** @internal */ +export const UserSegmentRule$inboundSchema: z.ZodType< + UserSegmentRule, + z.ZodTypeDef, + unknown +> = z.object({ + _id: z.string().optional(), + clauses: z.array(Clause$inboundSchema), + weight: z.number().int().optional(), + rolloutContextKind: z.string().optional(), + bucketBy: z.string().optional(), + description: z.string().optional(), +}).transform((v) => { + return remap$(v, { + "_id": "id", + }); +}); +/** @internal */ +export type UserSegmentRule$Outbound = { + _id?: string | undefined; + clauses: Array; + weight?: number | undefined; + rolloutContextKind?: string | undefined; + bucketBy?: string | undefined; + description?: string | undefined; +}; + +/** @internal */ +export const UserSegmentRule$outboundSchema: z.ZodType< + UserSegmentRule$Outbound, + z.ZodTypeDef, + UserSegmentRule +> = z.object({ + id: z.string().optional(), + clauses: z.array(Clause$outboundSchema), + weight: z.number().int().optional(), + rolloutContextKind: z.string().optional(), + bucketBy: z.string().optional(), + description: z.string().optional(), +}).transform((v) => { + return remap$(v, { + id: "_id", + }); +}); + +export function userSegmentRuleToJSON( + userSegmentRule: UserSegmentRule, +): string { + return JSON.stringify(UserSegmentRule$outboundSchema.parse(userSegmentRule)); +} +export function userSegmentRuleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UserSegmentRule$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UserSegmentRule' from JSON`, + ); +} diff --git a/src/models/operations/deleteapprovalrequestforflag.ts b/src/models/operations/deleteapprovalrequestforflag.ts new file mode 100644 index 00000000..8e04748e --- /dev/null +++ b/src/models/operations/deleteapprovalrequestforflag.ts @@ -0,0 +1,78 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type DeleteApprovalRequestForFlagRequest = { + /** + * The project key + */ + projectKey: string; + /** + * The feature flag key + */ + featureFlagKey: string; + /** + * The environment key + */ + environmentKey: string; + /** + * The feature flag approval request ID + */ + id: string; +}; + +/** @internal */ +export const DeleteApprovalRequestForFlagRequest$inboundSchema: z.ZodType< + DeleteApprovalRequestForFlagRequest, + z.ZodTypeDef, + unknown +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), + id: z.string(), +}); +/** @internal */ +export type DeleteApprovalRequestForFlagRequest$Outbound = { + projectKey: string; + featureFlagKey: string; + environmentKey: string; + id: string; +}; + +/** @internal */ +export const DeleteApprovalRequestForFlagRequest$outboundSchema: z.ZodType< + DeleteApprovalRequestForFlagRequest$Outbound, + z.ZodTypeDef, + DeleteApprovalRequestForFlagRequest +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), + id: z.string(), +}); + +export function deleteApprovalRequestForFlagRequestToJSON( + deleteApprovalRequestForFlagRequest: DeleteApprovalRequestForFlagRequest, +): string { + return JSON.stringify( + DeleteApprovalRequestForFlagRequest$outboundSchema.parse( + deleteApprovalRequestForFlagRequest, + ), + ); +} +export function deleteApprovalRequestForFlagRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + DeleteApprovalRequestForFlagRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteApprovalRequestForFlagRequest' from JSON`, + ); +} diff --git a/src/models/operations/getapprovalforflag.ts b/src/models/operations/getapprovalforflag.ts new file mode 100644 index 00000000..6f244fe9 --- /dev/null +++ b/src/models/operations/getapprovalforflag.ts @@ -0,0 +1,75 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetApprovalForFlagRequest = { + /** + * The project key + */ + projectKey: string; + /** + * The feature flag key + */ + featureFlagKey: string; + /** + * The environment key + */ + environmentKey: string; + /** + * The feature flag approval request ID + */ + id: string; +}; + +/** @internal */ +export const GetApprovalForFlagRequest$inboundSchema: z.ZodType< + GetApprovalForFlagRequest, + z.ZodTypeDef, + unknown +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), + id: z.string(), +}); +/** @internal */ +export type GetApprovalForFlagRequest$Outbound = { + projectKey: string; + featureFlagKey: string; + environmentKey: string; + id: string; +}; + +/** @internal */ +export const GetApprovalForFlagRequest$outboundSchema: z.ZodType< + GetApprovalForFlagRequest$Outbound, + z.ZodTypeDef, + GetApprovalForFlagRequest +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), + id: z.string(), +}); + +export function getApprovalForFlagRequestToJSON( + getApprovalForFlagRequest: GetApprovalForFlagRequest, +): string { + return JSON.stringify( + GetApprovalForFlagRequest$outboundSchema.parse(getApprovalForFlagRequest), + ); +} +export function getApprovalForFlagRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetApprovalForFlagRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetApprovalForFlagRequest' from JSON`, + ); +} diff --git a/src/models/operations/getapprovalrequests.ts b/src/models/operations/getapprovalrequests.ts new file mode 100644 index 00000000..5140d873 --- /dev/null +++ b/src/models/operations/getapprovalrequests.ts @@ -0,0 +1,75 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetApprovalRequestsRequest = { + /** + * A comma-separated list of filters. Each filter is of the form `field operator value`. Supported fields are explained above. + */ + filter?: string | undefined; + /** + * A comma-separated list of fields to expand in the response. Supported fields are explained above. + */ + expand?: string | undefined; + /** + * The number of approvals to return. Defaults to 20. Maximum limit is 200. + */ + limit?: number | undefined; + /** + * Where to start in the list. Use this with pagination. For example, an offset of 10 skips the first ten items and then returns the next items in the list, up to the query `limit`. + */ + offset?: number | undefined; +}; + +/** @internal */ +export const GetApprovalRequestsRequest$inboundSchema: z.ZodType< + GetApprovalRequestsRequest, + z.ZodTypeDef, + unknown +> = z.object({ + filter: z.string().optional(), + expand: z.string().optional(), + limit: z.number().int().optional(), + offset: z.number().int().optional(), +}); +/** @internal */ +export type GetApprovalRequestsRequest$Outbound = { + filter?: string | undefined; + expand?: string | undefined; + limit?: number | undefined; + offset?: number | undefined; +}; + +/** @internal */ +export const GetApprovalRequestsRequest$outboundSchema: z.ZodType< + GetApprovalRequestsRequest$Outbound, + z.ZodTypeDef, + GetApprovalRequestsRequest +> = z.object({ + filter: z.string().optional(), + expand: z.string().optional(), + limit: z.number().int().optional(), + offset: z.number().int().optional(), +}); + +export function getApprovalRequestsRequestToJSON( + getApprovalRequestsRequest: GetApprovalRequestsRequest, +): string { + return JSON.stringify( + GetApprovalRequestsRequest$outboundSchema.parse(getApprovalRequestsRequest), + ); +} +export function getApprovalRequestsRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetApprovalRequestsRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetApprovalRequestsRequest' from JSON`, + ); +} diff --git a/src/models/operations/getapprovalsforflag.ts b/src/models/operations/getapprovalsforflag.ts new file mode 100644 index 00000000..717cdcce --- /dev/null +++ b/src/models/operations/getapprovalsforflag.ts @@ -0,0 +1,68 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetApprovalsForFlagRequest = { + /** + * The project key + */ + projectKey: string; + /** + * The feature flag key + */ + featureFlagKey: string; + /** + * The environment key + */ + environmentKey: string; +}; + +/** @internal */ +export const GetApprovalsForFlagRequest$inboundSchema: z.ZodType< + GetApprovalsForFlagRequest, + z.ZodTypeDef, + unknown +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), +}); +/** @internal */ +export type GetApprovalsForFlagRequest$Outbound = { + projectKey: string; + featureFlagKey: string; + environmentKey: string; +}; + +/** @internal */ +export const GetApprovalsForFlagRequest$outboundSchema: z.ZodType< + GetApprovalsForFlagRequest$Outbound, + z.ZodTypeDef, + GetApprovalsForFlagRequest +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), +}); + +export function getApprovalsForFlagRequestToJSON( + getApprovalsForFlagRequest: GetApprovalsForFlagRequest, +): string { + return JSON.stringify( + GetApprovalsForFlagRequest$outboundSchema.parse(getApprovalsForFlagRequest), + ); +} +export function getApprovalsForFlagRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetApprovalsForFlagRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetApprovalsForFlagRequest' from JSON`, + ); +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index ae336a99..69fe7d30 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -4,11 +4,15 @@ export * from "./deleteaiconfig.js"; export * from "./deleteaiconfigvariation.js"; +export * from "./deleteapprovalrequestforflag.js"; export * from "./deletefeatureflag.js"; export * from "./getaiconfig.js"; export * from "./getaiconfigs.js"; export * from "./getaiconfigtargeting.js"; export * from "./getaiconfigvariation.js"; +export * from "./getapprovalforflag.js"; +export * from "./getapprovalrequests.js"; +export * from "./getapprovalsforflag.js"; export * from "./getenvironmentsbyproject.js"; export * from "./getfeatureflag.js"; export * from "./getfeatureflags.js"; @@ -20,4 +24,7 @@ export * from "./patchaiconfigvariation.js"; export * from "./patchfeatureflag.js"; export * from "./postaiconfig.js"; export * from "./postaiconfigvariation.js"; +export * from "./postapprovalrequestapplyforflag.js"; +export * from "./postapprovalrequestforflag.js"; +export * from "./postapprovalrequestreviewforflag.js"; export * from "./postfeatureflag.js"; diff --git a/src/models/operations/postapprovalrequestapplyforflag.ts b/src/models/operations/postapprovalrequestapplyforflag.ts new file mode 100644 index 00000000..ac4920eb --- /dev/null +++ b/src/models/operations/postapprovalrequestapplyforflag.ts @@ -0,0 +1,87 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type PostApprovalRequestApplyForFlagRequest = { + /** + * The project key + */ + projectKey: string; + /** + * The feature flag key + */ + featureFlagKey: string; + /** + * The environment key + */ + environmentKey: string; + /** + * The feature flag approval request ID + */ + id: string; + postApprovalRequestApplyRequest: components.PostApprovalRequestApplyRequest; +}; + +/** @internal */ +export const PostApprovalRequestApplyForFlagRequest$inboundSchema: z.ZodType< + PostApprovalRequestApplyForFlagRequest, + z.ZodTypeDef, + unknown +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), + id: z.string(), + postApprovalRequestApplyRequest: + components.PostApprovalRequestApplyRequest$inboundSchema, +}); +/** @internal */ +export type PostApprovalRequestApplyForFlagRequest$Outbound = { + projectKey: string; + featureFlagKey: string; + environmentKey: string; + id: string; + postApprovalRequestApplyRequest: + components.PostApprovalRequestApplyRequest$Outbound; +}; + +/** @internal */ +export const PostApprovalRequestApplyForFlagRequest$outboundSchema: z.ZodType< + PostApprovalRequestApplyForFlagRequest$Outbound, + z.ZodTypeDef, + PostApprovalRequestApplyForFlagRequest +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), + id: z.string(), + postApprovalRequestApplyRequest: + components.PostApprovalRequestApplyRequest$outboundSchema, +}); + +export function postApprovalRequestApplyForFlagRequestToJSON( + postApprovalRequestApplyForFlagRequest: + PostApprovalRequestApplyForFlagRequest, +): string { + return JSON.stringify( + PostApprovalRequestApplyForFlagRequest$outboundSchema.parse( + postApprovalRequestApplyForFlagRequest, + ), + ); +} +export function postApprovalRequestApplyForFlagRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => + PostApprovalRequestApplyForFlagRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostApprovalRequestApplyForFlagRequest' from JSON`, + ); +} diff --git a/src/models/operations/postapprovalrequestforflag.ts b/src/models/operations/postapprovalrequestforflag.ts new file mode 100644 index 00000000..c9987cb5 --- /dev/null +++ b/src/models/operations/postapprovalrequestforflag.ts @@ -0,0 +1,79 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type PostApprovalRequestForFlagRequest = { + /** + * The project key + */ + projectKey: string; + /** + * The feature flag key + */ + featureFlagKey: string; + /** + * The environment key + */ + environmentKey: string; + createFlagConfigApprovalRequestRequest: + components.CreateFlagConfigApprovalRequestRequest; +}; + +/** @internal */ +export const PostApprovalRequestForFlagRequest$inboundSchema: z.ZodType< + PostApprovalRequestForFlagRequest, + z.ZodTypeDef, + unknown +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), + createFlagConfigApprovalRequestRequest: + components.CreateFlagConfigApprovalRequestRequest$inboundSchema, +}); +/** @internal */ +export type PostApprovalRequestForFlagRequest$Outbound = { + projectKey: string; + featureFlagKey: string; + environmentKey: string; + createFlagConfigApprovalRequestRequest: + components.CreateFlagConfigApprovalRequestRequest$Outbound; +}; + +/** @internal */ +export const PostApprovalRequestForFlagRequest$outboundSchema: z.ZodType< + PostApprovalRequestForFlagRequest$Outbound, + z.ZodTypeDef, + PostApprovalRequestForFlagRequest +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), + createFlagConfigApprovalRequestRequest: + components.CreateFlagConfigApprovalRequestRequest$outboundSchema, +}); + +export function postApprovalRequestForFlagRequestToJSON( + postApprovalRequestForFlagRequest: PostApprovalRequestForFlagRequest, +): string { + return JSON.stringify( + PostApprovalRequestForFlagRequest$outboundSchema.parse( + postApprovalRequestForFlagRequest, + ), + ); +} +export function postApprovalRequestForFlagRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PostApprovalRequestForFlagRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PostApprovalRequestForFlagRequest' from JSON`, + ); +} diff --git a/src/models/operations/postapprovalrequestreviewforflag.ts b/src/models/operations/postapprovalrequestreviewforflag.ts new file mode 100644 index 00000000..856bf91e --- /dev/null +++ b/src/models/operations/postapprovalrequestreviewforflag.ts @@ -0,0 +1,92 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v3"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type PostApprovalRequestReviewForFlagRequest = { + /** + * The project key + */ + projectKey: string; + /** + * The feature flag key + */ + featureFlagKey: string; + /** + * The environment key + */ + environmentKey: string; + /** + * The feature flag approval request ID + */ + id: string; + postApprovalRequestReviewRequest: components.PostApprovalRequestReviewRequest; +}; + +/** @internal */ +export const PostApprovalRequestReviewForFlagRequest$inboundSchema: z.ZodType< + PostApprovalRequestReviewForFlagRequest, + z.ZodTypeDef, + unknown +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), + id: z.string(), + postApprovalRequestReviewRequest: + components.PostApprovalRequestReviewRequest$inboundSchema, +}); +/** @internal */ +export type PostApprovalRequestReviewForFlagRequest$Outbound = { + projectKey: string; + featureFlagKey: string; + environmentKey: string; + id: string; + postApprovalRequestReviewRequest: + components.PostApprovalRequestReviewRequest$Outbound; +}; + +/** @internal */ +export const PostApprovalRequestReviewForFlagRequest$outboundSchema: z.ZodType< + PostApprovalRequestReviewForFlagRequest$Outbound, + z.ZodTypeDef, + PostApprovalRequestReviewForFlagRequest +> = z.object({ + projectKey: z.string(), + featureFlagKey: z.string(), + environmentKey: z.string(), + id: z.string(), + postApprovalRequestReviewRequest: + components.PostApprovalRequestReviewRequest$outboundSchema, +}); + +export function postApprovalRequestReviewForFlagRequestToJSON( + postApprovalRequestReviewForFlagRequest: + PostApprovalRequestReviewForFlagRequest, +): string { + return JSON.stringify( + PostApprovalRequestReviewForFlagRequest$outboundSchema.parse( + postApprovalRequestReviewForFlagRequest, + ), + ); +} +export function postApprovalRequestReviewForFlagRequestFromJSON( + jsonString: string, +): SafeParseResult< + PostApprovalRequestReviewForFlagRequest, + SDKValidationError +> { + return safeParse( + jsonString, + (x) => + PostApprovalRequestReviewForFlagRequest$inboundSchema.parse( + JSON.parse(x), + ), + `Failed to parse 'PostApprovalRequestReviewForFlagRequest' from JSON`, + ); +} diff --git a/src/sdk/approvals.ts b/src/sdk/approvals.ts new file mode 100644 index 00000000..bd079fcd --- /dev/null +++ b/src/sdk/approvals.ts @@ -0,0 +1,159 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { approvalsApplyRequest } from "../funcs/approvalsApplyRequest.js"; +import { approvalsCreateRequest } from "../funcs/approvalsCreateRequest.js"; +import { approvalsDeleteFlagRequest } from "../funcs/approvalsDeleteFlagRequest.js"; +import { approvalsGetForFlag } from "../funcs/approvalsGetForFlag.js"; +import { approvalsList } from "../funcs/approvalsList.js"; +import { approvalsListForFlag } from "../funcs/approvalsListForFlag.js"; +import { approvalsReviewFlagRequest } from "../funcs/approvalsReviewFlagRequest.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Approvals extends ClientSDK { + /** + * List approval requests + * + * @remarks + * Get all approval requests. + * + * ### Filtering approvals + * + * LaunchDarkly supports the `filter` query param for filtering, with the following fields: + * + * - `notifyMemberIds` filters for only approvals that are assigned to a member in the specified list. For example: `filter=notifyMemberIds anyOf ["memberId1", "memberId2"]`. + * - `requestorId` filters for only approvals that correspond to the ID of the member who requested the approval. For example: `filter=requestorId equals 457034721476302714390214`. + * - `resourceId` filters for only approvals that correspond to the the specified resource identifier. For example: `filter=resourceId equals proj/my-project:env/my-environment:flag/my-flag`. + * - `resourceKind` filters for only approvals that correspond to the specified resource kind. For example: `filter=resourceKind equals flag`. Currently, `flag`, `segment`, and `aiConfig` resource kinds are supported. + * - `reviewStatus` filters for only approvals which correspond to the review status in the specified list. The possible values are `approved`, `declined`, and `pending`. For example: `filter=reviewStatus anyOf ["pending", "approved"]`. + * - `status` filters for only approvals which correspond to the status in the specified list. The possible values are `pending`, `scheduled`, `failed`, and `completed`. For example: `filter=status anyOf ["pending", "scheduled"]`. + * + * You can also apply multiple filters at once. For example, setting `filter=projectKey equals my-project, reviewStatus anyOf ["pending","approved"]` matches approval requests which correspond to the `my-project` project key, and a review status of either `pending` or `approved`. + * + * ### Expanding approval response + * + * LaunchDarkly supports the `expand` query param to include additional fields in the response, with the following fields: + * + * - `flag` includes the flag the approval request belongs to + * - `project` includes the project the approval request belongs to + * - `environments` includes the environments the approval request relates to + * + * For example, `expand=project,flag` includes the `project` and `flag` fields in the response. + */ + async list( + request: operations.GetApprovalRequestsRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(approvalsList( + this, + request, + options, + )); + } + + /** + * List approval requests for a flag + * + * @remarks + * Get all approval requests for a feature flag. + */ + async listForFlag( + request: operations.GetApprovalsForFlagRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(approvalsListForFlag( + this, + request, + options, + )); + } + + /** + * Create approval request for a flag + * + * @remarks + * Create an approval request for a feature flag. + */ + async createRequest( + request: operations.PostApprovalRequestForFlagRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(approvalsCreateRequest( + this, + request, + options, + )); + } + + /** + * Get approval request for a flag + * + * @remarks + * Get a single approval request for a feature flag. + */ + async getForFlag( + request: operations.GetApprovalForFlagRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(approvalsGetForFlag( + this, + request, + options, + )); + } + + /** + * Delete approval request for a flag + * + * @remarks + * Delete an approval request for a feature flag. + */ + async deleteFlagRequest( + request: operations.DeleteApprovalRequestForFlagRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(approvalsDeleteFlagRequest( + this, + request, + options, + )); + } + + /** + * Apply approval request for a flag + * + * @remarks + * Apply an approval request that has been approved. This endpoint requires a feature flag key, and can only be used for applying approval requests on flags. + */ + async applyRequest( + request: operations.PostApprovalRequestApplyForFlagRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(approvalsApplyRequest( + this, + request, + options, + )); + } + + /** + * Review approval request for a flag + * + * @remarks + * Review an approval request by approving or denying changes. + */ + async reviewFlagRequest( + request: operations.PostApprovalRequestReviewForFlagRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(approvalsReviewFlagRequest( + this, + request, + options, + )); + } +} diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index 0e739d4c..823e5f19 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -4,11 +4,17 @@ import { ClientSDK } from "../lib/sdks.js"; import { AiConfigs } from "./aiconfigs.js"; +import { Approvals } from "./approvals.js"; import { CodeReferences } from "./codereferences.js"; import { Environments } from "./environments.js"; import { FeatureFlags } from "./featureflags.js"; export class LaunchDarkly extends ClientSDK { + private _approvals?: Approvals; + get approvals(): Approvals { + return (this._approvals ??= new Approvals(this._options)); + } + private _codeReferences?: CodeReferences; get codeReferences(): CodeReferences { return (this._codeReferences ??= new CodeReferences(this._options));