Skip to content

Conversation

@alfetopito
Copy link
Contributor

Summary

Add Announcement model

image
image

Testing

Local testing via postman/curl, querying the entries with: http://localhost:1337/api/announcements?populate[networks][fields][0]=chainId&populate[environments][fields][0]=name&fields[0]=text&fields[1]=isCritical

Response:

{
    "data": [
        {
            "id": 1,
            "attributes": {
                "text": "Test _announcement_ announcement with an [internal link](#/swap/1/usdc)",
                "isCritical": false,
                "networks": {
                    "data": [
                        {
                            "id": 2,
                            "attributes": {
                                "chainId": 100
                            }
                        },
                        {
                            "id": 1,
                            "attributes": {
                                "chainId": 1
                            }
                        }
                    ]
                },
                "environments": {
                    "data": [
                        {
                            "id": 1,
                            "attributes": {
                                "name": "barn"
                            }
                        },
                        {
                            "id": 2,
                            "attributes": {
                                "name": "prod"
                            }
                        }
                    ]
                }
            }
        },
        {
            "id": 2,
            "attributes": {
                "text": "**Critical** announcement!!!",
                "isCritical": true,
                "networks": {
                    "data": [
                        {
                            "id": 2,
                            "attributes": {
                                "chainId": 100
                            }
                        },
                        {
                            "id": 1,
                            "attributes": {
                                "chainId": 1
                            }
                        }
                    ]
                },
                "environments": {
                    "data": [
                        {
                            "id": 1,
                            "attributes": {
                                "name": "barn"
                            }
                        },
                        {
                            "id": 2,
                            "attributes": {
                                "name": "prod"
                            }
                        }
                    ]
                }
            }
        }
    ],
    "meta": {
        "pagination": {
            "page": 1,
            "pageSize": 25,
            "pageCount": 1,
            "total": 2
        }
    }
}

