slidge-whatsapp 0.2.6__cp313-cp313-manylinux_2_36_aarch64.whl → 0.3.0__cp313-cp313-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.
- slidge_whatsapp/contact.py +15 -3
- slidge_whatsapp/event.go +152 -50
- slidge_whatsapp/gateway.go +7 -63
- slidge_whatsapp/gateway.py +2 -3
- slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.h +180 -163
- slidge_whatsapp/generated/_whatsapp.cpython-313-aarch64-linux-gnu.so +0 -0
- slidge_whatsapp/generated/build.py +145 -131
- slidge_whatsapp/generated/whatsapp.c +1669 -1397
- slidge_whatsapp/generated/whatsapp.go +1209 -1098
- slidge_whatsapp/generated/whatsapp.py +1175 -1050
- slidge_whatsapp/generated/whatsapp_go.h +180 -163
- slidge_whatsapp/go.mod +18 -15
- slidge_whatsapp/go.sum +38 -32
- slidge_whatsapp/group.py +34 -30
- slidge_whatsapp/media/media.go +6 -2
- slidge_whatsapp/session.go +34 -17
- slidge_whatsapp/session.py +46 -14
- slidge_whatsapp/vendor/github.com/beeper/argo-go/LICENSE +9 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/block/blockreader.go +329 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/block/blockwriter.go +417 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/codec/decoder.go +652 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/codec/encoder.go +985 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/header/header.go +135 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/internal/util/util.go +133 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/label/label.go +384 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/label/wiremarkers.go +37 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/bitset/bitset.go +197 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/buf/buf.go +420 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/pkg/varint/varint.go +246 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/wire/wire.go +614 -0
- slidge_whatsapp/vendor/github.com/beeper/argo-go/wirecodec/decode.go +341 -0
- slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/LICENSE +21 -0
- slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/list.go +95 -0
- slidge_whatsapp/vendor/github.com/elliotchance/orderedmap/v3/orderedmap.go +187 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz.go +1 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_cgo.go +3 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/fitz_nocgo.go +4 -5
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_darwin.go +11 -1
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_linux.go +10 -0
- slidge_whatsapp/vendor/github.com/gen2brain/go-fitz/purego_windows.go +12 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/.gitignore +0 -2
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/CHANGELOG.md +30 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/COPYRIGHT.txt +6 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/README.md +14 -17
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi.go +1 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi2.go +7 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/LICENSE +21 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/darwin_amd64/libffi.8.dylib +0 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/darwin_arm64/libffi.8.dylib +0 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/assets/libffi/windows_amd64/libffi-8.dll +0 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/cif.go +15 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/cif_arm64.go +16 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed.go +49 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_darwin_amd64.go +10 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_darwin_arm64.go +10 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/embed_windows_amd64.go +10 -0
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/ffi.go +51 -13
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/init.go +22 -9
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/README.md +2 -0
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.c +3096 -1651
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3-binding.h +188 -128
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3_opt_userauth.go +13 -140
- slidge_whatsapp/vendor/github.com/mattn/go-sqlite3/sqlite3ext.h +4 -0
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.23.go +2 -2
- slidge_whatsapp/vendor/github.com/petermattis/goid/runtime_go1.25.go +37 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/LICENSE +19 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/argmap.go +37 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/collections.go +148 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/comment.go +31 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/decode.go +216 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/definition.go +110 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/directive.go +43 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/document.go +89 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/dumper.go +159 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/fragment.go +41 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/operation.go +32 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/path.go +72 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/selection.go +41 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/source.go +19 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/type.go +68 -0
- slidge_whatsapp/vendor/github.com/vektah/gqlparser/v2/ast/value.go +122 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/handleerrors.go +60 -26
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/json.go +1 -6
- slidge_whatsapp/vendor/go.mau.fi/util/exhttp/networkerror.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/util/exstrings/stringutil.go +104 -0
- slidge_whatsapp/vendor/go.mau.fi/util/exsync/event.go +19 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/.pre-commit-config.yaml +3 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/decode.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate/hash.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/appstate.go +5 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/argo-wire-type-store.argo +63 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/argo.go +62 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/argo/name-to-queryids.json +306 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/armadillomessage.go +40 -7
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/binary/encoder.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/call.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/client.go +79 -45
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/connectionevents.go +13 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download-to-file.go +19 -12
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/download.go +26 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/errors.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/group.go +99 -27
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/internals.go +54 -26
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/keepalive.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/message.go +208 -57
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/msgsecret.go +2 -14
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/newsletter.go +83 -7
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/notification.go +17 -8
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/pair-code.go +2 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/presence.go +15 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/extra.go +7 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/InstamadilloAddMessage.pb.go +983 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/InstamadilloAddMessage.proto +85 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloAddMessage/extra.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeActionLog/InstamadilloCoreTypeActionLog.pb.go +197 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeActionLog/InstamadilloCoreTypeActionLog.proto +13 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeAdminMessage/InstamadilloCoreTypeAdminMessage.pb.go +279 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeAdminMessage/InstamadilloCoreTypeAdminMessage.proto +21 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeCollection/InstamadilloCoreTypeCollection.pb.go +137 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeCollection/InstamadilloCoreTypeCollection.proto +10 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeLink/InstamadilloCoreTypeLink.pb.go +313 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeLink/InstamadilloCoreTypeLink.proto +27 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeMedia/InstamadilloCoreTypeMedia.pb.go +1299 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeMedia/InstamadilloCoreTypeMedia.proto +112 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeText/InstamadilloCoreTypeText.pb.go +514 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloCoreTypeText/InstamadilloCoreTypeText.proto +47 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/InstamadilloDeleteMessage.pb.go +123 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/InstamadilloDeleteMessage.proto +7 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloDeleteMessage/extra.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/InstamadilloSupplementMessage.pb.go +720 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/InstamadilloSupplementMessage.proto +59 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloSupplementMessage/extra.go +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloTransportPayload/InstamadilloTransportPayload.pb.go +365 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloTransportPayload/InstamadilloTransportPayload.proto +33 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloXmaContentRef/InstamadilloXmaContentRef.pb.go +1238 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/instamadilloXmaContentRef/InstamadilloXmaContentRef.proto +105 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.pb.go +16 -4
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waArmadilloXMA/WAArmadilloXMA.proto +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waBotMetadata/WABotMetadata.pb.go +5156 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waBotMetadata/WABotMetadata.proto +516 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.pb.go +46 -10
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waCompanionReg/WACompanionReg.proto +4 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.pb.go +8975 -11209
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waE2E/WAWebProtobufsE2E.proto +193 -421
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.pb.go +52 -23
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waHistorySync/WAWebProtobufsHistorySync.proto +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waLidMigrationSyncPayload/WAWebProtobufLidMigrationSyncPayload.pb.go +198 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waLidMigrationSyncPayload/WAWebProtobufLidMigrationSyncPayload.proto +14 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waMsgTransport/extra.go +7 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.pb.go +952 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waStatusAttributions/WAStatusAttributions.proto +88 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.pb.go +1143 -463
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waSyncAction/WASyncAction.proto +60 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.pb.go +60 -38
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWa6/WAWebProtobufsWa6.proto +3 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.pb.go +11 -3
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/proto/waWeb/WAWebProtobufsWeb.proto +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/receipt.go +20 -7
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/reportingfields.json +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/reportingtoken.go +176 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/retry.go +10 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/send.go +38 -21
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/sendfb.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/clientpayload.go +1 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/noop.go +3 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/container.go +9 -6
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/store.go +25 -5
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/00-latest-schema.sql +4 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/sqlstore/upgrades/10-chat-db-lid-migration-ts.sql +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/store/store.go +5 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/call.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/events/events.go +13 -2
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/jid.go +2 -1
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/message.go +1 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/types/user.go +2 -0
- slidge_whatsapp/vendor/go.mau.fi/whatsmeow/user.go +14 -8
- slidge_whatsapp/vendor/golang.org/x/crypto/curve25519/curve25519.go +1 -1
- slidge_whatsapp/vendor/golang.org/x/net/http2/config.go +44 -2
- slidge_whatsapp/vendor/golang.org/x/net/http2/frame.go +8 -8
- slidge_whatsapp/vendor/golang.org/x/net/http2/gotrack.go +14 -3
- slidge_whatsapp/vendor/golang.org/x/net/http2/http2.go +7 -29
- slidge_whatsapp/vendor/golang.org/x/net/http2/server.go +53 -71
- slidge_whatsapp/vendor/golang.org/x/net/http2/transport.go +20 -74
- slidge_whatsapp/vendor/golang.org/x/sys/unix/affinity_linux.go +1 -3
- slidge_whatsapp/vendor/golang.org/x/sys/unix/mkerrors.sh +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_darwin.go +1 -55
- slidge_whatsapp/vendor/golang.org/x/sys/unix/syscall_solaris.go +1 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux.go +47 -16
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_386.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_amd64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_arm64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_loong64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mips64le.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_mipsle.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_ppc64le.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_riscv64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_s390x.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zerrors_linux_sparc64.go +3 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go +4 -4
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_386.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_amd64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_arm64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_loong64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mips64le.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_mipsle.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_ppc64le.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_riscv64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_s390x.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/zsysnum_linux_sparc64.go +1 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux.go +168 -12
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_386.go +17 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_amd64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm.go +18 -2
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_arm64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_loong64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips.go +17 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mips64le.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_mipsle.go +17 -1
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc.go +18 -2
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_ppc64le.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_riscv64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_s390x.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/unix/ztypes_linux_sparc64.go +16 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/types_windows.go +6 -0
- slidge_whatsapp/vendor/golang.org/x/sys/windows/zsyscall_windows.go +483 -483
- slidge_whatsapp/vendor/google.golang.org/protobuf/encoding/protowire/wire.go +25 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/editiondefaults/editions_defaults.binpb +0 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/editions.go +10 -5
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/filedesc/presence.go +33 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/api_gen.go +6 -0
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/genid/descriptor_gen.go +68 -22
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/codec_message_opaque.go +2 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/message_opaque.go +8 -37
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/impl/presence.go +0 -3
- slidge_whatsapp/vendor/google.golang.org/protobuf/internal/version/version.go +1 -1
- slidge_whatsapp/vendor/google.golang.org/protobuf/reflect/protoreflect/source_gen.go +8 -0
- slidge_whatsapp/vendor/modules.txt +57 -23
- {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0.dist-info}/METADATA +5 -4
- {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0.dist-info}/RECORD +254 -174
- {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0.dist-info}/WHEEL +1 -1
- slidge_whatsapp/vendor/github.com/jupiterrider/ffi/abi_amd64.go +0 -7
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_go124.go +0 -61
- slidge_whatsapp/vendor/golang.org/x/net/http2/config_pre_go124.go +0 -16
- slidge_whatsapp/vendor/golang.org/x/net/http2/timer.go +0 -20
- {slidge_whatsapp-0.2.6.dist-info → slidge_whatsapp-0.3.0.dist-info}/entry_points.txt +0 -0
- {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
|
+
}
|