slidge-whatsapp 0.2.6__cp312-cp312-manylinux_2_36_aarch64.whl → 0.3.0__cp312-cp312-manylinux_2_36_aarch64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of slidge-whatsapp might be problematic. Click here for more details.

Files changed (258) hide show
  1. slidge_whatsapp/contact.py +15 -3
  2. slidge_whatsapp/event.go +152 -50
  3. slidge_whatsapp/gateway.go +7 -63
  4. slidge_whatsapp/gateway.py +2 -3
  5. slidge_whatsapp/generated/_whatsapp.cpython-312-aarch64-linux-gnu.h +185 -168
  6. slidge_whatsapp/generated/_whatsapp.cpython-312-aarch64-linux-gnu.so +0 -0
  7. slidge_whatsapp/generated/build.py +149 -135
  8. slidge_whatsapp/generated/whatsapp.c +1883 -1611
  9. slidge_whatsapp/generated/whatsapp.go +1157 -1046
  10. slidge_whatsapp/generated/whatsapp.py +1326 -1201
  11. slidge_whatsapp/generated/whatsapp_go.h +185 -168
  12. slidge_whatsapp/go.mod +18 -15
  13. slidge_whatsapp/go.sum +38 -32
  14. slidge_whatsapp/group.py +34 -30
  15. slidge_whatsapp/media/media.go +6 -2
  16. slidge_whatsapp/session.go +34 -17
  17. slidge_whatsapp/session.py +46 -14
  18. slidge_whatsapp/vendor/github.com/beeper/argo-go/LICENSE +9 -0
  19. slidge_whatsapp/vendor/github.com/beeper/argo-go/block/blockreader.go +329 -0
  20. slidge_whatsapp/vendor/github.com/beeper/argo-go/block/blockwriter.go +417 -0
  21. slidge_whatsapp/vendor/github.com/beeper/argo-go/codec/decoder.go +652 -0
  22. slidge_whatsapp/vendor/github.com/beeper/argo-go/codec/encoder.go +985 -0
  23. slidge_whatsapp/vendor/github.com/beeper/argo-go/header/header.go +135 -0
  24. slidge_whatsapp/vendor/github.com/beeper/argo-go/internal/util/util.go +133 -0
  25. slidge_whatsapp/vendor/github.com/beeper/argo-go/label/label.go +384 -0
  26. slidge_whatsapp/vendor/github.com/beeper/argo-go/label/wiremarkers.go +37 -0
  27. slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/bitset/bitset.go +197 -0
  28. slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/buf/buf.go +420 -0
  29. slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/varint/varint.go +246 -0
  30. slidge_whatsapp/vendor/github.com/beeper/argo-go/wire/wire.go +614 -0
  31. slidge_whatsapp/vendor/github.com/beeper/argo-go/wirecodec/decode.go +341 -0
  32. slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/LICENSE +21 -0
  33. slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/list.go +95 -0
  34. slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/orderedmap.go +187 -0
  35. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz.go +1 -0
  36. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_cgo.go +3 -0
  37. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_nocgo.go +4 -5
  38. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_darwin.go +11 -1
  39. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_linux.go +10 -0
  40. slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_windows.go +12 -0
  41. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/.gitignore +0 -2
  42. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/CHANGELOG.md +30 -0
  43. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/COPYRIGHT.txt +6 -1
  44. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/README.md +14 -17
  45. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi.go +1 -1
  46. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi2.go +7 -0
  47. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/LICENSE +21 -0
  48. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/darwin_amd64/libffi.8.dylib +0 -0
  49. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/darwin_arm64/libffi.8.dylib +0 -0
  50. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/windows_amd64/libffi-8.dll +0 -0
  51. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/cif.go +15 -0
  52. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/cif_arm64.go +16 -0
  53. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed.go +49 -0
  54. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_darwin_amd64.go +10 -0
  55. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_darwin_arm64.go +10 -0
  56. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_windows_amd64.go +10 -0
  57. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/ffi.go +51 -13
  58. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/init.go +22 -9
  59. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/README.md +2 -0
  60. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +3096 -1651
  61. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +188 -128
  62. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go +13 -140
  63. slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h +4 -0
  64. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.23.go +2 -2
  65. slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.25.go +37 -0
  66. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/LICENSE +19 -0
  67. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/argmap.go +37 -0
  68. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/collections.go +148 -0
  69. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/comment.go +31 -0
  70. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/decode.go +216 -0
  71. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/definition.go +110 -0
  72. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/directive.go +43 -0
  73. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/document.go +89 -0
  74. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/dumper.go +159 -0
  75. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/fragment.go +41 -0
  76. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/operation.go +32 -0
  77. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/path.go +72 -0
  78. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/selection.go +41 -0
  79. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/source.go +19 -0
  80. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/type.go +68 -0
  81. slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/value.go +122 -0
  82. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/handleerrors.go +60 -26
  83. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/json.go +1 -6
  84. slidge_whatsapp/vendor/go.mau.fi/util/exhttp/networkerror.go +2 -1
  85. slidge_whatsapp/vendor/go.mau.fi/util/exstrings/stringutil.go +104 -0
  86. slidge_whatsapp/vendor/go.mau.fi/util/exsync/event.go +19 -3
  87. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/.pre-commit-config.yaml +3 -3
  88. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/decode.go +1 -1
  89. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/hash.go +1 -1
  90. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +5 -1
  91. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/argo-wire-type-store.argo +63 -0
  92. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/argo.go +62 -0
  93. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/name-to-queryids.json +306 -0
  94. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/armadillomessage.go +40 -7
  95. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/encoder.go +1 -1
  96. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/call.go +2 -1
  97. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/client.go +79 -45
  98. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/connectionevents.go +13 -6
  99. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download-to-file.go +19 -12
  100. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download.go +26 -6
  101. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/errors.go +3 -0
  102. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/group.go +99 -27
  103. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +54 -26
  104. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/keepalive.go +1 -0
  105. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +208 -57
  106. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/msgsecret.go +2 -14
  107. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/newsletter.go +83 -7
  108. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/notification.go +17 -8
  109. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair-code.go +2 -2
  110. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/presence.go +15 -6
  111. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/extra.go +7 -0
  112. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/InstamadilloAddMessage.pb.go +983 -0
  113. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/InstamadilloAddMessage.proto +85 -0
  114. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/extra.go +3 -0
  115. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeActionLog/InstamadilloCoreTypeActionLog.pb.go +197 -0
  116. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeActionLog/InstamadilloCoreTypeActionLog.proto +13 -0
  117. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeAdminMessage/InstamadilloCoreTypeAdminMessage.pb.go +279 -0
  118. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeAdminMessage/InstamadilloCoreTypeAdminMessage.proto +21 -0
  119. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeCollection/InstamadilloCoreTypeCollection.pb.go +137 -0
  120. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeCollection/InstamadilloCoreTypeCollection.proto +10 -0
  121. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeLink/InstamadilloCoreTypeLink.pb.go +313 -0
  122. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeLink/InstamadilloCoreTypeLink.proto +27 -0
  123. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeMedia/InstamadilloCoreTypeMedia.pb.go +1299 -0
  124. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeMedia/InstamadilloCoreTypeMedia.proto +112 -0
  125. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeText/InstamadilloCoreTypeText.pb.go +514 -0
  126. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeText/InstamadilloCoreTypeText.proto +47 -0
  127. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/InstamadilloDeleteMessage.pb.go +123 -0
  128. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/InstamadilloDeleteMessage.proto +7 -0
  129. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/extra.go +3 -0
  130. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/InstamadilloSupplementMessage.pb.go +720 -0
  131. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/InstamadilloSupplementMessage.proto +59 -0
  132. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/extra.go +3 -0
  133. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloTransportPayload/InstamadilloTransportPayload.pb.go +365 -0
  134. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloTransportPayload/InstamadilloTransportPayload.proto +33 -0
  135. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloXmaContentRef/InstamadilloXmaContentRef.pb.go +1238 -0
  136. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloXmaContentRef/InstamadilloXmaContentRef.proto +105 -0
  137. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.go +16 -4
  138. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.proto +3 -0
  139. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waBotMetadata/WABotMetadata.pb.go +5156 -0
  140. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waBotMetadata/WABotMetadata.proto +516 -0
  141. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.pb.go +46 -10
  142. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.proto +4 -0
  143. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +8975 -11209
  144. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +193 -421
  145. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.go +52 -23
  146. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.proto +3 -0
  147. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waLidMigrationSyncPayload/WAWebProtobufLidMigrationSyncPayload.pb.go +198 -0
  148. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waLidMigrationSyncPayload/WAWebProtobufLidMigrationSyncPayload.proto +14 -0
  149. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/extra.go +7 -6
  150. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.pb.go +952 -0
  151. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.proto +88 -0
  152. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +1143 -463
  153. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +60 -0
  154. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.go +60 -38
  155. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.proto +3 -0
  156. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.go +11 -3
  157. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.proto +2 -0
  158. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +20 -7
  159. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/reportingfields.json +1 -0
  160. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/reportingtoken.go +176 -0
  161. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/retry.go +10 -2
  162. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +38 -21
  163. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/sendfb.go +1 -0
  164. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +1 -1
  165. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +3 -2
  166. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +9 -6
  167. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +25 -5
  168. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/00-latest-schema.sql +4 -2
  169. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/10-chat-db-lid-migration-ts.sql +2 -0
  170. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +5 -1
  171. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/call.go +1 -0
  172. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/events.go +13 -2
  173. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +2 -1
  174. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/message.go +1 -0
  175. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/user.go +2 -0
  176. slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +14 -8
  177. slidge_whatsapp/vendor/golang.org/x/crypto/curve25519/curve25519.go +1 -1
  178. slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +44 -2
  179. slidge_whatsapp/vendor/golang.org/x/net/http2/frame.go +8 -8
  180. slidge_whatsapp/vendor/golang.org/x/net/http2/gotrack.go +14 -3
  181. slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +7 -29
  182. slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +53 -71
  183. slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +20 -74
  184. slidge_whatsapp/vendor/golang.org/x/sys/unix/affinity_linux.go +1 -3
  185. slidge_whatsapp/vendor/golang.org/x/sys/unix/mkerrors.sh +3 -0
  186. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin.go +1 -55
  187. slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_solaris.go +1 -1
  188. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux.go +47 -16
  189. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +3 -0
  190. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +3 -0
  191. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +3 -0
  192. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +3 -0
  193. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +3 -0
  194. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +3 -0
  195. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +3 -0
  196. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +3 -0
  197. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +3 -0
  198. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +3 -0
  199. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +3 -0
  200. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +3 -0
  201. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +3 -0
  202. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +3 -0
  203. slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +3 -0
  204. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +4 -4
  205. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +1 -0
  206. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +1 -0
  207. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +1 -0
  208. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +1 -0
  209. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +1 -0
  210. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +1 -0
  211. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +1 -0
  212. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +1 -0
  213. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +1 -0
  214. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +1 -0
  215. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +1 -0
  216. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +1 -0
  217. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +1 -0
  218. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +1 -0
  219. slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +1 -0
  220. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux.go +168 -12
  221. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +17 -1
  222. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +16 -0
  223. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +18 -2
  224. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +16 -0
  225. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +16 -0
  226. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +17 -1
  227. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +16 -0
  228. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +16 -0
  229. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +17 -1
  230. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +18 -2
  231. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +16 -0
  232. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +16 -0
  233. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +16 -0
  234. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +16 -0
  235. slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +16 -0
  236. slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +6 -0
  237. slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +483 -483
  238. slidge_whatsapp/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +25 -1
  239. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb +0 -0
  240. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +10 -5
  241. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/presence.go +33 -0
  242. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/api_gen.go +6 -0
  243. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +68 -22
  244. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go +2 -1
  245. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go +8 -37
  246. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/presence.go +0 -3
  247. slidge_whatsapp/vendor/google.golang.org/protobuf/internal/version/version.go +1 -1
  248. slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +8 -0
  249. slidge_whatsapp/vendor/modules.txt +57 -23
  250. {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0.dist-info}/METADATA +5 -4
  251. {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0.dist-info}/RECORD +254 -174
  252. {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0.dist-info}/WHEEL +1 -1
  253. slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi_amd64.go +0 -7
  254. slidge_whatsapp/vendor/golang.org/x/net/http2/config_go124.go +0 -61
  255. slidge_whatsapp/vendor/golang.org/x/net/http2/config_pre_go124.go +0 -16
  256. slidge_whatsapp/vendor/golang.org/x/net/http2/timer.go +0 -20
  257. {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0.dist-info}/entry_points.txt +0 -0
  258. {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0.dist-info/licenses}/LICENSE +0 -0