@alfetopito alfetopito self-assigned this Dec 16, 2024
@alfetopito alfetopito requested a review from a team December 16, 2024 13:39
@socket-security
Copy link

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/helper-plugin-utils@7.22.5 None 0 11.9 kB nicolo-ribaudo
npm/@babel/template@7.22.15 None 0 69.2 kB nicolo-ribaudo
npm/@fastify/busboy@2.1.1 None 0 80.2 kB gurgunday
npm/@hapi/hoek@9.3.0 None 0 51.5 kB devinivy
npm/@hapi/topo@5.1.0 None 0 10.7 kB devinivy
npm/@isaacs/cliui@8.0.2 None +6 171 kB isaacs
npm/@jridgewell/gen-mapping@0.3.3 None +1 125 kB jridgewell
npm/@jridgewell/resolve-uri@3.1.1 None 0 55.2 kB jridgewell
npm/@jridgewell/set-array@1.1.2 None 0 15.5 kB jridgewell
npm/@jridgewell/source-map@0.3.5 None 0 232 kB jridgewell
npm/@leichtgewicht/ip-codec@2.0.4 None 0 17.7 kB leichtgewicht
npm/@monaco-editor/loader@1.4.0 None 0 85.9 kB surenat
npm/@monaco-editor/react@4.4.5 None 0 1.06 MB surenat
npm/@nodelib/fs.scandir@2.1.5 filesystem 0 22.2 kB mrmlnc
npm/@nodelib/fs.stat@2.0.5 filesystem 0 11.8 kB mrmlnc
npm/@nodelib/fs.walk@1.2.8 None 0 26.4 kB mrmlnc
npm/@pkgjs/parseargs@0.11.0 None 0 74.2 kB oss-bot
npm/@sideway/address@4.1.5 None 0 55.9 kB marsup
npm/@sideway/formula@3.0.1 None 0 16.9 kB marsup
npm/@sideway/pinpoint@2.0.0 None 0 3.64 kB hueniverse
npm/@types/connect@3.4.36 None 0 6.21 kB types
npm/@types/http-cache-semantics@4.0.1 None 0 9.55 kB types
npm/@types/keyv@3.1.4 None 0 6.12 kB types
npm/@types/minimatch@5.1.2 None 0 12.5 kB types
npm/@types/range-parser@1.2.4 None 0 5.05 kB types
npm/@types/send@0.17.1 None +1 14.2 kB types
npm/@webassemblyjs/floating-point-hex-parser@1.11.6 None 0 5.14 kB xtuc
npm/@xtuc/ieee754@1.2.0 None 0 8.57 kB xtuc
npm/@xtuc/long@4.2.2 None 0 190 kB xtuc
npm/@yarnpkg/lockfile@1.1.0 environment, eval, filesystem 0 280 kB arcanis
npm/addressparser@1.0.1 None 0 11.7 kB andris
npm/ansi-colors@4.1.3 environment 0 26.1 kB jonschlinkert
npm/arr-diff@4.0.0 None 0 7.9 kB jonschlinkert
npm/arr-flatten@1.1.0 None 0 6.88 kB jonschlinkert
npm/arr-union@3.1.0 None 0 6.66 kB jonschlinkert
npm/array-each@1.0.1 None 0 6.17 kB jonschlinkert
npm/array-slice@1.1.0 None 0 6.26 kB jonschlinkert
npm/array-unique@0.3.2 None 0 7.16 kB jonschlinkert
npm/assign-symbols@1.0.0 None 0 5.85 kB phated
npm/at-least-node@1.0.0 None 0 2.63 kB ryanzim
npm/atob@2.1.2 None 0 36.2 kB coolaj86
npm/base@0.11.2 None 0 32.7 kB jonschlinkert
npm/better-sqlite3@8.5.0 filesystem 0 9.62 MB joshuawise
npm/bindings@1.5.0 environment, filesystem 0 11.2 kB tootallnate
npm/bluebird@3.7.2 environment, eval, unsafe 0 632 kB esailija
npm/buffer-from@1.1.2 None 0 5.05 kB linusu
npm/buffer-writer@2.0.0 None 0 13.7 kB brianc
npm/buildmail@3.10.0 filesystem, network 0 108 kB andris
npm/cache-base@1.0.1 None 0 16.4 kB jonschlinkert
npm/class-utils@0.3.6 None 0 19 kB jonschlinkert
npm/clone-response@1.0.3 None +1 8.11 kB sindresorhus
npm/clone@1.0.4 None 0 11.1 kB pvorb
npm/collection-visit@1.0.0 None 0 6.85 kB jonschlinkert
npm/component-emitter@1.3.0 None 0 8 kB nami-doc
npm/copy-descriptor@0.1.1 None 0 4.15 kB jonschlinkert
npm/cssesc@3.0.0 None 0 17.5 kB mathias
npm/csvtojson@2.0.10 filesystem, shell 0 8.69 MB keyang
npm/decode-uri-component@0.2.2 None 0 6.09 kB samverschueren
npm/deep-extend@0.6.0 None 0 9.19 kB unclechu
npm/defer-to-connect@2.0.1 None 0 5.44 kB szmarczak
npm/define-data-property@1.1.4 None 0 30.9 kB ljharb
npm/define-properties@1.2.0 None 0 12.5 kB ljharb
npm/define-property@2.0.2 None 0 10.7 kB doowb
npm/detect-file@1.0.0 filesystem 0 8.63 kB doowb
npm/dns-packet@5.6.1 None 0 61 kB silverwind
npm/dom-converter@0.2.0 None 0 7.9 kB ariaminaei
npm/eastasianwidth@0.2.0 None 0 13.6 kB komagata
npm/es-define-property@1.0.0 None 0 11.8 kB ljharb
npm/es-errors@1.3.0 None 0 12.3 kB ljharb
npm/eventemitter3@4.0.7 None 0 38 kB lpinca
npm/expand-brackets@2.1.4 None 0 26 kB jonschlinkert
npm/extglob@2.0.4 None +1 47.9 kB jonschlinkert
npm/fast-json-stable-stringify@2.1.0 None 0 17 kB esp
npm/fastq@1.15.0 None 0 38.9 kB matteo.collina
npm/file-uri-to-path@1.0.0 None 0 8.07 kB tootallnate
npm/find-yarn-workspace-root@2.0.0 filesystem 0 16.7 kB bmishkin
npm/for-in@1.0.2 None 0 6.28 kB jonschlinkert
npm/for-own@1.0.0 None 0 6.47 kB jonschlinkert
npm/foreground-child@3.1.1 shell +1 137 kB isaacs
npm/forwarded@0.2.0 None 0 5.88 kB dougwilson
npm/fragment-cache@0.2.1 None +1 17.5 kB jonschlinkert
npm/get-value@2.0.6 None 0 3.71 kB jonschlinkert
npm/global-modules@1.0.0 None +1 14.5 kB jonschlinkert
npm/global-prefix@1.0.2 environment, filesystem +1 18 kB phated
npm/gopd@1.0.1 None 0 7.7 kB ljharb
npm/has-property-descriptors@1.0.0 None 0 9.31 kB ljharb
npm/has-value@1.0.0 None 0 7.62 kB jonschlinkert
npm/has-values@1.0.0 None +1 21.4 kB jonschlinkert
npm/hasown@2.0.2 None 0 8.77 kB ljharb
npm/homedir-polyfill@1.0.3 environment, filesystem 0 8.05 kB doowb
npm/hpack.js@2.1.6 Transitive: environment +3 215 kB indutny
npm/http-cache-semantics@4.1.1 None 0 35.9 kB kornel
npm/http-parser-js@0.5.8 None 0 25.8 kB jimbly
npm/ini@1.3.8 None 0 9.3 kB isaacs
npm/is-absolute@1.0.0 None 0 8.55 kB jonschlinkert
npm/is-accessor-descriptor@1.0.0 None 0 9.37 kB jonschlinkert
npm/is-buffer@1.1.6 None 0 5.58 kB feross
npm/is-data-descriptor@1.0.0 None 0 8.82 kB jonschlinkert
npm/is-descriptor@1.0.2 None 0 9.01 kB jonschlinkert
npm/is-extendable@1.0.1 None 0 6.94 kB doowb
npm/is-number@7.0.0 None 0 9.62 kB jonschlinkert
npm/is-relative@1.0.0 None 0 6.59 kB jonschlinkert
npm/is-unc-path@1.0.0 None 0 6.51 kB jonschlinkert
npm/is-utf8@0.2.1 None 0 4.34 kB wayfind
npm/isarray@0.0.1 None 0 6.82 kB juliangruber
npm/jackspeak@2.3.6 environment 0 253 kB isaacs
npm/joi@17.6.0 None 0 519 kB hueniverse
npm/js-yaml@4.1.0 None 0 405 kB vitaly
npm/jsesc@2.5.2 None 0 32 kB mathias
npm/json-buffer@3.0.1 None 0 5.4 kB dominictarr
npm/json-schema-traverse@0.4.1 None 0 19.6 kB esp
npm/json-stable-stringify@1.1.1 Transitive: eval +4 126 kB ljharb
npm/jsonify@0.0.1 None 0 19.4 kB ljharb
npm/keyv@4.5.3 None 0 27.8 kB jaredwray
npm/kind-of@6.0.3 None 0 22.8 kB doowb
npm/klaw-sync@6.0.0 None 0 10.4 kB manidlou
npm/libbase64@0.1.0 None 0 8.78 kB andris
npm/libmime@2.1.3 None +1 471 kB andris
npm/libqp@1.1.0 None 0 12.9 kB andris
npm/make-iterator@1.0.1 None 0 8.7 kB jonschlinkert
npm/map-visit@1.0.0 None 0 8.47 kB jonschlinkert
npm/mime@1.6.0 environment, filesystem 0 51.7 kB broofa
npm/mimic-response@3.1.0 None 0 6 kB sindresorhus
npm/mixin-deep@1.3.2 None 0 7.22 kB doowb
npm/monaco-editor-webpack-plugin@7.0.1 filesystem 0 23.8 kB alexandrudima
npm/monaco-editor@0.33.0 environment 0 77.3 MB alexandrudima
npm/nanomatch@1.2.13 None 0 86.3 kB jonschlinkert
npm/nodemailer-fetch@1.6.0 network 0 50.5 kB andris
npm/nodemailer-shared@1.1.0 filesystem, network 0 22.6 kB andris
npm/normalize-url@6.1.0 None 0 21.2 kB sindresorhus
npm/object-copy@0.1.0 None 0 5.47 kB jonschlinkert
npm/object-keys@1.1.1 None 0 26.5 kB ljharb
npm/object-visit@1.0.1 None 0 6.7 kB jonschlinkert
npm/object.defaults@1.1.0 None 0 6.53 kB phated
npm/openapi-fetch@0.9.3 network 0 107 kB drewpowers
npm/openapi-typescript-helpers@0.0.7 None 0 17.5 kB drewpowers
npm/openapi-typescript@6.7.5 Transitive: environment, filesystem +3 655 kB drewpowers
npm/p-limit@3.1.0 None 0 7.75 kB sindresorhus
npm/p-locate@5.0.0 None 0 7.24 kB sindresorhus
npm/p-try@2.2.0 None 0 4.37 kB sindresorhus
npm/packet-reader@1.0.0 None 0 10 kB brianc
npm/parse-filepath@1.0.2 None 0 7.92 kB phated
npm/parse-passwd@1.0.0 None 0 5.96 kB doowb
npm/pascalcase@0.1.1 None 0 4.46 kB jonschlinkert
npm/patch-package@8.0.0 environment, filesystem Transitive: shell +2 582 kB ds300

