21 KiB
@nocobase/app-plugin-notification-example
1.0.0-beta.8
Patch Changes
cf23bfe: Republish every package so thelatestdist-tag points at its current beta release, matchingbeta.- Updated dependencies [
cf23bfe]- @nocobase/app-client@3.0.0-beta.1
- @nocobase/app-plugin-authentication@2.0.0-beta.6
- @nocobase/app-plugin-notification@1.0.0-beta.27
- @nocobase/app-server@2.0.0-beta.4
- @nocobase/db@1.0.0-beta.19
- @nocobase/i18n@1.0.0-beta.7
- @nocobase/service-provider@0.0.2-beta.2
1.0.0-beta.7
Minor Changes
-
c796cb9: Remove the Settings and Dev route surfaces.@nocobase/app-clientno longer exportsdefineSettingsRoutes(),defineDevRoutes(),isAppClientSettingsRouteGroup(),isAppClientDevRouteGroup()or their definition, contribution and registered-route types, and the resolved runtime no longer carriessettingsRouteTree,devRouteTree,settings,settingGroups,devRoutesordevRouteGroups.AppClientSettingsRouteNavigationis renamedAppClientRouteNavigationandAppClientSettingIconis renamedAppClientRouteIcon. A contribution to any parent other thanappnow fails registration with a message that namesdefineAppRoutes(). Plugins contribute no settings or dev pages; an application that wants a configuration page declares it withdefineAppRoutes()in its own navigation, for example under a Settings group.The default and examples templates drop the settings layout, the
/settings/*route, the dev route plumbing, and the Settings and Inbox buttons in the header; the/inboxpage and the inbox block stay. The examples template no longer registers@nocobase/app-plugin-departments-example, which is removed. Upgrading an application means removingdefineSettingsRoutes([])fromclient/routes.ts, thesettingsRouteTreeanddevRouteTreeprops passed toAppRouter, and any settings layout it kept, and moving its own settings pages todefineAppRoutes(). Every package that depends on or peers with@nocobase/app-clientis released again so that its published range accepts3.0.0-beta.0.
Patch Changes
- Updated dependencies [
c796cb9] - Updated dependencies [
c796cb9] - Updated dependencies [
c796cb9] - Updated dependencies [
98e79a5] - Updated dependencies [
fb7b576]- @nocobase/app-server@2.0.0-beta.3
- @nocobase/app-plugin-authentication@2.0.0-beta.3
- @nocobase/app-plugin-notification@1.0.0-beta.25
- @nocobase/app-client@3.0.0-beta.0
- @nocobase/i18n@1.0.0-beta.6
- @nocobase/db@1.0.0-beta.18
- @nocobase/service-provider@0.0.2-beta.1
1.0.0-beta.6
Patch Changes
a6758ec: Point published package repository metadata to nocobase/nocobase while preserving each package's monorepo directory.- Updated dependencies [
487921c]- @nocobase/app-server@2.0.0-beta.2
- @nocobase/app-plugin-authentication@2.0.0-beta.2
- @nocobase/app-client@2.0.0-beta.2
- @nocobase/db@1.0.0-beta.18
- @nocobase/i18n@1.0.0-beta.5
- @nocobase/service-provider@0.0.2-beta.1
- @nocobase/app-plugin-notification@1.0.0-beta.24
1.0.0-beta.5
Patch Changes
be0fbbd: Client code merges class names with thecnpackage instead ofclsxandtailwind-merge, so the plugins declarecnas a peer dependency in their place. The application templates provide it; an application that does not declarecnyet adds it to itsdevDependencies, or the client build cannot resolve these plugins. The AI employee registry itemnocobase-ailistscninstead ofclsxandtailwind-merge, and the authentication plugin drops the two unused development dependencies.b0a5954: A task route given an id that is not a UUID, such as/tasks/missing, answers 403TASK_ACCESS_DENIEDlike a task the caller cannot see, instead of 500 on PostgreSQL, Kingbase and MSSQL, which reject comparing a malformed value with theuuidcolumn where SQLite and MySQL match nothing. An id given in uppercase now names the same task on every dialect, where before it matched only on dialects that compareuuidvalues natively.6162033: Declare@testing-library/user-eventas a development dependency, which the package's tests now use to open menus and selects. Nothing an application installs changes.- Updated dependencies [
37c8d20] - Updated dependencies [
37c8d20] - Updated dependencies [
37c8d20] - Updated dependencies [
bc1e83f] - Updated dependencies [
bc1e83f] - Updated dependencies [
bc1e83f] - Updated dependencies [
bc1e83f] - Updated dependencies [
37c8d20] - Updated dependencies [
37c8d20] - Updated dependencies [
37c8d20] - Updated dependencies [
37c8d20] - Updated dependencies [
37c8d20] - Updated dependencies [
37c8d20] - Updated dependencies [
bc1e83f] - Updated dependencies [
be0fbbd] - Updated dependencies [
bc1e83f] - Updated dependencies [
6993158] - Updated dependencies [
a6796d9] - Updated dependencies [
37c8d20] - Updated dependencies [
37c8d20] - Updated dependencies [
bc1e83f] - Updated dependencies [
37c8d20] - Updated dependencies [
37c8d20] - Updated dependencies [
37c8d20] - Updated dependencies [
37c8d20]- @nocobase/app-client@2.0.0-beta.1
- @nocobase/app-server@2.0.0-beta.1
- @nocobase/app-plugin-authentication@2.0.0-beta.1
- @nocobase/app-plugin-notification@1.0.0-beta.23
- @nocobase/db@1.0.0-beta.18
- @nocobase/i18n@1.0.0-beta.5
- @nocobase/service-provider@0.0.2-beta.1
1.0.0-beta.4
Patch Changes
e123790: Move@nocobase/app-server,@nocobase/app-client,@nocobase/app-plugin-authentication,@nocobase/app-plugin-users,@nocobase/app-plugin-hub,@nocobase/app-plugin-workflowand@nocobase/app-plugin-ai-employeeto the 2.0.0 prerelease line. The HTTP API migration released in 1.0.0-beta.N changed every route and the error body, but in prerelease mode amajorchangeset on a version that is already a1.0.0prerelease only increments the prerelease number, so nothing in the version said the change was breaking. These packages now release as2.0.0-beta.0, and every package that depends on or peers with one of them is released again so that its published range is^2.0.0-beta.0rather than a^1.0.0-betarange the new versions do not satisfy. An application upgrading to these versions upgrades all of them together.- Updated dependencies [
e123790]- @nocobase/app-client@2.0.0-beta.0
- @nocobase/app-plugin-authentication@2.0.0-beta.0
- @nocobase/app-server@2.0.0-beta.0
- @nocobase/app-plugin-notification@1.0.0-beta.22
1.0.0-beta.3
Major Changes
-
21d274c: Move the example plugins' routes onto the HTTP API specification. Every example route now lives under a camelCase namespace, answers{ data }(lists{ data, meta }), validates its input withzod(an invalid request is400 INVALID_INPUTwithfieldViolations, and an unknown body field is rejected), and reports failures in the standard error body with the example's namespace asdomain. Clients branch onerror.reason.@nocobase/app-plugin-repository-example: authentication now guards the data endpoints at their newPOST /api/{name}/{action}paths. Since data endpoints moved from{name}:{action}to{name}/{action}, the middleware registered on the colon paths matched nothing and the endpoints answered anonymous requests.@nocobase/app-plugin-authorization-example:/api/authorization-example/...becomes/api/authorizationExample/.... ThesalesProjectsdata endpoints arePOST /api/authorizationExample/salesProjects/{findMany,findOne,count,updateOne}, and theupdateOneinput check runs again on that path.POST /sales/quotes/:idbecomesPATCH /sales/quotes/:quoteIdandPOST /sales/orders/:id/relationsbecomesPATCH /sales/orders/:orderId/relations; both, andsubmitanddeliver, answer{ data }with the record instead of{ data: { saved: true } }.FORBIDDENis403 PERMISSION_DENIED,STATE_CONFLICTis400 FAILED_PRECONDITIONinstead of409, andDELIVERY_REFERENCE_REQUIREDandINVALID_INPUTare400 INVALID_ARGUMENT. A record outside the caller's scope is still answered403, never404. Every business route now decides the caller's composite action in middleware before it validates the request or looks up the record, so a caller without the action is answered403even for malformed input.GET /sales/projects,/sales/quotesand/sales/ordersanswer{ data: [...], meta: { page, pageSize, total, navigation } }instead of{ data: { items, navigation } }and takepageandpageSize(default 20, at most 100). A relations update accepts onlycarrier,checksandcollaborators(at least one), so any other key, a foreign key such ascarrierIdincluded, is400 INVALID_INPUTinstead of403. Submitting a quote whose stored amount is not positive is400 FAILED_PRECONDITIONwith reasonQUOTE_AMOUNT_REQUIREDand no field violation, instead of400 INVALID_INPUTnamingamount; a reset before the example accounts are seeded is400 FAILED_PRECONDITIONwith reasonEXAMPLE_ACCOUNTS_MISSINGinstead of500.@nocobase/app-plugin-departments-example:/api/departments-example/...becomes/api/departmentsExample/....PUT /departments/:id/activebecomesPOST /departments/:departmentId/activateand/deactivate;PUT /departments/:id/members/:userId/primarybecomesPOST /departments/:departmentId/members/:userId/makePrimary; both answer{ data }with the record.DELETE /departments/:departmentId/members/:userIdanswers204.GET /users?searchbecomesGET /memberCandidates?q&page&pageSize(default 20, at most 100) answering{ data, meta: { page, pageSize, total } }. A missing department or member is404,DEPARTMENT_EXISTSis409 ALREADY_EXISTS, and an unknown parent, manager or user named in the body is400 INVALID_ARGUMENTwith a field violation. The settings check now runs before the path, query and body are validated, so a caller without the Departments settings item is answered403whatever it sent.@nocobase/app-plugin-jobs-example:GET /api/jobs-example/schedulebecomesGET /api/jobsExample/rulesanswering{ data: rules, meta: { total } };POST /api/jobs-example/schedule/:name/start|stopbecomesPOST /api/jobsExample/rules/:ruleName/start|stop, whose body stays optional;GETandPOST /api/jobs-example/jobbecomeGETandPOST /api/jobsExample/tasks, answering{ data: tasks, meta: { total } }and202 { data: task }.UNKNOWN_RULEis404,BUILT_IN_RULEis400 FAILED_PRECONDITION, andINVALID_INTERVALis400 INVALID_ARGUMENT. Starting or stopping a rule changes it for the whole application, so it now requires theupdateaction of the new settings itemjobsExample.schedules, checked before the request is validated; a caller without it is answered403 AUTHORIZATION_DENIED. The example therefore requires@nocobase/app-plugin-authorization.@nocobase/app-plugin-queue-example:GET /api/queue-example?delay=published a job from aGET; it becomesPOST /api/queueExample/greetwith an optional{ "delay": <ms> }body.POST /api/queue-example/digestsbecomesPOST /api/queueExample/digestsanswering202 { data: receipts }, andGET /api/queue-example/deliveriesbecomesGET /api/queueExample/statusanswering{ data: { queue, configKey, deliveries } }.@nocobase/app-plugin-notification-example:/api/notification-example/...becomes/api/notificationExample/..., andGET /usersbecomesGET /assignees, answering{ data, meta: { total } }. A task'screatedAtandupdatedAtare answered as RFC 3339 UTC timestamps with the trailingZ.GET /taskstakespageandpageSize(default 20, at most 100) and answers{ data, meta: { page, pageSize, total } }instead of{ data, total, page, pageSize }. A caller who does not take part in a task is answered403 TASK_ACCESS_DENIED, whether or not the task exists, instead of404 TASK_NOT_FOUND.@nocobase/app-plugin-template-print-example:/api/template-print-example/...becomes/api/templatePrintExample/....GET /invoicesis paged with{ data, meta: { page, pageSize, total } }, andGET /invoices/:invoiceId/print?format=docx|pdfstill answers the file. A missing invoice is404 INVOICE_NOT_FOUNDinstead ofNOT_FOUND, data over the example's output limits is400 FAILED_PRECONDITIONwith reasonOUTPUT_LIMIT_EXCEEDEDinstead of413, access to Sales Quotes is decided before the path and query are validated, and an unavailable PDF converter stays503 PDF_CONVERTER_UNAVAILABLE.@nocobase/app-plugin-file-example: every exposure action,uploadOneanduploadManyincluded, now requires a signed-in user and answers an anonymous request401 AUTHENTICATION_REQUIREDbefore the body is read; they were open to anonymous requests. The example therefore requires@nocobase/app-plugin-authentication. The content routes under eachaccessPathstay public.@nocobase/app-plugin-routes-example:GET /api/routes-examplebecomesGET /api/routesExampleanswering{ data }. The root route/routes-example/rootis unchanged.@nocobase/app-plugin-service-provider-example:GET /api/service-provider-example/statusbecomesGET /api/serviceProviderExample/statusanswering{ data }.@nocobase/app-plugin-skills-example:GET /api/skills-example/noticebecomesGET /api/skillsExample/noticeanswering{ data }, and its Skill says so.@nocobase/app-template-examples: the application's own routes follow the specification too.GET /api/exampleanswers{ data }.GET /api/articlestakesqinstead ofsearch,pageandpageSize(default 20, at most 100) and answers{ data, meta: { page, pageSize, total } };POST /api/articlesanswers201 { data }with the article;PUT /api/articles/:idbecomesPATCH /api/articles/:articleIdanswering{ data }; article ids are strings; a missing article is404 ARTICLE_NOT_FOUND.GET /api/numeric-examplesbecomesGET /api/numericExamples, and itssortFieldandsortDirectionparameters become one AIP-132orderBy, a comma-separated list of field names each optionally followed bydesc, such asorderBy=decimalValue desc,id. The application's own routes report errors in the domainexamplesinstead ofarticlesandnumericExamples, while the analytics and external CRM data endpoints answerDATABASE_UNAVAILABLEin the framework's domainappinstead ofanalyticsandexternalCrm. The analytics and external CRM data endpoints arePOST /api/{name}/{action}, and authentication guards them at those paths again: the middleware registered on the colon paths matched nothing, so they answered anonymous requests. Without a database, every database-backed route answers503 UNAVAILABLEwith reasonDATABASE_UNAVAILABLE.@nocobase/app-template-default: its tests check for the renamed Routes example URL.
Patch Changes
0b933b3: Every hand-written/apiroute of the example plugins and of the examples application now declares itself for the application's OpenAPI document withdescribeRoute(),apiValidator()and the response helpers from@nocobase/app-server/router, and is listed in Swagger UI at/api/swagger/docs. Each example uses its namespace in PascalCase as its tag (such asQueueExample) and anoperationIdof its namespace, a verb and the resource (such asqueueExamplePublishGreeting), with shared response schemas inserver/routes/schemas.ts. Input validation answers exactly as before. The publicGET /api/serviceProviderExample/statusandGET /api/exampledeclaresecurity: [], and the examples application hides the stand-in routes that answer503 DATABASE_UNAVAILABLEwhile it runs without a database. The routes, service provider and Skills examples now depend onzodfor their response schemas. The READMEs describe the pattern, and the repository and file examples note that their data endpoints are documented without a declaration. Each route lists only the error statuses it can produce: the400for invalid input comes from the input validators, so a route lists400only for another reason such as a failed precondition, and one that checks no permission does not list403, so the article, numeric, routes, skills, queue, jobs, notification, practice-context and department-list routes name their statuses one by one instead of spreadingapiErrorResponses. The examples application'sAGENTS.mdandREADME.MDexplain where the Swagger UI and the JSON document are served, that reading them needs a signed-in session or an API key, and that an agent learns the endpoints from the document.be0fbbd: Tests in these plugins and example plugins take their fixtures from@nocobase/app-testingalone: database fixtures such ascreateDatabaseTest(),describeMigration()andexpectCollection()from@nocobase/app-testing/server, and the command runner from@nocobase/app-testing/cli. Each package replaces its@nocobase/db-testingdevelopment dependency with@nocobase/app-testing. Nothing any of them ships changes.be0fbbd: Database tests in these plugins and example plugins take their database from@nocobase/db-testinginstead of configuring an in-memory SQLite database, so they run on SQLite by default and on the databaseNOCOBASE_TEST_DB_DIALECTselects otherwise. Schema assertions that readPRAGMAoutput orsqlite_masterare written withexpectCollection()against Field and Collection names, migration up and down tests usedescribeMigration(), and the SQLite triggers that made a write fail are replaced by spies on the write. Each package replaces its@nocobase/db-sqlitedevelopment dependency with@nocobase/db-testing; nothing any of them ships changes.- Updated dependencies [
21d274c] - Updated dependencies [
21d274c] - Updated dependencies [
299b35a] - Updated dependencies [
463a7a8] - Updated dependencies [
7e5b7d4] - Updated dependencies [
463a7a8] - Updated dependencies [
21d274c] - Updated dependencies [
be0fbbd] - Updated dependencies [
7f9450e] - Updated dependencies [
4403687] - Updated dependencies [
be0fbbd] - Updated dependencies [
463a7a8] - Updated dependencies [
be0fbbd] - Updated dependencies [
7dbc54b] - Updated dependencies [
463a7a8] - Updated dependencies [
be0fbbd] - Updated dependencies [
463a7a8] - Updated dependencies [
7dbc54b] - Updated dependencies [
3f01f61] - Updated dependencies [
21d274c] - Updated dependencies [
21d274c] - Updated dependencies [
21d274c] - Updated dependencies [
be0fbbd] - Updated dependencies [
0b933b3] - Updated dependencies [
0b933b3] - Updated dependencies [
0b933b3] - Updated dependencies [
be0fbbd] - Updated dependencies [
be0fbbd] - Updated dependencies [
21d274c]- @nocobase/app-server@1.0.0-beta.33
- @nocobase/app-client@1.0.0-beta.25
- @nocobase/app-plugin-authentication@1.0.0-beta.25
- @nocobase/db@1.0.0-beta.17
- @nocobase/app-plugin-notification@1.0.0-beta.21
- @nocobase/i18n@1.0.0-beta.5
- @nocobase/service-provider@0.0.2-beta.1
0.1.0-beta.2
Patch Changes
fac3d58: Route the Examples notification card to the task notification example, label its menu group as Notification examples, and explain how users can open message notifications from the top bar.- Updated dependencies [
52f9811] - Updated dependencies [
3d44c4c]- @nocobase/app-plugin-notification@0.1.0-beta.19
- @nocobase/app-server@1.0.0-beta.31
- @nocobase/app-plugin-authentication@1.0.0-beta.24
- @nocobase/app-client@1.0.0-beta.23
- @nocobase/db@1.0.0-beta.16
- @nocobase/i18n@1.0.0-beta.4
- @nocobase/service-provider@0.0.2-beta.1
0.1.0-beta.1
Patch Changes
aec05e1: Improve the notification task example with consistent task forms, server-side pagination, record counts, and responsive inbox error styling.- Updated dependencies [
cda1175] - Updated dependencies [
e286e0d] - Updated dependencies [
4e58fe3] - Updated dependencies [
4e58fe3] - Updated dependencies [
4e58fe3] - Updated dependencies [
4e58fe3] - Updated dependencies [
4e58fe3] - Updated dependencies [
80ef702]- @nocobase/app-plugin-authentication@1.0.0-beta.21
- @nocobase/app-server@1.0.0-beta.25
- @nocobase/db@1.0.0-beta.15
- @nocobase/app-plugin-notification@0.1.0-beta.16
- @nocobase/app-client@1.0.0-beta.19
- @nocobase/i18n@1.0.0-beta.4
- @nocobase/service-provider@0.0.2-beta.1
0.1.0-beta.0
Minor Changes
ffafc2a: Add a runnable task assignment example that persists tasks and sends in-app notifications with task summaries.
Patch Changes
- Updated dependencies [
8f1ead4] - Updated dependencies [
77d34b6] - Updated dependencies [
ffafc2a] - Updated dependencies [
ffafc2a] - Updated dependencies [
ffafc2a] - Updated dependencies [
ffafc2a] - Updated dependencies [
ffafc2a] - Updated dependencies [
ffafc2a] - Updated dependencies [
a1a8690]- @nocobase/db@1.0.0-beta.14
- @nocobase/app-server@1.0.0-beta.24
- @nocobase/app-plugin-notification@0.1.0-beta.15
- @nocobase/app-plugin-authentication@0.1.0-beta.20
0.0.1
Minor Changes
- Add a task assignment example that persists tasks and sends in-app notifications to the selected assignee.