@@ -0,0 +1,216 @@
1
+ package ast
2
+
3
+ import (
4
+ "encoding/json"
5
+ )
6
+
7
+ func UnmarshalSelectionSet(b []byte) (SelectionSet, error) {
8
+ var tmp []json.RawMessage
9
+
10
+ if err := json.Unmarshal(b, &tmp); err != nil {
11
+ return nil, err
12
+ }
13
+
14
+ result := make([]Selection, 0)
15
+ for _, item := range tmp {
16
+ var field Field
17
+ if err := json.Unmarshal(item, &field); err == nil {
18
+ result = append(result, &field)
19
+ continue
20
+ }
21
+ var fragmentSpread FragmentSpread
22
+ if err := json.Unmarshal(item, &fragmentSpread); err == nil {
23
+ result = append(result, &fragmentSpread)
24
+ continue
25
+ }
26
+ var inlineFragment InlineFragment
27
+ if err := json.Unmarshal(item, &inlineFragment); err == nil {
28
+ result = append(result, &inlineFragment)
29
+ continue
30
+ }
31
+ }
32
+
33
+ return result, nil
34
+ }
35
+
36
+ func (f *FragmentDefinition) UnmarshalJSON(b []byte) error {
37
+ var tmp map[string]json.RawMessage
38
+ if err := json.Unmarshal(b, &tmp); err != nil {
39
+ return err
40
+ }
41
+ for k := range tmp {
42
+ switch k {
43
+ case "Name":
44
+ err := json.Unmarshal(tmp[k], &f.Name)
45
+ if err != nil {
46
+ return err
47
+ }
48
+ case "VariableDefinition":
49
+ err := json.Unmarshal(tmp[k], &f.VariableDefinition)
50
+ if err != nil {
51
+ return err
52
+ }
53
+ case "TypeCondition":
54
+ err := json.Unmarshal(tmp[k], &f.TypeCondition)
55
+ if err != nil {
56
+ return err
57
+ }
58
+ case "Directives":
59
+ err := json.Unmarshal(tmp[k], &f.Directives)
60
+ if err != nil {
61
+ return err
62
+ }
63
+ case "SelectionSet":
64
+ ss, err := UnmarshalSelectionSet(tmp[k])
65
+ if err != nil {
66
+ return err
67
+ }
68
+ f.SelectionSet = ss
69
+ case "Definition":
70
+ err := json.Unmarshal(tmp[k], &f.Definition)
71
+ if err != nil {
72
+ return err
73
+ }
74
+ case "Position":
75
+ err := json.Unmarshal(tmp[k], &f.Position)
76
+ if err != nil {
77
+ return err
78
+ }
79
+ }
80
+ }
81
+ return nil
82
+ }
83
+
84
+ func (f *InlineFragment) UnmarshalJSON(b []byte) error {
85
+ var tmp map[string]json.RawMessage
86
+ if err := json.Unmarshal(b, &tmp); err != nil {
87
+ return err
88
+ }
89
+ for k := range tmp {
90
+ switch k {
91
+ case "TypeCondition":
92
+ err := json.Unmarshal(tmp[k], &f.TypeCondition)
93
+ if err != nil {
94
+ return err
95
+ }
96
+ case "Directives":
97
+ err := json.Unmarshal(tmp[k], &f.Directives)
98
+ if err != nil {
99
+ return err
100
+ }
101
+ case "SelectionSet":
102
+ ss, err := UnmarshalSelectionSet(tmp[k])
103
+ if err != nil {
104
+ return err
105
+ }
106
+ f.SelectionSet = ss
107
+ case "ObjectDefinition":
108
+ err := json.Unmarshal(tmp[k], &f.ObjectDefinition)
109
+ if err != nil {
110
+ return err
111
+ }
112
+ case "Position":
113
+ err := json.Unmarshal(tmp[k], &f.Position)
114
+ if err != nil {
115
+ return err
116
+ }
117
+ }
118
+ }
119
+ return nil
120
+ }
121
+
122
+ func (f *OperationDefinition) UnmarshalJSON(b []byte) error {
123
+ var tmp map[string]json.RawMessage
124
+ if err := json.Unmarshal(b, &tmp); err != nil {
125
+ return err
126
+ }
127
+ for k := range tmp {
128
+ switch k {
129
+ case "Operation":
130
+ err := json.Unmarshal(tmp[k], &f.Operation)
131
+ if err != nil {
132
+ return err
133
+ }
134
+ case "Name":
135
+ err := json.Unmarshal(tmp[k], &f.Name)
136
+ if err != nil {
137
+ return err
138
+ }
139
+ case "VariableDefinitions":
140
+ err := json.Unmarshal(tmp[k], &f.VariableDefinitions)
141
+ if err != nil {
142
+ return err
143
+ }
144
+ case "Directives":
145
+ err := json.Unmarshal(tmp[k], &f.Directives)
146
+ if err != nil {
147
+ return err
148
+ }
149
+ case "SelectionSet":
150
+ ss, err := UnmarshalSelectionSet(tmp[k])
151
+ if err != nil {
152
+ return err
153
+ }
154
+ f.SelectionSet = ss
155
+ case "Position":
156
+ err := json.Unmarshal(tmp[k], &f.Position)
157
+ if err != nil {
158
+ return err
159
+ }
160
+ }
161
+ }
162
+ return nil
163
+ }
164
+
165
+ func (f *Field) UnmarshalJSON(b []byte) error {
166
+ var tmp map[string]json.RawMessage
167
+ if err := json.Unmarshal(b, &tmp); err != nil {
168
+ return err
169
+ }
170
+ for k := range tmp {
171
+ switch k {
172
+ case "Alias":
173
+ err := json.Unmarshal(tmp[k], &f.Alias)
174
+ if err != nil {
175
+ return err
176
+ }
177
+ case "Name":
178
+ err := json.Unmarshal(tmp[k], &f.Name)
179
+ if err != nil {
180
+ return err
181
+ }
182
+ case "Arguments":
183
+ err := json.Unmarshal(tmp[k], &f.Arguments)
184
+ if err != nil {
185
+ return err
186
+ }
187
+ case "Directives":
188
+ err := json.Unmarshal(tmp[k], &f.Directives)
189
+ if err != nil {
190
+ return err
191
+ }
192
+ case "SelectionSet":
193
+ ss, err := UnmarshalSelectionSet(tmp[k])
194
+ if err != nil {
195
+ return err
196
+ }
197
+ f.SelectionSet = ss
198
+ case "Position":
199
+ err := json.Unmarshal(tmp[k], &f.Position)
200
+ if err != nil {
201
+ return err
202
+ }
203
+ case "Definition":
204
+ err := json.Unmarshal(tmp[k], &f.Definition)
205
+ if err != nil {
206
+ return err
207
+ }
208
+ case "ObjectDefinition":
209
+ err := json.Unmarshal(tmp[k], &f.ObjectDefinition)
210
+ if err != nil {
211
+ return err
212
+ }
213
+ }
214
+ }
215
+ return nil
216
+ }
@@ -0,0 +1,110 @@
1
+ package ast
2
+
3
+ type DefinitionKind string
4
+
5
+ const (
6
+ Scalar DefinitionKind = "SCALAR"
7
+ Object DefinitionKind = "OBJECT"
8
+ Interface DefinitionKind = "INTERFACE"
9
+ Union DefinitionKind = "UNION"
10
+ Enum DefinitionKind = "ENUM"
11
+ InputObject DefinitionKind = "INPUT_OBJECT"
12
+ )
13
+
14
+ // Definition is the core type definition object, it includes all of the definable types
15
+ // but does *not* cover schema or directives.
16
+ //
17
+ // @vektah: Javascript implementation has different types for all of these, but they are
18
+ // more similar than different and don't define any behaviour. I think this style of
19
+ // "some hot" struct works better, at least for go.
20
+ //
21
+ // Type extensions are also represented by this same struct.
22
+ type Definition struct {
23
+ Kind DefinitionKind
24
+ Description string
25
+ Name string
26
+ Directives DirectiveList
27
+ Interfaces []string // object and input object
28
+ Fields FieldList // object and input object
29
+ Types []string // union
30
+ EnumValues EnumValueList // enum
31
+
32
+ Position *Position `dump:"-" json:"-"`
33
+ BuiltIn bool `dump:"-"`
34
+
35
+ BeforeDescriptionComment *CommentGroup
36
+ AfterDescriptionComment *CommentGroup
37
+ EndOfDefinitionComment *CommentGroup
38
+ }
39
+
40
+ func (d *Definition) IsLeafType() bool {
41
+ return d.Kind == Enum || d.Kind == Scalar
42
+ }
43
+
44
+ func (d *Definition) IsAbstractType() bool {
45
+ return d.Kind == Interface || d.Kind == Union
46
+ }
47
+
48
+ func (d *Definition) IsCompositeType() bool {
49
+ return d.Kind == Object || d.Kind == Interface || d.Kind == Union
50
+ }
51
+
52
+ func (d *Definition) IsInputType() bool {
53
+ return d.Kind == Scalar || d.Kind == Enum || d.Kind == InputObject
54
+ }
55
+
56
+ func (d *Definition) OneOf(types ...string) bool {
57
+ for _, t := range types {
58
+ if d.Name == t {
59
+ return true
60
+ }
61
+ }
62
+ return false
63
+ }
64
+
65
+ type FieldDefinition struct {
66
+ Description string
67
+ Name string
68
+ Arguments ArgumentDefinitionList // only for objects
69
+ DefaultValue *Value // only for input objects
70
+ Type *Type
71
+ Directives DirectiveList
72
+ Position *Position `dump:"-" json:"-"`
73
+
74
+ BeforeDescriptionComment *CommentGroup
75
+ AfterDescriptionComment *CommentGroup
76
+ }
77
+
78
+ type ArgumentDefinition struct {
79
+ Description string
80
+ Name string
81
+ DefaultValue *Value
82
+ Type *Type
83
+ Directives DirectiveList
84
+ Position *Position `dump:"-" json:"-"`
85
+
86
+ BeforeDescriptionComment *CommentGroup
87
+ AfterDescriptionComment *CommentGroup
88
+ }
89
+
90
+ type EnumValueDefinition struct {
91
+ Description string
92
+ Name string
93
+ Directives DirectiveList
94
+ Position *Position `dump:"-" json:"-"`
95
+
96
+ BeforeDescriptionComment *CommentGroup
97
+ AfterDescriptionComment *CommentGroup
98
+ }
99
+
100
+ type DirectiveDefinition struct {
101
+ Description string
102
+ Name string
103
+ Arguments ArgumentDefinitionList
104
+ Locations []DirectiveLocation
105
+ IsRepeatable bool
106
+ Position *Position `dump:"-" json:"-"`
107
+
108
+ BeforeDescriptionComment *CommentGroup
109
+ AfterDescriptionComment *CommentGroup
110
+ }
@@ -0,0 +1,43 @@
1
+ package ast
2
+
3
+ type DirectiveLocation string
4
+
5
+ const (
6
+ // Executable
7
+ LocationQuery DirectiveLocation = `QUERY`
8
+ LocationMutation DirectiveLocation = `MUTATION`
9
+ LocationSubscription DirectiveLocation = `SUBSCRIPTION`
10
+ LocationField DirectiveLocation = `FIELD`
11
+ LocationFragmentDefinition DirectiveLocation = `FRAGMENT_DEFINITION`
12
+ LocationFragmentSpread DirectiveLocation = `FRAGMENT_SPREAD`
13
+ LocationInlineFragment DirectiveLocation = `INLINE_FRAGMENT`
14
+
15
+ // Type System
16
+ LocationSchema DirectiveLocation = `SCHEMA`
17
+ LocationScalar DirectiveLocation = `SCALAR`
18
+ LocationObject DirectiveLocation = `OBJECT`
19
+ LocationFieldDefinition DirectiveLocation = `FIELD_DEFINITION`
20
+ LocationArgumentDefinition DirectiveLocation = `ARGUMENT_DEFINITION`
21
+ LocationInterface DirectiveLocation = `INTERFACE`
22
+ LocationUnion DirectiveLocation = `UNION`
23
+ LocationEnum DirectiveLocation = `ENUM`
24
+ LocationEnumValue DirectiveLocation = `ENUM_VALUE`
25
+ LocationInputObject DirectiveLocation = `INPUT_OBJECT`
26
+ LocationInputFieldDefinition DirectiveLocation = `INPUT_FIELD_DEFINITION`
27
+ LocationVariableDefinition DirectiveLocation = `VARIABLE_DEFINITION`
28
+ )
29
+
30
+ type Directive struct {
31
+ Name string
32
+ Arguments ArgumentList
33
+ Position *Position `dump:"-" json:"-"`
34
+
35
+ // Requires validation
36
+ ParentDefinition *Definition
37
+ Definition *DirectiveDefinition
38
+ Location DirectiveLocation
39
+ }
40
+
41
+ func (d *Directive) ArgumentMap(vars map[string]interface{}) map[string]interface{} {
42
+ return arg2map(d.Definition.Arguments, d.Arguments, vars)
43
+ }
@@ -0,0 +1,89 @@
1
+ package ast
2
+
3
+ type QueryDocument struct {
4
+ Operations OperationList
5
+ Fragments FragmentDefinitionList
6
+ Position *Position `dump:"-" json:"-"`
7
+ Comment *CommentGroup
8
+ }
9
+
10
+ type SchemaDocument struct {
11
+ Schema SchemaDefinitionList
12
+ SchemaExtension SchemaDefinitionList
13
+ Directives DirectiveDefinitionList
14
+ Definitions DefinitionList
15
+ Extensions DefinitionList
16
+ Position *Position `dump:"-" json:"-"`
17
+ Comment *CommentGroup
18
+ }
19
+
20
+ func (d *SchemaDocument) Merge(other *SchemaDocument) {
21
+ d.Schema = append(d.Schema, other.Schema...)
22
+ d.SchemaExtension = append(d.SchemaExtension, other.SchemaExtension...)
23
+ d.Directives = append(d.Directives, other.Directives...)
24
+ d.Definitions = append(d.Definitions, other.Definitions...)
25
+ d.Extensions = append(d.Extensions, other.Extensions...)
26
+ }
27
+
28
+ type Schema struct {
29
+ Query *Definition
30
+ Mutation *Definition
31
+ Subscription *Definition
32
+ SchemaDirectives DirectiveList
33
+
34
+ Types map[string]*Definition
35
+ Directives map[string]*DirectiveDefinition
36
+
37
+ PossibleTypes map[string][]*Definition
38
+ Implements map[string][]*Definition
39
+
40
+ Description string
41
+
42
+ Comment *CommentGroup
43
+ }
44
+
45
+ // AddTypes is the helper to add types definition to the schema
46
+ func (s *Schema) AddTypes(defs ...*Definition) {
47
+ if s.Types == nil {
48
+ s.Types = make(map[string]*Definition)
49
+ }
50
+ for _, def := range defs {
51
+ s.Types[def.Name] = def
52
+ }
53
+ }
54
+
55
+ func (s *Schema) AddPossibleType(name string, def *Definition) {
56
+ s.PossibleTypes[name] = append(s.PossibleTypes[name], def)
57
+ }
58
+
59
+ // GetPossibleTypes will enumerate all the definitions for a given interface or union
60
+ func (s *Schema) GetPossibleTypes(def *Definition) []*Definition {
61
+ return s.PossibleTypes[def.Name]
62
+ }
63
+
64
+ func (s *Schema) AddImplements(name string, iface *Definition) {
65
+ s.Implements[name] = append(s.Implements[name], iface)
66
+ }
67
+
68
+ // GetImplements returns all the interface and union definitions that the given definition satisfies
69
+ func (s *Schema) GetImplements(def *Definition) []*Definition {
70
+ return s.Implements[def.Name]
71
+ }
72
+
73
+ type SchemaDefinition struct {
74
+ Description string
75
+ Directives DirectiveList
76
+ OperationTypes OperationTypeDefinitionList
77
+ Position *Position `dump:"-" json:"-"`
78
+
79
+ BeforeDescriptionComment *CommentGroup
80
+ AfterDescriptionComment *CommentGroup
81
+ EndOfDefinitionComment *CommentGroup
82
+ }
83
+
84
+ type OperationTypeDefinition struct {
85
+ Operation Operation
86
+ Type string
87
+ Position *Position `dump:"-" json:"-"`
88
+ Comment *CommentGroup
89
+ }
@@ -0,0 +1,159 @@
1
+ package ast
2
+
3
+ import (
4
+ "bytes"
5
+ "fmt"
6
+ "reflect"
7
+ "strconv"
8
+ "strings"
9
+ )
10
+
11
+ // Dump turns ast into a stable string format for assertions in tests
12
+ func Dump(i interface{}) string {
13
+ v := reflect.ValueOf(i)
14
+
15
+ d := dumper{Buffer: &bytes.Buffer{}}
16
+ d.dump(v)
17
+
18
+ return d.String()
19
+ }
20
+
21
+ type dumper struct {
22
+ *bytes.Buffer
23
+ indent int
24
+ }
25
+
26
+ type Dumpable interface {
27
+ Dump() string
28
+ }
29
+
30
+ func (d *dumper) dump(v reflect.Value) {
31
+ if dumpable, isDumpable := v.Interface().(Dumpable); isDumpable {
32
+ d.WriteString(dumpable.Dump())
33
+ return
34
+ }
35
+ switch v.Kind() {
36
+ case reflect.Bool:
37
+ if v.Bool() {
38
+ d.WriteString("true")
39
+ } else {
40
+ d.WriteString("false")
41
+ }
42
+ case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
43
+ fmt.Fprintf(d, "%d", v.Int())
44
+
45
+ case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
46
+ fmt.Fprintf(d, "%d", v.Uint())
47
+
48
+ case reflect.Float32, reflect.Float64:
49
+ fmt.Fprintf(d, "%.2f", v.Float())
50
+
51
+ case reflect.String:
52
+ if v.Type().Name() != "string" {
53
+ d.WriteString(v.Type().Name() + "(" + strconv.Quote(v.String()) + ")")
54
+ } else {
55
+ d.WriteString(strconv.Quote(v.String()))
56
+ }
57
+
58
+ case reflect.Array, reflect.Slice:
59
+ d.dumpArray(v)
60
+
61
+ case reflect.Interface, reflect.Ptr:
62
+ d.dumpPtr(v)
63
+
64
+ case reflect.Struct:
65
+ d.dumpStruct(v)
66
+
67
+ default:
68
+ panic(fmt.Errorf("unsupported kind: %s\n buf: %s", v.Kind().String(), d.String()))
69
+ }
70
+ }
71
+
72
+ func (d *dumper) writeIndent() {
73
+ d.WriteString(strings.Repeat(" ", d.indent))
74
+ }
75
+
76
+ func (d *dumper) nl() {
77
+ d.WriteByte('\n')
78
+ d.writeIndent()
79
+ }
80
+
81
+ func typeName(t reflect.Type) string {
82
+ if t.Kind() == reflect.Ptr {
83
+ return typeName(t.Elem())
84
+ }
85
+ return t.Name()
86
+ }
87
+
88
+ func (d *dumper) dumpArray(v reflect.Value) {
89
+ d.WriteString("[" + typeName(v.Type().Elem()) + "]")
90
+
91
+ for i := 0; i < v.Len(); i++ {
92
+ d.nl()
93
+ d.WriteString("- ")
94
+ d.indent++
95
+ d.dump(v.Index(i))
96
+ d.indent--
97
+ }
98
+ }
99
+
100
+ func (d *dumper) dumpStruct(v reflect.Value) {
101
+ d.WriteString("<" + v.Type().Name() + ">")
102
+ d.indent++
103
+
104
+ typ := v.Type()
105
+ for i := 0; i < v.NumField(); i++ {
106
+ f := v.Field(i)
107
+ if typ.Field(i).Tag.Get("dump") == "-" {
108
+ continue
109
+ }
110
+
111
+ if isZero(f) {
112
+ continue
113
+ }
114
+ d.nl()
115
+ d.WriteString(typ.Field(i).Name)
116
+ d.WriteString(": ")
117
+ d.dump(v.Field(i))
118
+ }
119
+
120
+ d.indent--
121
+ }
122
+
123
+ func isZero(v reflect.Value) bool {
124
+ switch v.Kind() {
125
+ case reflect.Ptr, reflect.Interface:
126
+ return v.IsNil()
127
+ case reflect.Func, reflect.Map:
128
+ return v.IsNil()
129
+
130
+ case reflect.Array, reflect.Slice:
131
+ if v.IsNil() {
132
+ return true
133
+ }
134
+ z := true
135
+ for i := 0; i < v.Len(); i++ {
136
+ z = z && isZero(v.Index(i))
137
+ }
138
+ return z
139
+ case reflect.Struct:
140
+ z := true
141
+ for i := 0; i < v.NumField(); i++ {
142
+ z = z && isZero(v.Field(i))
143
+ }
144
+ return z
145
+ case reflect.String:
146
+ return v.String() == ""
147
+ }
148
+
149
+ // Compare other types directly:
150
+ return reflect.DeepEqual(v.Interface(), reflect.Zero(v.Type()))
151
+ }
152
+
153
+ func (d *dumper) dumpPtr(v reflect.Value) {
154
+ if v.IsNil() {
155
+ d.WriteString("nil")
156
+ return
157
+ }
158
+ d.dump(v.Elem())
159
+ }
@@ -0,0 +1,41 @@
1
+ package ast
2
+
3
+ type FragmentSpread struct {
4
+ Name string
5
+ Directives DirectiveList
6
+
7
+ // Require validation
8
+ ObjectDefinition *Definition
9
+ Definition *FragmentDefinition
10
+
11
+ Position *Position `dump:"-" json:"-"`
12
+ Comment *CommentGroup
13
+ }
14
+
15
+ type InlineFragment struct {
16
+ TypeCondition string
17
+ Directives DirectiveList
18
+ SelectionSet SelectionSet
19
+
20
+ // Require validation
21
+ ObjectDefinition *Definition
22
+
23
+ Position *Position `dump:"-" json:"-"`
24
+ Comment *CommentGroup
25
+ }
26
+
27
+ type FragmentDefinition struct {
28
+ Name string
29
+ // Note: fragment variable definitions are experimental and may be changed
30
+ // or removed in the future.
31
+ VariableDefinition VariableDefinitionList
32
+ TypeCondition string
33
+ Directives DirectiveList
34
+ SelectionSet SelectionSet
35
+
36
+ // Require validation
37
+ Definition *Definition
38
+
39
+ Position *Position `dump:"-" json:"-"`
40
+ Comment *CommentGroup
41
+ }
@@ -0,0 +1,32 @@
1
+ package ast
2
+
3
+ type Operation string
4
+
5
+ const (
6
+ Query Operation = "query"
7
+ Mutation Operation = "mutation"
8
+ Subscription Operation = "subscription"
9
+ )
10
+
11
+ type OperationDefinition struct {
12
+ Operation Operation
13
+ Name string
14
+ VariableDefinitions VariableDefinitionList
15
+ Directives DirectiveList
16
+ SelectionSet SelectionSet
17
+ Position *Position `dump:"-" json:"-"`
18
+ Comment *CommentGroup
19
+ }
20
+
21
+ type VariableDefinition struct {
22
+ Variable string
23
+ Type *Type
24
+ DefaultValue *Value
25
+ Directives DirectiveList
26
+ Position *Position `dump:"-" json:"-"`
27
+ Comment *CommentGroup
28
+
29
+ // Requires validation
30
+ Definition *Definition
31
+ Used bool `dump:"-"`
32
+ }