🚮 Removed packages: npm/path-case@2.1.1, npm/path-exists@4.0.0, npm/path-is-absolute@1.0.1, npm/path-parse@1.0.7, npm/path-to-regexp@6.2.1, npm/path-type@4.0.0, npm/pause@0.0.1, npm/pg-connection-string@2.6.1, npm/picocolors@1.0.0, npm/pkg-dir@4.2.0, npm/plop@2.7.6, npm/pony-cause@2.1.10, npm/postcss-modules-extract-imports@3.0.0, npm/postcss-modules-local-by-default@4.0.3, npm/postcss-modules-scope@3.0.0, npm/postcss-modules-values@4.0.0, npm/prebuild-install@7.1.1, npm/prettier@2.8.4, npm/pretty-error@4.0.0, npm/pretty-time@1.1.0, npm/property-expr@2.0.5, npm/proxy-addr@2.0.7, npm/proxy-from-env@1.1.0, npm/pump@3.0.0, npm/purest@4.0.2, npm/qs@6.11.1, npm/raw-body@2.5.2, npm/react-dnd-html5-backend@15.1.3, npm/react-dnd@15.1.2, npm/react-dom@18.2.0, npm/react-error-boundary@3.1.4, npm/react-fast-compare@2.0.4, npm/react-helmet@6.1.0, npm/react-intl@6.4.1, npm/react-query@3.39.3, npm/react-redux@8.1.1, npm/react-refresh@0.14.0, npm/react-remove-scroll-bar@2.3.4, npm/react-remove-scroll@2.5.6, npm/react-router-dom@5.3.4, npm/react-router@5.3.4, npm/react-select@5.7.0, npm/react-side-effect@2.1.2, npm/react-style-singleton@2.2.1, npm/react-transition-group@4.4.5, npm/react-window@1.8.8, npm/react@18.2.0, npm/readdirp@3.6.0, npm/rechoir@0.8.0, npm/redux@4.2.1, npm/regenerator-runtime@0.14.0, npm/registry-auth-token@4.2.2, npm/registry-url@5.1.0, npm/relateurl@0.2.7, npm/remove-accents@0.4.2, npm/renderkid@3.0.0, npm/request-compose@2.1.6, npm/request-ip@3.3.0, npm/request-multipart@1.0.0, npm/request-oauth@1.0.1, npm/require-directory@2.1.1, npm/reselect@4.1.7, npm/resolve-cwd@3.0.0, npm/resolve-from@4.0.0, npm/resolve-path@1.4.0, npm/resolve-pathname@3.0.0, npm/resolve@1.22.4, npm/responselike@2.0.1, npm/restore-cursor@3.1.0, npm/retry@0.13.1, npm/rimraf@3.0.2, npm/run-async@2.4.1, npm/rxjs@7.8.1, npm/safe-buffer@5.2.1, npm/safe-stable-stringify@2.4.3, npm/safer-buffer@2.1.2, npm/sanitize-html@2.11.0, npm/scheduler@0.23.0, npm/select-hose@2.0.0, npm/selfsigned@2.1.1, npm/semver@7.5.4, npm/send@0.18.0, npm/sendmail@1.6.1, npm/sentence-case@2.1.1, npm/serialize-javascript@6.0.1, npm/serve-index@1.9.1, npm/serve-static@1.15.0, npm/setprototypeof@1.2.0, npm/shallowequal@1.1.0, npm/sharp@0.32.0, npm/shebang-command@2.0.0, npm/shebang-regex@3.0.0, npm/shell-quote@1.8.1, npm/side-channel@1.0.4, npm/sift@16.0.1, npm/simple-concat@1.0.1, npm/slash@3.0.0, npm/snake-case@2.1.0, npm/sockjs@0.3.24, npm/sorted-array-functions@1.3.0, npm/source-list-map@2.0.1, npm/source-map-js@1.0.2, npm/source-map@0.5.7, npm/spdy-transport@3.0.0, npm/spdy@4.0.2, npm/stack-trace@0.0.10, npm/stackframe@1.3.4, npm/std-env@3.4.3, npm/stream-chain@2.2.5, npm/stream-json@1.8.0, npm/stream-slice@0.1.2, npm/string-argv@0.3.2, npm/string_decoder@1.3.0, npm/strip-final-newline@2.0.0, npm/style-loader@3.3.1, npm/styled-components@5.3.3, npm/stylis@4.2.0, npm/supports-color@5.5.0, npm/supports-preserve-symlinks-flag@1.0.0, npm/swagger-ui-dist@4.19.0, npm/swap-case@1.1.2, npm/tar-fs@2.1.1, npm/tar-stream@2.2.0, npm/tar@6.1.13, npm/tarn@3.0.2, npm/terser-webpack-plugin@5.3.9, npm/thenify-all@1.6.0, npm/thenify@3.3.1, npm/through2@2.0.5, npm/through@2.3.8, npm/tildify@2.0.0, npm/tiny-invariant@1.3.1, npm/tiny-warning@1.0.3, npm/title-case@2.1.1, npm/tmp@0.0.33, npm/to-fast-properties@2.0.0, npm/to-regex-range@5.0.1, npm/toidentifier@1.0.1, npm/toposort@2.0.2, npm/tr46@0.0.3, npm/triple-beam@1.4.1, npm/tslib@1.14.1, npm/tsscmp@1.0.6, npm/tunnel-agent@0.6.0, npm/type-fest@0.20.2, npm/type-is@1.6.18, npm/typedarray-to-buffer@3.1.5, npm/typescript@5.1.3, npm/uglify-js@3.17.4, npm/umzug@3.2.1, npm/unique-string@2.0.0, npm/universalify@2.0.0, npm/unload@2.2.0, npm/untildify@4.0.0, npm/update-browserslist-db@1.0.11, npm/url-join@4.0.1, npm/use-callback-ref@1.3.0, npm/use-isomorphic-layout-effect@1.1.2, npm/use-sidecar@1.1.2, npm/use-sync-external-store@1.2.0, npm/user-home@1.1.1, npm/util-deprecate@1.0.2, npm/uuid@8.3.2, npm/v8flags@2.1.1, npm/value-equal@1.0.1, npm/vary@1.1.2, npm/w3c-keyname@2.2.8, npm/watchpack@2.4.0, npm/wcwidth@1.0.1, npm/webidl-conversions@3.0.1, npm/webpack-cli@5.1.4, npm/webpack-dev-middleware@5.3.3, npm/webpack-dev-server@4.15.1, npm/webpack-merge@5.9.0, npm/webpack-sources@1.4.3, npm/webpack@5.88.2, npm/webpackbar@5.0.2, npm/whatwg-url@5.0.0, npm/which@2.0.2, npm/widest-line@3.1.0, npm/wildcard@2.0.1, npm/winston-transport@4.5.0, npm/winston@3.10.0, npm/wordwrap@1.0.0, npm/wrap-ansi@7.0.0, npm/wrappy@1.0.2, npm/write-file-atomic@3.0.3, npm/ws@8.13.0, npm/xdg-basedir@4.0.0, npm/xtend@4.0.2, npm/y18n@5.0.8, npm/yallist@4.0.0, npm/yaml@1.10.2, npm/yargs-parser@20.2.9, npm/yargs@16.2.0, npm/ylru@1.3.2, npm/yup@0.32.9

View full report↗︎

"networks": {
"type": "relation",
"relation": "oneToMany",
"target": "api::network.network"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also should be required

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or if not specified then it will be displayed in any network?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly! (actually I forgot to mark required 🙈, but I liked the idea)

Will update the notion page with instructions once it's ready.

@alfetopito alfetopito merged commit 4bc424e into main Dec 16, 2024
3 checks passed
@alfetopito alfetopito deleted the feat/announcements branch December 16, 2024 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants