spec-3nweb-server 1.8.4 → 1.8.6
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.
- package/.gitlab-ci-linux.yml +50 -0
- package/.gitlab-ci-mac.yml +29 -0
- package/.gitlab-ci-windows.yml +29 -0
- package/.gitlab-ci.yml +63 -0
- package/build/3nstorage/routes/owner/archive-obj-version.js +2 -2
- package/build/3nstorage/routes/owner/cancel-trans.js +2 -2
- package/build/3nstorage/routes/owner/delete-obj.js +2 -2
- package/build/3nstorage/routes/owner/get-current-obj.js +3 -4
- package/build/3nstorage/routes/owner/param-setter.js +2 -6
- package/build/asmail/routes/config/param-setter.js +2 -2
- package/build/asmail/routes/delivery/finalize-delivery.js +2 -2
- package/build/asmail/routes/delivery/put-obj.js +2 -2
- package/build/asmail/routes/delivery/sender-authorization.js +2 -2
- package/build/asmail/routes/retrieval/remove-message.js +2 -2
- package/build/cli/signup-cmd.js +0 -1
- package/build/lib-server/routes/sessions/close.js +2 -2
- package/build/lib-server/routes/sessions/mid-auth.js +2 -5
- package/build/main.js +12 -15
- package/build/mock/tls-options.js +46 -44
- package/build/signup/routes/add.js +4 -4
- package/build/tests/admin-proto/signup.d.ts +1 -0
- package/build/tests/admin-proto/signup.js +235 -0
- package/build/tests/jasmine.d.ts +1 -0
- package/build/tests/jasmine.js +32 -0
- package/build/tests/libs-for-tests/3nstorage.d.ts +22 -0
- package/build/tests/libs-for-tests/3nstorage.js +123 -0
- package/build/tests/libs-for-tests/asmail.d.ts +22 -0
- package/build/tests/libs-for-tests/asmail.js +179 -0
- package/build/tests/libs-for-tests/assert.d.ts +1 -0
- package/build/tests/libs-for-tests/assert.js +26 -0
- package/build/tests/libs-for-tests/async-jasmine.d.ts +7 -0
- package/build/tests/libs-for-tests/async-jasmine.js +77 -0
- package/build/tests/libs-for-tests/bytes-equal.d.ts +1 -0
- package/build/tests/libs-for-tests/bytes-equal.js +34 -0
- package/build/tests/libs-for-tests/json-copy.d.ts +1 -0
- package/build/tests/libs-for-tests/json-copy.js +45 -0
- package/build/tests/libs-for-tests/json-equal.d.ts +4 -0
- package/build/tests/libs-for-tests/json-equal.js +67 -0
- package/build/tests/libs-for-tests/mailerid.d.ts +13 -0
- package/build/tests/libs-for-tests/mailerid.js +114 -0
- package/build/tests/libs-for-tests/pkl.d.ts +28 -0
- package/build/tests/libs-for-tests/pkl.js +89 -0
- package/build/tests/libs-for-tests/server-components/3nstorage.d.ts +20 -0
- package/build/tests/libs-for-tests/server-components/3nstorage.js +200 -0
- package/build/tests/libs-for-tests/server-components/admin.d.ts +6 -0
- package/build/tests/libs-for-tests/server-components/admin.js +43 -0
- package/build/tests/libs-for-tests/server-components/asmail.d.ts +16 -0
- package/build/tests/libs-for-tests/server-components/asmail.js +143 -0
- package/build/tests/libs-for-tests/server-components/component.d.ts +13 -0
- package/build/tests/libs-for-tests/server-components/component.js +77 -0
- package/build/tests/libs-for-tests/server-components/mailerid.d.ts +10 -0
- package/build/tests/libs-for-tests/server-components/mailerid.js +103 -0
- package/build/tests/libs-for-tests/server-runner.d.ts +15 -0
- package/build/tests/libs-for-tests/server-runner.js +69 -0
- package/build/tests/libs-for-tests/spec-assembly.d.ts +6 -0
- package/build/tests/libs-for-tests/spec-assembly.js +55 -0
- package/build/tests/libs-for-tests/ws-utils.d.ts +3 -0
- package/build/tests/libs-for-tests/ws-utils.js +59 -0
- package/build/tests/libs-for-tests/xhr-utils.d.ts +61 -0
- package/build/tests/libs-for-tests/xhr-utils.js +154 -0
- package/build/tests/protocols/3nstorage/owner/specs/archive-obj-ver.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/archive-obj-ver.js +84 -0
- package/build/tests/protocols/3nstorage/owner/specs/archive-root-ver.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/archive-root-ver.js +78 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-archive-obj-ver.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-archive-obj-ver.js +83 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-archive-root-ver.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-archive-root-ver.js +77 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-obj.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/delete-obj.js +75 -0
- package/build/tests/protocols/3nstorage/owner/specs/events.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/events.js +91 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-current-obj.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-current-obj.js +269 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-current-root.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-current-root.js +262 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-obj-status.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-obj-status.js +79 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-root-status.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/get-root-status.js +72 -0
- package/build/tests/protocols/3nstorage/owner/specs/put-current-obj.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/put-current-obj.js +287 -0
- package/build/tests/protocols/3nstorage/owner/specs/put-current-root.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/put-current-root.js +274 -0
- package/build/tests/protocols/3nstorage/owner/specs/trans-cancel-root.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/trans-cancel-root.js +73 -0
- package/build/tests/protocols/3nstorage/owner/specs/trans-cancel.d.ts +2 -0
- package/build/tests/protocols/3nstorage/owner/specs/trans-cancel.js +72 -0
- package/build/tests/protocols/3nstorage/owner/test-utils.d.ts +14 -0
- package/build/tests/protocols/3nstorage/owner/test-utils.js +54 -0
- package/build/tests/protocols/3nstorage/owner.d.ts +1 -0
- package/build/tests/protocols/3nstorage/owner.js +138 -0
- package/build/tests/protocols/asmail/config.d.ts +1 -0
- package/build/tests/protocols/asmail/config.js +117 -0
- package/build/tests/protocols/asmail/delivery/specs/finalize-delivery.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/finalize-delivery.js +60 -0
- package/build/tests/protocols/asmail/delivery/specs/provide-recipient-pubkey.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/provide-recipient-pubkey.js +68 -0
- package/build/tests/protocols/asmail/delivery/specs/put-metadata.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/put-metadata.js +83 -0
- package/build/tests/protocols/asmail/delivery/specs/put-obj.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/put-obj.js +123 -0
- package/build/tests/protocols/asmail/delivery/specs/restart-session.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/restart-session.js +79 -0
- package/build/tests/protocols/asmail/delivery/specs/start-session.d.ts +2 -0
- package/build/tests/protocols/asmail/delivery/specs/start-session.js +64 -0
- package/build/tests/protocols/asmail/delivery/test-utils.d.ts +16 -0
- package/build/tests/protocols/asmail/delivery/test-utils.js +46 -0
- package/build/tests/protocols/asmail/delivery.d.ts +1 -0
- package/build/tests/protocols/asmail/delivery.js +46 -0
- package/build/tests/protocols/asmail/retrieval/specs/events.d.ts +2 -0
- package/build/tests/protocols/asmail/retrieval/specs/events.js +62 -0
- package/build/tests/protocols/asmail/retrieval/specs/get-message-meta.d.ts +2 -0
- package/build/tests/protocols/asmail/retrieval/specs/get-message-meta.js +70 -0
- package/build/tests/protocols/asmail/retrieval/specs/get-message-obj.d.ts +2 -0
- package/build/tests/protocols/asmail/retrieval/specs/get-message-obj.js +166 -0
- package/build/tests/protocols/asmail/retrieval/specs/list-messages.d.ts +2 -0
- package/build/tests/protocols/asmail/retrieval/specs/list-messages.js +96 -0
- package/build/tests/protocols/asmail/retrieval/specs/remove-message.d.ts +2 -0
- package/build/tests/protocols/asmail/retrieval/specs/remove-message.js +66 -0
- package/build/tests/protocols/asmail/retrieval/test-utils.d.ts +17 -0
- package/build/tests/protocols/asmail/retrieval/test-utils.js +46 -0
- package/build/tests/protocols/asmail/retrieval.d.ts +1 -0
- package/build/tests/protocols/asmail/retrieval.js +92 -0
- package/build/tests/protocols/mailerid.d.ts +1 -0
- package/build/tests/protocols/mailerid.js +210 -0
- package/build/tests/shared-checks/check-mid-login.d.ts +2 -0
- package/build/tests/shared-checks/check-mid-login.js +131 -0
- package/build/tests/shared-checks/requests.d.ts +20 -0
- package/build/tests/shared-checks/requests.js +123 -0
- package/package.json +1 -1
- package/packing/create-deb.sh +57 -0
- package/packing/deb/lib/systemd/system/3nweb.service +11 -0
- package/packing/deb/postinst +44 -0
- package/packing/deb/usr/share/doc/3nweb-server/conf-for-postinstall.yaml +19 -0
- package/packing/deb/usr/share/doc/3nweb-server/copyright +22 -0
- package/publish-task.sh +10 -0
- package/push-to-github.sh +105 -0
- package/ts-code/3nstorage/3nstorage-app.ts +99 -0
- package/ts-code/3nstorage/owner.ts +178 -0
- package/ts-code/3nstorage/resources/sessions.ts +37 -0
- package/ts-code/3nstorage/resources/store.ts +896 -0
- package/ts-code/3nstorage/resources/users.ts +258 -0
- package/ts-code/3nstorage/routes/owner/archive-obj-version.ts +73 -0
- package/ts-code/3nstorage/routes/owner/cancel-trans.ts +58 -0
- package/ts-code/3nstorage/routes/owner/delete-obj.ts +103 -0
- package/ts-code/3nstorage/routes/owner/get-archived-obj-ver.ts +111 -0
- package/ts-code/3nstorage/routes/owner/get-current-obj.ts +122 -0
- package/ts-code/3nstorage/routes/owner/get-obj-status.ts +55 -0
- package/ts-code/3nstorage/routes/owner/param-getter.ts +51 -0
- package/ts-code/3nstorage/routes/owner/param-setter.ts +50 -0
- package/ts-code/3nstorage/routes/owner/put-current-obj.ts +284 -0
- package/ts-code/3nstorage/routes/owner/session-params.ts +49 -0
- package/ts-code/3nstorage/shared.ts +43 -0
- package/ts-code/asmail/asmail-app.ts +91 -0
- package/ts-code/asmail/config.ts +96 -0
- package/ts-code/asmail/delivery.ts +94 -0
- package/ts-code/asmail/resources/delivery-sessions.ts +118 -0
- package/ts-code/asmail/resources/inbox.ts +696 -0
- package/ts-code/asmail/resources/recipients.ts +495 -0
- package/ts-code/asmail/resources/sessions.ts +37 -0
- package/ts-code/asmail/retrieval.ts +96 -0
- package/ts-code/asmail/routes/config/param-getter.ts +49 -0
- package/ts-code/asmail/routes/config/param-setter.ts +49 -0
- package/ts-code/asmail/routes/delivery/finalize-delivery.ts +50 -0
- package/ts-code/asmail/routes/delivery/pre-flight.ts +132 -0
- package/ts-code/asmail/routes/delivery/provide-recipient-pubkey.ts +58 -0
- package/ts-code/asmail/routes/delivery/put-metadata.ts +94 -0
- package/ts-code/asmail/routes/delivery/put-obj.ts +166 -0
- package/ts-code/asmail/routes/delivery/restart-session.ts +130 -0
- package/ts-code/asmail/routes/delivery/sender-authorization.ts +81 -0
- package/ts-code/asmail/routes/delivery/start-session.ts +151 -0
- package/ts-code/asmail/routes/retrieval/get-message-meta.ts +53 -0
- package/ts-code/asmail/routes/retrieval/get-message-obj.ts +109 -0
- package/ts-code/asmail/routes/retrieval/list-messages.ts +70 -0
- package/ts-code/asmail/routes/retrieval/remove-message.ts +47 -0
- package/ts-code/cli/index.ts +82 -0
- package/ts-code/cli/run-cmd.ts +81 -0
- package/ts-code/cli/show-sample-config.ts +78 -0
- package/ts-code/cli/signup-cmd.ts +229 -0
- package/ts-code/cli/user-cmd.ts +68 -0
- package/ts-code/cli/utils.ts +105 -0
- package/ts-code/config/default-confs.ts +22 -0
- package/ts-code/config/from-yaml.ts +35 -0
- package/ts-code/config/letsencrypt.ts +77 -0
- package/ts-code/config/signup.ts +137 -0
- package/ts-code/lib-common/admin-api/signup.ts +120 -0
- package/ts-code/lib-common/assert.ts +22 -0
- package/ts-code/lib-common/async-fs-node.ts +656 -0
- package/ts-code/lib-common/buffer-utils.ts +124 -0
- package/ts-code/lib-common/byte-streaming/common.ts +166 -0
- package/ts-code/lib-common/bytes-equal.ts +25 -0
- package/ts-code/lib-common/canonical-address.ts +92 -0
- package/ts-code/lib-common/exceptions/error.ts +44 -0
- package/ts-code/lib-common/exceptions/file.ts +84 -0
- package/ts-code/lib-common/exceptions/http.ts +69 -0
- package/ts-code/lib-common/ipc/generic-ipc.ts +750 -0
- package/ts-code/lib-common/ipc/ws-ipc.ts +117 -0
- package/ts-code/lib-common/json-equal.ts +55 -0
- package/ts-code/lib-common/json-utils.ts +130 -0
- package/ts-code/lib-common/jwkeys.ts +246 -0
- package/ts-code/lib-common/map-of-sets.ts +60 -0
- package/ts-code/lib-common/mid-sigs-NaCl-Ed.ts +677 -0
- package/ts-code/lib-common/objs-on-disk/file-layout.ts +480 -0
- package/ts-code/lib-common/objs-on-disk/obj-file.ts +325 -0
- package/ts-code/lib-common/objs-on-disk/utils.ts +201 -0
- package/ts-code/lib-common/objs-on-disk/v1-obj-file-format.ts +329 -0
- package/ts-code/lib-common/processes.ts +501 -0
- package/ts-code/lib-common/random-node.ts +79 -0
- package/ts-code/lib-common/service-api/3nstorage/owner.ts +559 -0
- package/ts-code/lib-common/service-api/3nstorage/root-route.ts +22 -0
- package/ts-code/lib-common/service-api/asmail/config.ts +144 -0
- package/ts-code/lib-common/service-api/asmail/delivery.ts +250 -0
- package/ts-code/lib-common/service-api/asmail/retrieval.ts +238 -0
- package/ts-code/lib-common/service-api/asmail/root-route.ts +22 -0
- package/ts-code/lib-common/service-api/ipc-api.ts +44 -0
- package/ts-code/lib-common/service-api/locker.ts +44 -0
- package/ts-code/lib-common/service-api/mailer-id/login.ts +80 -0
- package/ts-code/lib-common/service-api/mailer-id/provisioning.ts +64 -0
- package/ts-code/lib-common/service-api/mailer-id/root-route.ts +25 -0
- package/ts-code/lib-common/service-api/pub-key-login.ts +75 -0
- package/ts-code/lib-common/service-api/web-socket-base.ts +87 -0
- package/ts-code/lib-common/session-encryptor.ts +54 -0
- package/ts-code/lib-common/time-window-cache.ts +74 -0
- package/ts-code/lib-common/transferable.d.ts +30 -0
- package/ts-code/lib-server/conf-util.ts +35 -0
- package/ts-code/lib-server/mid-access.ts +45 -0
- package/ts-code/lib-server/middleware/body-parsers.ts +248 -0
- package/ts-code/lib-server/middleware/error-handler.ts +79 -0
- package/ts-code/lib-server/pkl-access.ts +46 -0
- package/ts-code/lib-server/resources/dns.ts +151 -0
- package/ts-code/lib-server/resources/mailerid-authorizer.ts +115 -0
- package/ts-code/lib-server/resources/mem-backed-sessions-factory.ts +132 -0
- package/ts-code/lib-server/resources/server-data-folders.ts +160 -0
- package/ts-code/lib-server/resources/server-key-for-pkl-challenge.ts +41 -0
- package/ts-code/lib-server/resources/sessions.ts +232 -0
- package/ts-code/lib-server/resources/user-files.ts +147 -0
- package/ts-code/lib-server/routes/pub-key-login/complete-exchange.ts +63 -0
- package/ts-code/lib-server/routes/pub-key-login/start-exchange.ts +189 -0
- package/ts-code/lib-server/routes/sessions/close.ts +27 -0
- package/ts-code/lib-server/routes/sessions/mid-auth.ts +77 -0
- package/ts-code/lib-server/routes/sessions/start.ts +116 -0
- package/ts-code/lib-server/web-sockets/app.ts +339 -0
- package/ts-code/lib-server/web-sockets/server-events.ts +63 -0
- package/ts-code/lib.ts +29 -0
- package/ts-code/locker/locker-app.ts +60 -0
- package/ts-code/locker/resources/lockers.ts +17 -0
- package/ts-code/locker/resources/sessions.ts +37 -0
- package/ts-code/locker/routes/create-locker.ts +47 -0
- package/ts-code/mailerId/mailerId-app.ts +107 -0
- package/ts-code/mailerId/resources/certifier.ts +181 -0
- package/ts-code/mailerId/resources/sessions.ts +44 -0
- package/ts-code/mailerId/resources/users.ts +88 -0
- package/ts-code/mailerId/routes/certify.ts +68 -0
- package/ts-code/main.ts +304 -0
- package/ts-code/mock/dns.ts +106 -0
- package/ts-code/mock/mock-as-child-proc.ts +130 -0
- package/ts-code/mock/node-child-ipc.ts +69 -0
- package/ts-code/mock/run-in-proc.ts +111 -0
- package/ts-code/mock/tls-options.ts +73 -0
- package/ts-code/services.ts +138 -0
- package/ts-code/signup/resources/users.ts +429 -0
- package/ts-code/signup/routes/add.ts +65 -0
- package/ts-code/signup/routes/get-available-addresses.ts +49 -0
- package/ts-code/signup/routes/get-available-domains.ts +45 -0
- package/ts-code/signup/signup-app.ts +54 -0
- package/ts-code/signup/signup-tokens.ts +148 -0
- package/ts-code/tests/admin-proto/signup.ts +277 -0
- package/ts-code/tests/jasmine.ts +37 -0
- package/ts-code/tests/libs-for-tests/3nstorage.ts +144 -0
- package/ts-code/tests/libs-for-tests/asmail.ts +220 -0
- package/ts-code/tests/libs-for-tests/assert.ts +22 -0
- package/ts-code/tests/libs-for-tests/async-jasmine.ts +89 -0
- package/ts-code/tests/libs-for-tests/bytes-equal.ts +25 -0
- package/ts-code/tests/libs-for-tests/json-copy.ts +38 -0
- package/ts-code/tests/libs-for-tests/json-equal.ts +55 -0
- package/ts-code/tests/libs-for-tests/mailerid.ts +123 -0
- package/ts-code/tests/libs-for-tests/pkl.ts +127 -0
- package/ts-code/tests/libs-for-tests/server-components/3nstorage.ts +206 -0
- package/ts-code/tests/libs-for-tests/server-components/admin.ts +49 -0
- package/ts-code/tests/libs-for-tests/server-components/asmail.ts +152 -0
- package/ts-code/tests/libs-for-tests/server-components/component.ts +90 -0
- package/ts-code/tests/libs-for-tests/server-components/mailerid.ts +114 -0
- package/ts-code/tests/libs-for-tests/server-runner.ts +82 -0
- package/ts-code/tests/libs-for-tests/spec-assembly.ts +60 -0
- package/ts-code/tests/libs-for-tests/ws-utils.ts +61 -0
- package/ts-code/tests/libs-for-tests/xhr-utils.ts +179 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/archive-obj-ver.ts +100 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/archive-root-ver.ts +91 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/delete-archive-obj-ver.ts +99 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/delete-archive-root-ver.ts +90 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/delete-obj.ts +84 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/events.ts +125 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/get-current-obj.ts +298 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/get-current-root.ts +290 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/get-obj-status.ts +88 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/get-root-status.ts +80 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/put-current-obj.ts +366 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/put-current-root.ts +329 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/trans-cancel-root.ts +86 -0
- package/ts-code/tests/protocols/3nstorage/owner/specs/trans-cancel.ts +86 -0
- package/ts-code/tests/protocols/3nstorage/owner/test-utils.ts +72 -0
- package/ts-code/tests/protocols/3nstorage/owner.ts +198 -0
- package/ts-code/tests/protocols/asmail/config.ts +172 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/finalize-delivery.ts +69 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/provide-recipient-pubkey.ts +88 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/put-metadata.ts +102 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/put-obj.ts +156 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/restart-session.ts +97 -0
- package/ts-code/tests/protocols/asmail/delivery/specs/start-session.ts +79 -0
- package/ts-code/tests/protocols/asmail/delivery/test-utils.ts +64 -0
- package/ts-code/tests/protocols/asmail/delivery.ts +56 -0
- package/ts-code/tests/protocols/asmail/retrieval/specs/events.ts +78 -0
- package/ts-code/tests/protocols/asmail/retrieval/specs/get-message-meta.ts +80 -0
- package/ts-code/tests/protocols/asmail/retrieval/specs/get-message-obj.ts +197 -0
- package/ts-code/tests/protocols/asmail/retrieval/specs/list-messages.ts +110 -0
- package/ts-code/tests/protocols/asmail/retrieval/specs/remove-message.ts +74 -0
- package/ts-code/tests/protocols/asmail/retrieval/test-utils.ts +60 -0
- package/ts-code/tests/protocols/asmail/retrieval.ts +115 -0
- package/ts-code/tests/protocols/mailerid.ts +271 -0
- package/ts-code/tests/shared-checks/check-mid-login.ts +164 -0
- package/ts-code/tests/shared-checks/requests.ts +135 -0
- package/ts-code/tsconfig.json +11 -0
- package/ts-code/web3n.d.ts +1068 -0
|
@@ -0,0 +1,559 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2015 - 2017, 2019, 2022 3NSoft Inc.
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful, but
|
|
10
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
See the GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License along with
|
|
15
|
+
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This defines interfaces for 3nstorage owner's requests.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import * as midApi from '../mailer-id/login';
|
|
23
|
+
import { stringify as stringifyOpts } from 'querystring';
|
|
24
|
+
|
|
25
|
+
export const ERR_SC = {
|
|
26
|
+
malformed: 400,
|
|
27
|
+
needAuth: midApi.ERR_SC.needAuth,
|
|
28
|
+
server: 500,
|
|
29
|
+
contentTooLong: 413,
|
|
30
|
+
contentLenMissing: 411,
|
|
31
|
+
wrongContentType: 415,
|
|
32
|
+
noSpace: 480
|
|
33
|
+
};
|
|
34
|
+
Object.freeze(ERR_SC);
|
|
35
|
+
|
|
36
|
+
export const HTTP_HEADER = {
|
|
37
|
+
contentType: 'Content-Type',
|
|
38
|
+
contentLength: 'Content-Length',
|
|
39
|
+
objVersion: 'X-Obj-Version',
|
|
40
|
+
objDiffLength: 'X-Obj-Diff-Length',
|
|
41
|
+
objHeaderLength: 'X-Obj-Header-Length',
|
|
42
|
+
objSegmentsLength: 'X-Obj-Segments-Length',
|
|
43
|
+
}
|
|
44
|
+
Object.freeze(HTTP_HEADER);
|
|
45
|
+
|
|
46
|
+
export const BIN_TYPE = 'application/octet-stream';
|
|
47
|
+
|
|
48
|
+
export namespace midLogin {
|
|
49
|
+
|
|
50
|
+
export const URL_PART = 'login/mailerid/';
|
|
51
|
+
|
|
52
|
+
}
|
|
53
|
+
Object.freeze(closeSession);
|
|
54
|
+
|
|
55
|
+
export namespace closeSession {
|
|
56
|
+
|
|
57
|
+
export const URL_END = 'session/close';
|
|
58
|
+
|
|
59
|
+
}
|
|
60
|
+
Object.freeze(closeSession);
|
|
61
|
+
|
|
62
|
+
export namespace sessionParams {
|
|
63
|
+
|
|
64
|
+
export const URL_END = 'session/params';
|
|
65
|
+
|
|
66
|
+
export interface Reply {
|
|
67
|
+
maxChunkSize: number;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export const SC = {
|
|
71
|
+
ok: 200,
|
|
72
|
+
};
|
|
73
|
+
Object.freeze(SC);
|
|
74
|
+
|
|
75
|
+
}
|
|
76
|
+
Object.freeze(sessionParams);
|
|
77
|
+
|
|
78
|
+
export const PARAM_SC = {
|
|
79
|
+
ok: 200
|
|
80
|
+
};
|
|
81
|
+
Object.freeze(PARAM_SC);
|
|
82
|
+
|
|
83
|
+
export namespace keyDerivParams {
|
|
84
|
+
|
|
85
|
+
export const URL_END = 'param/key-deriv';
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
Object.freeze(keyDerivParams);
|
|
89
|
+
|
|
90
|
+
export interface GetObjQueryOpts {
|
|
91
|
+
/**
|
|
92
|
+
* This is a boolean flag, which true value indicates that header should be
|
|
93
|
+
* present in a response. If it is false, or is not present, header is not
|
|
94
|
+
* included in a reply.
|
|
95
|
+
*/
|
|
96
|
+
header?: boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* This is an offset into segments. If it is not present, zero is assumed.
|
|
100
|
+
* This field must be zero or missing, when header is true.
|
|
101
|
+
*/
|
|
102
|
+
ofs?: number;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* This is a limit on number of segment bytes to be returned.
|
|
106
|
+
*/
|
|
107
|
+
limit?: number;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* This is a particular object version.
|
|
111
|
+
* This field must be present when getting archived version.
|
|
112
|
+
* When getting current version, this field is optional. If it is present,
|
|
113
|
+
* an error is returned when current version doesn't match a given one. If
|
|
114
|
+
* it is not present, then a current version is unconditionally returned,
|
|
115
|
+
* with http header indicating what this version is.
|
|
116
|
+
*/
|
|
117
|
+
ver?: number;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface PutObjFirstQueryOpts {
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* This parameter is object's new version.
|
|
124
|
+
*/
|
|
125
|
+
ver: number;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* This is a length of diff, if it is sent in a request.
|
|
129
|
+
* Diff must be sent with the first request.
|
|
130
|
+
* Diff is located in http body at the very start.
|
|
131
|
+
*/
|
|
132
|
+
diff?: number;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* This is a length of header, when it is sent in a request.
|
|
136
|
+
* Header must be sent with the first request, located in http body after
|
|
137
|
+
* diff, if it is present, or at body's start.
|
|
138
|
+
*/
|
|
139
|
+
header: number;
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* This field indicates the last request, closing transaction.
|
|
143
|
+
*/
|
|
144
|
+
last?: boolean;
|
|
145
|
+
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface PutObjSecondQueryOpts {
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* This is a transaction id. It is returned by server as a reply to first
|
|
152
|
+
* inconclusive request, and must be present in all subsequent requests.
|
|
153
|
+
*/
|
|
154
|
+
trans: string;
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* This is an offset into segments.
|
|
158
|
+
*/
|
|
159
|
+
ofs: number;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* This field indicates the last request, closing transaction.
|
|
163
|
+
*/
|
|
164
|
+
last?: boolean;
|
|
165
|
+
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export namespace currentObj {
|
|
169
|
+
|
|
170
|
+
export const EXPRESS_URL_END = 'obj/:objId/current';
|
|
171
|
+
|
|
172
|
+
export function getReqUrlEnd(objId: string, opts?: GetObjQueryOpts): string {
|
|
173
|
+
return `obj/${objId}/current${opts ? `?${stringifyOpts(opts as any)}`: ''}`;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function delReqUrlEnd(
|
|
177
|
+
objId: string, ver?: number
|
|
178
|
+
): string {
|
|
179
|
+
return `obj/${objId}/current${ver ? `?${stringifyOpts({ ver })}`: ''}`;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export function firstPutReqUrlEnd(
|
|
183
|
+
objId: string, opts: PutObjFirstQueryOpts
|
|
184
|
+
): string {
|
|
185
|
+
return `obj/${objId}/current?${stringifyOpts(opts as any)}`;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export function secondPutReqUrlEnd(
|
|
189
|
+
objId: string, opts: PutObjSecondQueryOpts
|
|
190
|
+
): string {
|
|
191
|
+
return `obj/${objId}/current?${stringifyOpts(opts as any)}`;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface ReplyToPut {
|
|
195
|
+
/**
|
|
196
|
+
* Transaction id field is present, when transaction hasn't been completed
|
|
197
|
+
* with this request, i.e. if it is still ongoing.
|
|
198
|
+
* This field should be missing, when request
|
|
199
|
+
*/
|
|
200
|
+
transactionId?: string;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export const SC = {
|
|
204
|
+
okGet: 200,
|
|
205
|
+
okDelete: 200,
|
|
206
|
+
okPut: 201,
|
|
207
|
+
objAlreadyExists: 473,
|
|
208
|
+
unknownObj: 474,
|
|
209
|
+
concurrentTransaction: 483,
|
|
210
|
+
unknownTransaction: 484,
|
|
211
|
+
unknownObjVer: 494,
|
|
212
|
+
mismatchedObjVer: 495,
|
|
213
|
+
objIncomplete: 479
|
|
214
|
+
};
|
|
215
|
+
Object.freeze(SC);
|
|
216
|
+
|
|
217
|
+
export type MismatchedObjVerReply = MismatchedObjVerErrReply;
|
|
218
|
+
|
|
219
|
+
}
|
|
220
|
+
Object.freeze(currentObj);
|
|
221
|
+
|
|
222
|
+
export interface MismatchedObjVerErrReply extends ErrorReply {
|
|
223
|
+
current_version: number;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export namespace currentRootObj {
|
|
227
|
+
|
|
228
|
+
export const EXPRESS_URL_END = 'root/current';
|
|
229
|
+
|
|
230
|
+
export function getReqUrlEnd(opts?: GetObjQueryOpts): string {
|
|
231
|
+
return `root/current${opts ? `?${stringifyOpts(opts as any)}`: ''}`;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
export function firstPutReqUrlEnd(opts: PutObjFirstQueryOpts): string {
|
|
235
|
+
return `root/current?${stringifyOpts(opts as any)}`;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export function secondPutReqUrlEnd(opts: PutObjSecondQueryOpts): string {
|
|
239
|
+
return `root/current?${stringifyOpts(opts as any)}`;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
export type ReplyToPut = currentObj.ReplyToPut;
|
|
243
|
+
|
|
244
|
+
export const SC = currentObj.SC;
|
|
245
|
+
|
|
246
|
+
export type MismatchedObjVerReply = currentObj.MismatchedObjVerReply;
|
|
247
|
+
|
|
248
|
+
}
|
|
249
|
+
Object.freeze(currentRootObj);
|
|
250
|
+
|
|
251
|
+
export namespace archivedObjVersion {
|
|
252
|
+
|
|
253
|
+
export const EXPRESS_URL_END = '/obj/:objId/archived';
|
|
254
|
+
|
|
255
|
+
export function getReqUrlEnd(
|
|
256
|
+
objId: string, opts: GetObjQueryOpts
|
|
257
|
+
): string {
|
|
258
|
+
return `/obj/${objId}/archived?${stringifyOpts(opts as any)}`;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export const SC = {
|
|
262
|
+
okGet: 200,
|
|
263
|
+
unknownObj: 474,
|
|
264
|
+
unknownObjVer: 494
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
}
|
|
268
|
+
Object.freeze(archivedObjVersion);
|
|
269
|
+
|
|
270
|
+
export namespace archivedRootVersion {
|
|
271
|
+
|
|
272
|
+
export const EXPRESS_URL_END = 'root/archived';
|
|
273
|
+
|
|
274
|
+
export function getReqUrlEnd(opts: GetObjQueryOpts): string {
|
|
275
|
+
return `root/archived?${stringifyOpts(opts as any)}`;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export const SC = archivedObjVersion.SC;
|
|
279
|
+
|
|
280
|
+
}
|
|
281
|
+
Object.freeze(archivedRootVersion);
|
|
282
|
+
|
|
283
|
+
export interface DiffInfo {
|
|
284
|
+
|
|
285
|
+
/**
|
|
286
|
+
* This is base version for this diff.
|
|
287
|
+
*/
|
|
288
|
+
baseVersion: number;
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* This is a length of segments, calculable from sections.
|
|
292
|
+
*/
|
|
293
|
+
segsSize: number;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Sector is described by number array with three elements:
|
|
297
|
+
* 0th element is 0 for base bytes, and 1 for new bytes;
|
|
298
|
+
* 1st element is an offset in base/new byte array;
|
|
299
|
+
* 2nd element is a length of the sector.
|
|
300
|
+
*/
|
|
301
|
+
sections: [ 0|1, number, number ][];
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* This functions returns either a checked version of given diff object, if it
|
|
306
|
+
* passes as diff, or undefined, otherwise.
|
|
307
|
+
* @param diff is an object that is expected to be diff
|
|
308
|
+
* @param version is diff's object's version
|
|
309
|
+
*/
|
|
310
|
+
export function sanitizedDiff(
|
|
311
|
+
diff: DiffInfo, version: number
|
|
312
|
+
): DiffInfo|undefined {
|
|
313
|
+
if ((typeof diff !== 'object') || (diff === null)) { return; }
|
|
314
|
+
if (!Number.isInteger(diff.baseVersion) || (diff.baseVersion < 1) ||
|
|
315
|
+
(diff.baseVersion >= version)) { return; }
|
|
316
|
+
if (!Array.isArray(diff.sections) || (diff.sections.length < 1)) { return; }
|
|
317
|
+
let expSegs = 0;
|
|
318
|
+
for (const section of diff.sections) {
|
|
319
|
+
if (section.length !== 3) { return; }
|
|
320
|
+
const [ isNew, sOfs, len ] = section;
|
|
321
|
+
if ((isNew !== 0) && (isNew !== 1)) { return; }
|
|
322
|
+
if (!Number.isInteger(sOfs) || (sOfs < 0)) { return; }
|
|
323
|
+
if (!Number.isInteger(len) || (len < 1)) { return; }
|
|
324
|
+
expSegs += len;
|
|
325
|
+
}
|
|
326
|
+
if (diff.segsSize !== expSegs) { return; }
|
|
327
|
+
return {
|
|
328
|
+
baseVersion: diff.baseVersion,
|
|
329
|
+
segsSize: diff.segsSize,
|
|
330
|
+
sections: diff.sections
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export function addDiffSectionTo(
|
|
335
|
+
sections: number[][], newBytes: boolean, srcPos: number, len: number
|
|
336
|
+
): void {
|
|
337
|
+
sections.push([ (newBytes ? 1 : 0), srcPos, len ]);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export namespace cancelTransaction {
|
|
341
|
+
|
|
342
|
+
export const EXPRESS_URL_END = 'obj/:objId/current/cancel-transaction/:transactionId';
|
|
343
|
+
|
|
344
|
+
export function getReqUrlEnd(objId: string, transactionId?: string): string {
|
|
345
|
+
return (transactionId ?
|
|
346
|
+
`obj/${objId}/current/cancel-transaction/${transactionId}` :
|
|
347
|
+
`obj/${objId}/current/cancel-transaction/-`);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export const SC = {
|
|
351
|
+
ok: 200,
|
|
352
|
+
missing: 474
|
|
353
|
+
};
|
|
354
|
+
Object.freeze(SC);
|
|
355
|
+
|
|
356
|
+
}
|
|
357
|
+
Object.freeze(cancelTransaction);
|
|
358
|
+
|
|
359
|
+
export namespace cancelRootTransaction {
|
|
360
|
+
|
|
361
|
+
export const EXPRESS_URL_END = 'root/current/cancel-transaction/:transactionId';
|
|
362
|
+
|
|
363
|
+
export function getReqUrlEnd(transactionId?: string): string {
|
|
364
|
+
return (transactionId ?
|
|
365
|
+
`root/current/cancel-transaction/${transactionId}` :
|
|
366
|
+
`root/current/cancel-transaction/-`);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
export const SC = cancelTransaction.SC;
|
|
370
|
+
|
|
371
|
+
}
|
|
372
|
+
Object.freeze(cancelRootTransaction);
|
|
373
|
+
|
|
374
|
+
export interface ObjStatus {
|
|
375
|
+
current?: number;
|
|
376
|
+
archived?: number[];
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
export namespace objStatus {
|
|
380
|
+
|
|
381
|
+
export const EXPRESS_URL_END = 'obj/:objId/status';
|
|
382
|
+
|
|
383
|
+
export function getReqUrlEnd(objId: string): string {
|
|
384
|
+
return `obj/${objId}/status`;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
export type Reply = ObjStatus;
|
|
388
|
+
|
|
389
|
+
export const SC = {
|
|
390
|
+
ok: 200,
|
|
391
|
+
unknownObj: 474,
|
|
392
|
+
};
|
|
393
|
+
|
|
394
|
+
}
|
|
395
|
+
Object.freeze(objStatus);
|
|
396
|
+
|
|
397
|
+
export namespace rootStatus {
|
|
398
|
+
|
|
399
|
+
export const EXPRESS_URL_END = 'root/status';
|
|
400
|
+
|
|
401
|
+
export function getReqUrlEnd(): string {
|
|
402
|
+
return 'root/status';
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
export type Reply = ObjStatus;
|
|
406
|
+
|
|
407
|
+
export const SC = objStatus.SC;
|
|
408
|
+
|
|
409
|
+
}
|
|
410
|
+
Object.freeze(rootStatus);
|
|
411
|
+
|
|
412
|
+
export namespace archiveObj {
|
|
413
|
+
|
|
414
|
+
export const EXPRESS_URL_END = 'obj/:objId/archive';
|
|
415
|
+
|
|
416
|
+
export function postAndDelReqUrlEnd(objId: string, version: number): string {
|
|
417
|
+
return `obj/${objId}/archive?ver=${version}`;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
export type MismatchedObjVerReply = MismatchedObjVerErrReply;
|
|
421
|
+
|
|
422
|
+
export const SC = {
|
|
423
|
+
okPost: 200,
|
|
424
|
+
okDelete: 200,
|
|
425
|
+
unknownObj: 474,
|
|
426
|
+
unknownObjVer: 494,
|
|
427
|
+
mismatchedObjVer: 495
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
}
|
|
431
|
+
Object.freeze(archiveObj);
|
|
432
|
+
|
|
433
|
+
export namespace archiveRoot {
|
|
434
|
+
|
|
435
|
+
export const EXPRESS_URL_END = 'root/archive';
|
|
436
|
+
|
|
437
|
+
export function postAndDelReqUrlEnd(version: number): string {
|
|
438
|
+
return `root/archive?ver=${version}`;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export type MismatchedObjVerReply = archiveObj.MismatchedObjVerReply;
|
|
442
|
+
|
|
443
|
+
export const SC = archiveObj.SC;
|
|
444
|
+
|
|
445
|
+
}
|
|
446
|
+
Object.freeze(archiveRoot);
|
|
447
|
+
|
|
448
|
+
export interface ErrorReply {
|
|
449
|
+
error: string;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
export namespace wsEventChannel {
|
|
453
|
+
|
|
454
|
+
export const URL_END = 'events';
|
|
455
|
+
|
|
456
|
+
export const SC = {
|
|
457
|
+
ok: 200,
|
|
458
|
+
};
|
|
459
|
+
Object.freeze(SC);
|
|
460
|
+
|
|
461
|
+
}
|
|
462
|
+
Object.freeze(wsEventChannel);
|
|
463
|
+
|
|
464
|
+
export namespace events {
|
|
465
|
+
|
|
466
|
+
export namespace objChanged {
|
|
467
|
+
|
|
468
|
+
export const EVENT_NAME = 'obj-changed';
|
|
469
|
+
|
|
470
|
+
export interface Event {
|
|
471
|
+
/**
|
|
472
|
+
* This indentifies a non-root object by its string id, while null
|
|
473
|
+
* value identifies root object.
|
|
474
|
+
*/
|
|
475
|
+
objId: string|null;
|
|
476
|
+
/**
|
|
477
|
+
* New current version on the server.
|
|
478
|
+
*/
|
|
479
|
+
newVer: number;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
}
|
|
483
|
+
Object.freeze(objChanged);
|
|
484
|
+
|
|
485
|
+
export namespace objRemoved {
|
|
486
|
+
|
|
487
|
+
export const EVENT_NAME = 'obj-removed';
|
|
488
|
+
|
|
489
|
+
export interface Event {
|
|
490
|
+
/**
|
|
491
|
+
* This indentifies a removed non-root object by its string id.
|
|
492
|
+
*/
|
|
493
|
+
objId: string;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
}
|
|
497
|
+
Object.freeze(objRemoved);
|
|
498
|
+
|
|
499
|
+
export namespace objVersionArchived {
|
|
500
|
+
|
|
501
|
+
export const EVENT_NAME = 'obj-ver-archived';
|
|
502
|
+
|
|
503
|
+
export interface Event {
|
|
504
|
+
/**
|
|
505
|
+
* This indentifies a non-root object by its string id, while null
|
|
506
|
+
* value identifies root object.
|
|
507
|
+
*/
|
|
508
|
+
objId: string|null;
|
|
509
|
+
/**
|
|
510
|
+
* Version that was set archived on the server.
|
|
511
|
+
*/
|
|
512
|
+
archivedVer: number;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
}
|
|
516
|
+
Object.freeze(objVersionArchived);
|
|
517
|
+
|
|
518
|
+
export namespace objArchivedVersionRemoved {
|
|
519
|
+
|
|
520
|
+
export const EVENT_NAME = 'obj-ver-removed';
|
|
521
|
+
|
|
522
|
+
export interface Event {
|
|
523
|
+
/**
|
|
524
|
+
* This indentifies a non-root object by its string id, while null
|
|
525
|
+
* value identifies root object.
|
|
526
|
+
*/
|
|
527
|
+
objId: string|null;
|
|
528
|
+
/**
|
|
529
|
+
* Archived version that was removed on the server.
|
|
530
|
+
*/
|
|
531
|
+
archivedVer: number;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
}
|
|
535
|
+
Object.freeze(objArchivedVersionRemoved);
|
|
536
|
+
|
|
537
|
+
export const all = [
|
|
538
|
+
objChanged.EVENT_NAME,
|
|
539
|
+
objRemoved.EVENT_NAME,
|
|
540
|
+
objVersionArchived.EVENT_NAME,
|
|
541
|
+
objArchivedVersionRemoved.EVENT_NAME,
|
|
542
|
+
];
|
|
543
|
+
|
|
544
|
+
export type EventNameType =
|
|
545
|
+
(typeof objChanged.EVENT_NAME) |
|
|
546
|
+
(typeof objRemoved.EVENT_NAME) |
|
|
547
|
+
(typeof objVersionArchived.EVENT_NAME) |
|
|
548
|
+
(typeof objArchivedVersionRemoved.EVENT_NAME);
|
|
549
|
+
|
|
550
|
+
export type AllTypes =
|
|
551
|
+
objChanged.Event |
|
|
552
|
+
objRemoved.Event |
|
|
553
|
+
objVersionArchived.Event |
|
|
554
|
+
objArchivedVersionRemoved.Event;
|
|
555
|
+
|
|
556
|
+
}
|
|
557
|
+
Object.freeze(events);
|
|
558
|
+
|
|
559
|
+
Object.freeze(exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2025 3NSoft Inc.
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful, but
|
|
10
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
See the GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License along with
|
|
15
|
+
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
export interface StorageRootRoute {
|
|
19
|
+
owner?: string;
|
|
20
|
+
shared?: string;
|
|
21
|
+
config?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (C) 2015 3NSoft Inc.
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify it under
|
|
5
|
+
the terms of the GNU General Public License as published by the Free Software
|
|
6
|
+
Foundation, either version 3 of the License, or (at your option) any later
|
|
7
|
+
version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful, but
|
|
10
|
+
WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
12
|
+
See the GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License along with
|
|
15
|
+
this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This defines interfaces for mail configuration requests.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
import * as jwk from '../../jwkeys';
|
|
23
|
+
import * as midApi from '../mailer-id/login';
|
|
24
|
+
|
|
25
|
+
export const ERR_SC = {
|
|
26
|
+
malformed: 400,
|
|
27
|
+
needAuth: midApi.ERR_SC.needAuth,
|
|
28
|
+
server: 500
|
|
29
|
+
};
|
|
30
|
+
Object.freeze(ERR_SC);
|
|
31
|
+
|
|
32
|
+
export const PARAM_SC = {
|
|
33
|
+
ok: 200
|
|
34
|
+
};
|
|
35
|
+
Object.freeze(PARAM_SC);
|
|
36
|
+
|
|
37
|
+
export namespace midLogin {
|
|
38
|
+
|
|
39
|
+
export const URL_PART = 'login/mailerid/';
|
|
40
|
+
|
|
41
|
+
}
|
|
42
|
+
Object.freeze(closeSession);
|
|
43
|
+
|
|
44
|
+
export namespace closeSession {
|
|
45
|
+
|
|
46
|
+
export const URL_END = 'close-session';
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
Object.freeze(closeSession);
|
|
50
|
+
|
|
51
|
+
export interface InvitesList {
|
|
52
|
+
[invite: string]: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export namespace p {
|
|
56
|
+
|
|
57
|
+
export namespace initPubKey {
|
|
58
|
+
|
|
59
|
+
export const URL_END = 'param/init-pub-key';
|
|
60
|
+
|
|
61
|
+
export interface Certs {
|
|
62
|
+
pkeyCert: jwk.SignedLoad;
|
|
63
|
+
userCert: jwk.SignedLoad;
|
|
64
|
+
provCert: jwk.SignedLoad;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
}
|
|
68
|
+
Object.freeze(initPubKey);
|
|
69
|
+
|
|
70
|
+
export namespace authSenderPolicy {
|
|
71
|
+
|
|
72
|
+
export const URL_END = 'param/auth-sender/policy';
|
|
73
|
+
|
|
74
|
+
export interface Policy {
|
|
75
|
+
acceptWithInvitesOnly: boolean;
|
|
76
|
+
acceptFromWhiteListOnly: boolean;
|
|
77
|
+
applyBlackList: boolean;
|
|
78
|
+
defaultMsgSize: number;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
}
|
|
82
|
+
Object.freeze(authSenderPolicy);
|
|
83
|
+
|
|
84
|
+
export namespace authSenderWhitelist {
|
|
85
|
+
|
|
86
|
+
export const URL_END = 'param/auth-sender/whitelist';
|
|
87
|
+
|
|
88
|
+
export interface List {
|
|
89
|
+
[address: string]: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
}
|
|
93
|
+
Object.freeze(authSenderWhitelist);
|
|
94
|
+
|
|
95
|
+
export namespace authSenderBlacklist {
|
|
96
|
+
|
|
97
|
+
export const URL_END = 'param/auth-sender/blacklist';
|
|
98
|
+
|
|
99
|
+
export interface List {
|
|
100
|
+
[address: string]: number;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
}
|
|
104
|
+
Object.freeze(authSenderBlacklist);
|
|
105
|
+
|
|
106
|
+
export namespace authSenderInvites {
|
|
107
|
+
|
|
108
|
+
export const URL_END = 'param/auth-sender/invites';
|
|
109
|
+
|
|
110
|
+
export interface List extends InvitesList { }
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
Object.freeze(authSenderInvites);
|
|
114
|
+
|
|
115
|
+
export namespace anonSenderPolicy {
|
|
116
|
+
|
|
117
|
+
export const URL_END = 'param/anon-sender/policy';
|
|
118
|
+
|
|
119
|
+
export interface Policy {
|
|
120
|
+
accept: boolean;
|
|
121
|
+
acceptWithInvitesOnly: boolean;
|
|
122
|
+
defaultMsgSize: number;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
Object.freeze(anonSenderPolicy);
|
|
127
|
+
|
|
128
|
+
export namespace anonSenderInvites {
|
|
129
|
+
|
|
130
|
+
export const URL_END = 'param/anon-sender/invites';
|
|
131
|
+
|
|
132
|
+
export interface List extends InvitesList { }
|
|
133
|
+
|
|
134
|
+
}
|
|
135
|
+
Object.freeze(anonSenderInvites);
|
|
136
|
+
|
|
137
|
+
}
|
|
138
|
+
Object.freeze(p);
|
|
139
|
+
|
|
140
|
+
export interface ErrorReply {
|
|
141
|
+
error: string;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
Object.freeze(exports);
|