@3sixty/api-models 0.20.0-next.0 → 0.20.0-next.1
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/dist/es/errors/forbiddenError.js.map +1 -1
- package/dist/es/errors/tooManyRequestsError.js.map +1 -1
- package/dist/es/factories/mimeTypeProcessorFactory.js.map +1 -1
- package/dist/es/factories/restClientProcessorFactory.js.map +1 -1
- package/dist/es/factories/restRouteProcessorFactory.js.map +1 -1
- package/dist/es/factories/socketRouteProcessorFactory.js.map +1 -1
- package/dist/es/helpers/httpErrorHelper.js.map +1 -1
- package/dist/es/helpers/httpHeaderHelper.js.map +1 -1
- package/dist/es/helpers/httpParameterHelper.js.map +1 -1
- package/dist/es/helpers/httpUrlHelper.js.map +1 -1
- package/dist/es/index.js +4 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/IHealth.js.map +1 -1
- package/dist/es/models/api/IServerFavIconResponse.js.map +1 -1
- package/dist/es/models/api/IServerHealthResponse.js.map +1 -1
- package/dist/es/models/api/IServerInfoResponse.js.map +1 -1
- package/dist/es/models/api/IServerLivezResponse.js.map +1 -1
- package/dist/es/models/api/IServerReadyzResponse.js.map +1 -1
- package/dist/es/models/api/IServerRootResponse.js.map +1 -1
- package/dist/es/models/api/IServerSpecResponse.js.map +1 -1
- package/dist/es/models/client/IRestClientProcessor.js.map +1 -1
- package/dist/es/models/client/IRestClientProcessorContext.js.map +1 -1
- package/dist/es/models/config/IBaseRestClientConfig.js.map +1 -1
- package/dist/es/models/config/IBaseSocketClientConfig.js.map +1 -1
- package/dist/es/models/healthCategory.js.map +1 -1
- package/dist/es/models/healthStatus.js.map +1 -1
- package/dist/es/models/httpContextIdKeys.js +1 -4
- package/dist/es/models/httpContextIdKeys.js.map +1 -1
- package/dist/es/models/protocol/IHttpRequest.js.map +1 -1
- package/dist/es/models/protocol/IHttpRequestContext.js.map +1 -1
- package/dist/es/models/protocol/IHttpRequestPathParams.js.map +1 -1
- package/dist/es/models/protocol/IHttpRequestQuery.js.map +1 -1
- package/dist/es/models/protocol/IHttpResponse.js.map +1 -1
- package/dist/es/models/protocol/IHttpServerRequest.js.map +1 -1
- package/dist/es/models/protocol/ISocketRequestContext.js.map +1 -1
- package/dist/es/models/protocol/ISocketServerRequest.js.map +1 -1
- package/dist/es/models/requests/INoContentRequest.js.map +1 -1
- package/dist/es/models/responses/errors/IBadRequestResponse.js.map +1 -1
- package/dist/es/models/responses/errors/IConflictResponse.js.map +1 -1
- package/dist/es/models/responses/errors/IForbiddenResponse.js.map +1 -1
- package/dist/es/models/responses/errors/IInternalServerErrorResponse.js.map +1 -1
- package/dist/es/models/responses/errors/INotFoundResponse.js.map +1 -1
- package/dist/es/models/responses/errors/INotImplementedResponse.js.map +1 -1
- package/dist/es/models/responses/errors/ITooManyRequestsResponse.js.map +1 -1
- package/dist/es/models/responses/errors/IUnauthorizedResponse.js.map +1 -1
- package/dist/es/models/responses/errors/IUnprocessableEntityResponse.js.map +1 -1
- package/dist/es/models/responses/success/IAcceptedResponse.js.map +1 -1
- package/dist/es/models/responses/success/ICreatedResponse.js.map +1 -1
- package/dist/es/models/responses/success/INoContentResponse.js.map +1 -1
- package/dist/es/models/responses/success/IOkResponse.js.map +1 -1
- package/dist/es/models/routes/IBaseRoute.js +0 -2
- package/dist/es/models/routes/IBaseRoute.js.map +1 -1
- package/dist/es/models/routes/IBaseRouteEntryPoint.js.map +1 -1
- package/dist/es/models/routes/IRestRoute.js.map +1 -1
- package/dist/es/models/routes/IRestRouteEntryPoint.js.map +1 -1
- package/dist/es/models/routes/IRestRouteExample.js.map +1 -1
- package/dist/es/models/routes/IRestRouteRequestExample.js.map +1 -1
- package/dist/es/models/routes/IRestRouteResponseAttachmentOptions.js.map +1 -1
- package/dist/es/models/routes/IRestRouteResponseExample.js.map +1 -1
- package/dist/es/models/routes/IRestRouteResponseOptions.js.map +1 -1
- package/dist/es/models/routes/IRouteAuthorization.js +4 -0
- package/dist/es/models/routes/IRouteAuthorization.js.map +1 -0
- package/dist/es/models/routes/ISocketRoute.js.map +1 -1
- package/dist/es/models/routes/ISocketRouteEntryPoint.js.map +1 -1
- package/dist/es/models/routes/ITag.js.map +1 -1
- package/dist/es/models/routes/httpBodyLimit.js.map +1 -1
- package/dist/es/models/server/IBaseRouteProcessor.js.map +1 -1
- package/dist/es/models/server/IMimeTypeProcessor.js.map +1 -1
- package/dist/es/models/server/IRestRouteProcessor.js.map +1 -1
- package/dist/es/models/server/ISocketRouteProcessor.js.map +1 -1
- package/dist/es/models/server/IWebServer.js.map +1 -1
- package/dist/es/models/server/IWebServerOptions.js.map +1 -1
- package/dist/es/models/services/IHealthApplicationCallback.js.map +1 -1
- package/dist/es/models/services/IHealthComponent.js.map +1 -1
- package/dist/es/models/services/IHealthProviderComponent.js.map +1 -1
- package/dist/es/models/services/IInformationComponent.js.map +1 -1
- package/dist/es/models/services/IPlatformComponent.js.map +1 -1
- package/dist/es/models/services/IServerInfo.js.map +1 -1
- package/dist/es/models/services/ITenant.js.map +1 -1
- package/dist/es/models/services/ITenantAdminComponent.js.map +1 -1
- package/dist/es/models/services/tenantEventCallback.js +2 -0
- package/dist/es/models/services/tenantEventCallback.js.map +1 -0
- package/dist/es/models/services/tenantEventType.js +21 -0
- package/dist/es/models/services/tenantEventType.js.map +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/models/httpContextIdKeys.d.ts +0 -4
- package/dist/types/models/routes/IBaseRoute.d.ts +12 -3
- package/dist/types/models/routes/IRouteAuthorization.d.ts +17 -0
- package/dist/types/models/server/IBaseRouteProcessor.d.ts +0 -7
- package/dist/types/models/services/IPlatformComponent.d.ts +20 -0
- package/dist/types/models/services/tenantEventCallback.d.ts +6 -0
- package/dist/types/models/services/tenantEventType.d.ts +21 -0
- package/docs/changelog.md +10 -0
- package/docs/reference/classes/ForbiddenError.md +2 -0
- package/docs/reference/classes/HttpParameterHelper.md +4 -4
- package/docs/reference/classes/TooManyRequestsError.md +2 -0
- package/docs/reference/index.md +4 -1
- package/docs/reference/interfaces/IBaseRoute.md +36 -4
- package/docs/reference/interfaces/IBaseRouteEntryPoint.md +1 -1
- package/docs/reference/interfaces/IBaseRouteProcessor.md +6 -18
- package/docs/reference/interfaces/IHttpRequest.md +1 -1
- package/docs/reference/interfaces/IHttpResponse.md +1 -1
- package/docs/reference/interfaces/IHttpServerRequest.md +1 -1
- package/docs/reference/interfaces/IPlatformComponent.md +74 -0
- package/docs/reference/interfaces/IRestRoute.md +43 -7
- package/docs/reference/interfaces/IRestRouteProcessor.md +6 -20
- package/docs/reference/interfaces/IRestRouteRequestExample.md +1 -1
- package/docs/reference/interfaces/IRestRouteResponseExample.md +1 -1
- package/docs/reference/interfaces/IRouteAuthorization.md +27 -0
- package/docs/reference/interfaces/ISocketRoute.md +43 -7
- package/docs/reference/interfaces/ISocketRouteProcessor.md +6 -20
- package/docs/reference/interfaces/ISocketServerRequest.md +1 -1
- package/docs/reference/interfaces/ITenantAdminComponent.md +1 -1
- package/docs/reference/interfaces/IWebServer.md +1 -1
- package/docs/reference/type-aliases/TenantEventCallback.md +20 -0
- package/docs/reference/type-aliases/TenantEventType.md +5 -0
- package/docs/reference/variables/HttpContextIdKeys.md +0 -6
- package/docs/reference/variables/TenantEventType.md +25 -0
- package/package.json +1 -1
- package/dist/es/helpers/scopeHelper.js +0 -46
- package/dist/es/helpers/scopeHelper.js.map +0 -1
- package/dist/types/helpers/scopeHelper.d.ts +0 -27
- package/docs/reference/classes/ScopeHelper.md +0 -88
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forbiddenError.js","
|
|
1
|
+
{"version":3,"file":"forbiddenError.js","sources":["../../../src/errors/forbiddenError.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,SAAS;IAC5C;;OAEG;IACI,MAAM,CAAU,UAAU,GAAW,gBAAgB,CAAC;IAE7D;;;;;;OAMG;IACH,YACC,MAAc,EACd,OAAe,EACf,UAAsC,EACtC,KAAe;QAEf,KAAK,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseError } from \"@3sixty/core\";\n\n\n/**\n * Class to handle errors which are triggered by forbidden actions.\n */\nexport class ForbiddenError extends BaseError {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"ForbiddenError\";\n\n\t/**\n\t * Create a new instance of ForbiddenError.\n\t * @param source The source of the error.\n\t * @param message The message as a code.\n\t * @param properties Any additional information for the error.\n\t * @param cause The cause of the error if we have wrapped another error.\n\t */\n\tconstructor(\n\t\tsource: string,\n\t\tmessage: string,\n\t\tproperties?: { [id: string]: unknown },\n\t\tcause?: unknown\n\t) {\n\t\tsuper(ForbiddenError.CLASS_NAME, source, message, properties, cause);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooManyRequestsError.js","
|
|
1
|
+
{"version":3,"file":"tooManyRequestsError.js","sources":["../../../src/errors/tooManyRequestsError.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,SAAS;IAClD;;OAEG;IACI,MAAM,CAAU,UAAU,GAAW,sBAAsB,CAAC;IAEnE;;;;;;;;OAQG;IACH,YACC,MAAc,EACd,OAAe,EACf,YAAoB,EACpB,eAAuB,EACvB,UAAsC,EACtC,KAAe;QAEf,KAAK,CACJ,oBAAoB,CAAC,UAAU,EAC/B,MAAM,EACN,OAAO,EACP,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,UAAU,EAAE,EAChD,KAAK,CACL,CAAC;IACH,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { BaseError } from \"@3sixty/core\";\n\n\n/**\n * Class to handle errors which are triggered by too many requests.\n */\nexport class TooManyRequestsError extends BaseError {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"TooManyRequestsError\";\n\n\t/**\n\t * Create a new instance of TooManyRequestsError.\n\t * @param source The source of the error.\n\t * @param message The message as a code.\n\t * @param requestCount The current request count.\n\t * @param nextRequestTime The time when the next request can be made, as date ISO string.\n\t * @param properties Any additional information for the error.\n\t * @param cause The cause of the error if we have wrapped another error.\n\t */\n\tconstructor(\n\t\tsource: string,\n\t\tmessage: string,\n\t\trequestCount: number,\n\t\tnextRequestTime: string,\n\t\tproperties?: { [id: string]: unknown },\n\t\tcause?: unknown\n\t) {\n\t\tsuper(\n\t\t\tTooManyRequestsError.CLASS_NAME,\n\t\t\tsource,\n\t\t\tmessage,\n\t\t\t{ requestCount, nextRequestTime, ...properties },\n\t\t\tcause\n\t\t);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mimeTypeProcessorFactory.js","
|
|
1
|
+
{"version":3,"file":"mimeTypeProcessorFactory.js","sources":["../../../src/factories/mimeTypeProcessorFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,wBAAwB,GACpC,OAAO,CAAC,aAAa,CAAqB,qBAAqB,CAAC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { IMimeTypeProcessor } from \"../models/server/IMimeTypeProcessor.js\";\n\n/**\n * Factory for creating implementation of mime type processor types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const MimeTypeProcessorFactory =\n\tFactory.createFactory<IMimeTypeProcessor>(\"mime-type-processor\");\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restClientProcessorFactory.js","
|
|
1
|
+
{"version":3,"file":"restClientProcessorFactory.js","sources":["../../../src/factories/restClientProcessorFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,0BAA0B,GACtC,OAAO,CAAC,aAAa,CAAuB,uBAAuB,CAAC,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { IRestClientProcessor } from \"../models/client/IRestClientProcessor.js\";\n\n/**\n * Factory for creating implementation of REST client processor types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const RestClientProcessorFactory =\n\tFactory.createFactory<IRestClientProcessor>(\"rest-client-processor\");\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restRouteProcessorFactory.js","
|
|
1
|
+
{"version":3,"file":"restRouteProcessorFactory.js","sources":["../../../src/factories/restRouteProcessorFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GACrC,OAAO,CAAC,aAAa,CAAsB,sBAAsB,CAAC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { IRestRouteProcessor } from \"../models/server/IRestRouteProcessor.js\";\n\n/**\n * Factory for creating implementation of REST route processor types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const RestRouteProcessorFactory =\n\tFactory.createFactory<IRestRouteProcessor>(\"rest-route-processor\");\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"socketRouteProcessorFactory.js","
|
|
1
|
+
{"version":3,"file":"socketRouteProcessorFactory.js","sources":["../../../src/factories/socketRouteProcessorFactory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,2BAA2B,GACvC,OAAO,CAAC,aAAa,CAAwB,wBAAwB,CAAC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Factory } from \"@3sixty/core\";\nimport type { ISocketRouteProcessor } from \"../models/server/ISocketRouteProcessor.js\";\n\n/**\n * Factory for creating implementation of socket route processor types.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const SocketRouteProcessorFactory =\n\tFactory.createFactory<ISocketRouteProcessor>(\"socket-route-processor\");\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpErrorHelper.js","
|
|
1
|
+
{"version":3,"file":"httpErrorHelper.js","sources":["../../../src/helpers/httpErrorHelper.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EACN,kBAAkB,EAClB,SAAS,EACT,aAAa,EACb,UAAU,EAEV,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,eAAe,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAGzE;;GAEG;AACH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AAI,CAAC,CAAC;YACpE,CAAC;YAED,yEAAyE;YACzE,IAAI,cAAc,KAAK,cAAc,CAAC,mBAAmB,EAAE,CAAC;gBAC3D,KAAK,MAAM,SAAS,IAAI,eAAe,CAAC,cAAc,EAAE,CAAC;oBACxD,IAAI,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC;wBAC9D,cAAc,GAAG,eAAe,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;wBAC3D,MAAM;oBACP,CAAC;gBACF,CAAC;YACF,CAAC;QACF,CAAC;QAED,MAAM,WAAW,GAAG,KAAK,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAErD,OAAO;YACN,KAAK,EAAE,WAAW;YAClB,cAAc;SACd,CAAC;IACH,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,aAAa,CAC1B,QAAuB,EACvB,KAAa,EACb,UAA0B,EAC1B,YAAqB;QAErB,QAAQ,CAAC,OAAO,KAAK,EAAE,CAAC;QACxB,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,GAAG,SAAS,CAAC,IAAI,iBAAiB,CAAC;QAC/E,6FAA6F;QAC7F,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QACtE,QAAQ,CAAC,UAAU,GAAG,UAAU,CAAC;IAClC,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport {\n\tAlreadyExistsError,\n\tBaseError,\n\tConflictError,\n\tGuardError,\n\ttype IError,\n\tNotFoundError,\n\tNotImplementedError,\n\tUnauthorizedError,\n\tUnprocessableError,\n\tValidationError\n} from \"@3sixty/core\";\nimport { HeaderTypes, HttpStatusCode, MimeTypes } from \"@3sixty/web\";\nimport { ForbiddenError } from \"../errors/forbiddenError.js\";\nimport { TooManyRequestsError } from \"../errors/tooManyRequestsError.js\";\nimport type { IHttpResponse } from \"../models/protocol/IHttpResponse.js\";\n\n/**\n * Class to help with processing http errors.\n */\nexport class HttpErrorHelper {\n\t/**\n\t * Mapping of error types to status codes.\n\t */\n\tpublic static readonly ERROR_TYPE_MAP: { [id: string]: HttpStatusCode } = {\n\t\t[GuardError.CLASS_NAME]: HttpStatusCode.badRequest,\n\t\t[ValidationError.CLASS_NAME]: HttpStatusCode.badRequest,\n\t\t[ConflictError.CLASS_NAME]: HttpStatusCode.conflict,\n\t\t[AlreadyExistsError.CLASS_NAME]: HttpStatusCode.conflict,\n\t\t[NotFoundError.CLASS_NAME]: HttpStatusCode.notFound,\n\t\t[UnauthorizedError.CLASS_NAME]: HttpStatusCode.unauthorized,\n\t\t[NotImplementedError.CLASS_NAME]: HttpStatusCode.notImplemented,\n\t\t[UnprocessableError.CLASS_NAME]: HttpStatusCode.unprocessableEntity,\n\t\t[TooManyRequestsError.CLASS_NAME]: HttpStatusCode.tooManyRequests,\n\t\t[ForbiddenError.CLASS_NAME]: HttpStatusCode.forbidden\n\t};\n\n\t/**\n\t * Process the errors from the routes.\n\t * @param err The error to process.\n\t * @param includeStack Should the stack be included in the error.\n\t * @returns The status code and additional error data.\n\t */\n\tpublic static processError(\n\t\terr: unknown,\n\t\tincludeStack?: boolean\n\t): {\n\t\terror: IError;\n\t\thttpStatusCode: HttpStatusCode;\n\t} {\n\t\tconst error: BaseError = BaseError.fromError(err);\n\n\t\t// If the error or any of its sub errors are of the specific\n\t\t// types then set the http response code accordingly\n\t\tconst flattened = BaseError.flatten(error);\n\n\t\tlet httpStatusCode: HttpStatusCode = HttpStatusCode.internalServerError;\n\n\t\t// First check the primary error, as we don't want to override that with a sub error\n\t\tif (flattened.length > 0) {\n\t\t\tconst primaryError = flattened[0];\n\t\t\tif (HttpErrorHelper.ERROR_TYPE_MAP[primaryError.name]) {\n\t\t\t\thttpStatusCode = HttpErrorHelper.ERROR_TYPE_MAP[primaryError.name];\n\t\t\t}\n\n\t\t\t// The primary error is still internal server error, check the sub errors\n\t\t\tif (httpStatusCode === HttpStatusCode.internalServerError) {\n\t\t\t\tfor (const className in HttpErrorHelper.ERROR_TYPE_MAP) {\n\t\t\t\t\tif (flattened.some(e => BaseError.isErrorName(e, className))) {\n\t\t\t\t\t\thttpStatusCode = HttpErrorHelper.ERROR_TYPE_MAP[className];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst returnError = error.toJsonObject(includeStack);\n\n\t\treturn {\n\t\t\terror: returnError,\n\t\t\thttpStatusCode\n\t\t};\n\t}\n\n\t/**\n\t * Build an error response.\n\t * @param response The response to build the error into.\n\t * @param error The error to build the response for.\n\t * @param statusCode The status code to use for the error.\n\t * @param includeStack Should the stack be included in the error.\n\t */\n\tpublic static buildResponse(\n\t\tresponse: IHttpResponse,\n\t\terror: IError,\n\t\tstatusCode: HttpStatusCode,\n\t\tincludeStack: boolean\n\t): void {\n\t\tresponse.headers ??= {};\n\t\tresponse.headers[HeaderTypes.ContentType] = `${MimeTypes.Json}; charset=utf-8`;\n\t\t// Fastify treats an Error-typed body as a framework error and overrides the status with 500.\n\t\tresponse.body = BaseError.fromError(error).toJsonObject(includeStack);\n\t\tresponse.statusCode = statusCode;\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpHeaderHelper.js","
|
|
1
|
+
{"version":3,"file":"httpHeaderHelper.js","sources":["../../../src/helpers/httpHeaderHelper.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEtE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAqB,MAAM,aAAa,CAAC;AACtF,OAAO,EAAE,aAAa,EAA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-2.0.\nimport { GeneralError, Guards, Is, StringHelper } from \"@3sixty/core\";\n\nimport { HeaderHelper, HeaderTypes, MimeTypes, type IHttpHeaders } from \"@3sixty/web\";\nimport { HttpUrlHelper } from \"./httpUrlHelper.js\";\n\n/**\n * Class to help with handling http headers.\n */\nexport class HttpHeaderHelper {\n\t/**\n\t * Runtime name for the class.\n\t */\n\tpublic static readonly CLASS_NAME: string = \"HttpHeaderHelper\";\n\n\t/**\n\t * Set the Link header with a next cursor relation when a cursor is present.\n\t * @param headers The response headers to mutate.\n\t * @param url The request URL used as the base for the link.\n\t * @param publicOrigin The public origin to substitute into the URL, if any.\n\t * @param cursor The cursor value; when undefined or empty the header is not set.\n\t */\n\tpublic static buildCursor(\n\t\theaders: IHttpHeaders,\n\t\turl: string,\n\t\tpublicOrigin: string | undefined,\n\t\tcursor: string | undefined\n\t): asserts headers is IHttpHeaders & { [HeaderTypes.Link]: string | undefined } {\n\t\tif (Is.stringValue(cursor)) {\n\t\t\tconst baseUrl = HttpUrlHelper.replaceOrigin(url, publicOrigin);\n\t\t\tconst cursorUrl = HttpUrlHelper.addQueryStringParam(baseUrl, \"cursor\", cursor);\n\t\t\theaders[HeaderTypes.Link] = HeaderHelper.createLinkHeader(cursorUrl, undefined, \"next\");\n\t\t}\n\t}\n\n\t/**\n\t * Set the Location header to the encoded ID, optionally placed within a URL template.\n\t * When the template contains `:id` (e.g. \"/path1/:id/path2\" or \"/path?p=:id\") the\n\t * encoded ID is substituted at that position; otherwise it is appended.\n\t * When no template is provided the bare encoded ID is used.\n\t * Callers that need to combine a public origin with a path should use\n\t * HttpUrlHelper.combineOriginPath to build the template before calling this method.\n\t * @param headers The response headers to mutate.\n\t * @param id The resource ID to encode and place.\n\t * @param urlTemplate The optional URL template (absolute or relative).\n\t */\n\tpublic static buildId(\n\t\theaders: IHttpHeaders,\n\t\tid: string,\n\t\turlTemplate?: string\n\t): asserts headers is IHttpHeaders & { [HeaderTypes.Location]: string } {\n\t\tGuards.stringValue(HttpHeaderHelper.CLASS_NAME, \"id\", id);\n\t\tconst encodedId = encodeURIComponent(id);\n\n\t\tif (Is.stringValue(urlTemplate)) {\n\t\t\tif (/:id(?![a-zA-Z0-9])/.test(urlTemplate)) {\n\t\t\t\theaders[HeaderTypes.Location] = urlTemplate.replace(/:id(?![a-zA-Z0-9])/, encodedId);\n\t\t\t} else {\n\t\t\t\theaders[HeaderTypes.Location] =\n\t\t\t\t\t`${StringHelper.trimTrailingSlashes(urlTemplate)}/${encodedId}`;\n\t\t\t}\n\t\t} else {\n\t\t\theaders[HeaderTypes.Location] = encodedId;\n\t\t}\n\t}\n\n\t/**\n\t * Set the Content-Type header to JSON-LD or JSON depending on the request Accept header.\n\t * Uses HeaderHelper.extractAccept which parses the Accept header per RFC 7231 and returns\n\t * entries ordered by quality descending, preserving original order for equal q-values.\n\t * @param headers The response headers to mutate.\n\t * @param requestHeaders The request headers to inspect for the Accept value.\n\t */\n\tpublic static buildJsonContentType(\n\t\theaders: IHttpHeaders,\n\t\trequestHeaders?: IHttpHeaders\n\t): asserts headers is IHttpHeaders & {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.JsonLd | typeof MimeTypes.Json;\n\t} {\n\t\tconst accepted = HeaderHelper.extractAccept(requestHeaders);\n\t\tlet contentType: string = MimeTypes.Json;\n\t\tif (Is.arrayValue(accepted)) {\n\t\t\tfor (const { mimeType } of accepted) {\n\t\t\t\tif (mimeType === MimeTypes.JsonLd) {\n\t\t\t\t\tcontentType = MimeTypes.JsonLd;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tif (mimeType === MimeTypes.Json || mimeType === \"application/*\" || mimeType === \"*/*\") {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\theaders[HeaderTypes.ContentType] = contentType;\n\t}\n\n\t/**\n\t * Extract the cursor from the Link header's next relation.\n\t * @param headers The response headers to extract the cursor from.\n\t * @returns The cursor value or undefined if not present.\n\t */\n\tpublic static extractCursor(headers?: IHttpHeaders): string | undefined {\n\t\treturn HeaderHelper.extractLinkHeaderRelation(headers?.[HeaderTypes.Link], \"next\")\n\t\t\t?.urlQueryParams?.cursor;\n\t}\n\n\t/**\n\t * Extract the resource ID from the Location response header.\n\t * Handles absolute URLs, relative paths, and bare ID values.\n\t * When a templateUrl containing ':id' is supplied (e.g. \"/path1/:id/path2\" or\n\t * \"https://host/path/:id\") the ID is extracted via pattern matching at the ':id'\n\t * position. Without a matching template the last path segment is returned.\n\t * @param headers The response headers containing the Location header.\n\t * @param templateUrl Optional URL template containing the ':id' placeholder, e.g. \"/path1/:id/path2\".\n\t * @returns The extracted ID string.\n\t * @throws GeneralError If the Location header is missing or the ID cannot be extracted.\n\t */\n\tpublic static extractId(headers?: IHttpHeaders, templateUrl?: string): string {\n\t\tconst location = headers?.[HeaderTypes.Location];\n\t\tif (!Is.stringValue(location)) {\n\t\t\tthrow new GeneralError(HttpHeaderHelper.CLASS_NAME, \"locationMissing\");\n\t\t}\n\n\t\tconst withoutQuery = location.split(\"?\")[0];\n\n\t\tif (Is.stringValue(templateUrl) && templateUrl.includes(\":id\")) {\n\t\t\tconst escaped = templateUrl.replace(/[.+^${}()|[\\]\\\\?]/g, \"\\\\$&\");\n\t\t\tconst pattern = new RegExp(\n\t\t\t\tescaped.replace(/:[a-zA-Z][a-zA-Z0-9]*/g, m => (m === \":id\" ? \"([^/?#]+)\" : \"[^/?#]+\"))\n\t\t\t);\n\t\t\tconst match = pattern.exec(location);\n\t\t\tif (!Is.stringValue(match?.[1])) {\n\t\t\t\tthrow new GeneralError(HttpHeaderHelper.CLASS_NAME, \"idNotFound\");\n\t\t\t}\n\t\t\treturn decodeURIComponent(match[1]);\n\t\t}\n\n\t\tconst id = withoutQuery.includes(\"/\") ? withoutQuery.split(\"/\").pop() : withoutQuery;\n\n\t\tif (!Is.stringValue(id)) {\n\t\t\tthrow new GeneralError(HttpHeaderHelper.CLASS_NAME, \"idNotFound\");\n\t\t}\n\t\treturn decodeURIComponent(id);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpParameterHelper.js","
|
|
1
|
+
{"version":3,"file":"httpParameterHelper.js","sources":["../../../src/helpers/httpParameterHelper.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAElC;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAC/B;;;;OAIG;IACI,MAAM,CAAC,eAAe,CAAa,MAAe;QACxD,OAAO,MAAM,EAAE,KAAK,CAAC,GAAG,CAAQ,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAa,MAAY;QACnD,OAAO,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC7D,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,gBAAgB,CAAc,KAAc;QACzD,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAC9D,CAAC;IAED;;;;OAIG;IACI,MAAM,CAAC,cAAc,CAAc,KAAS;QAClD,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC5D,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Is } from \"@3sixty/core\";\n\n/**\n * Class to help with handling http parameters.\n */\nexport class HttpParameterHelper {\n\t/**\n\t * Convert list query to array.\n\t * @param values The values query string.\n\t * @returns The array of values.\n\t */\n\tpublic static arrayFromString<T = string>(values?: string): T[] | undefined {\n\t\treturn values?.split(\",\") as T[];\n\t}\n\n\t/**\n\t * Convert array of values to query string.\n\t * @param values The values to combine string.\n\t * @returns The combined.\n\t */\n\tpublic static arrayToString<T = string>(values?: T[]): string | undefined {\n\t\treturn Is.arrayValue(values) ? values.join(\",\") : undefined;\n\t}\n\n\t/**\n\t * Convert object string to object.\n\t * @param value The value query string.\n\t * @returns The object.\n\t */\n\tpublic static objectFromString<T = unknown>(value?: string): T | undefined {\n\t\treturn Is.json(value) ? (JSON.parse(value) as T) : undefined;\n\t}\n\n\t/**\n\t * Convert object to query string.\n\t * @param value The value to convert to a string.\n\t * @returns The converted object.\n\t */\n\tpublic static objectToString<T = unknown>(value?: T): string | undefined {\n\t\treturn Is.empty(value) ? undefined : JSON.stringify(value);\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpUrlHelper.js","
|
|
1
|
+
{"version":3,"file":"httpUrlHelper.js","sources":["../../../src/helpers/httpUrlHelper.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,EAAE,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEhD;;GAEG;AACH,MAAM,OAAO,aAAa;IACzB;;;;;OAKG;IACI,MAAM,CAAC,aAAa,CAAC,GAAW;QACtC,IAAI,CAAC;YACJ,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YAClC,OAAO,YAAY,CAAC,MAAM,CAAC;QAC5B,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACX,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,WAAW,CAAC,GAAW;QACpC,IAAI,CAAC;YACJ,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YAClC,OAAO,YAAY,CAAC,QAAQ,CAAC;QAC9B,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACX,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,aAAa,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,CAAC;YACvC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACzE,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACvC,OAAO,UAAU;gBAChB,CAAC,CAAC,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,IAAI,EAAE;gBAC7D,CAAC,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;QACzB,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;QAEV,OAAO,GAAG,CAAC;IACZ,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,mBAAmB,CAAC,GAAW,EAAE,GAAW;QACzD,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC;YAClD,OAAO,SAAS,CAAC;QAClB,CAAC;QAED,IAAI,CAAC;YACJ,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;YAC/B,OAAO,SAAS,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC;QACrD,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;QAEV,OAAO,SAAS,CAAC;IAClB,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { Is, StringHelper } from \"@3sixty/core\";\n\n/**\n * Class to help with handling http URLs.\n */\nexport class HttpUrlHelper {\n\t/**\n\t * Extract the origin from the url which includes protocol,host,port.\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/URL/origin\n\t * @param url The url to extract the origin from.\n\t * @returns The extracted origin.\n\t */\n\tpublic static extractOrigin(url: string): string | undefined {\n\t\ttry {\n\t\t\tconst convertedUrl = new URL(url);\n\t\t\treturn convertedUrl.origin;\n\t\t} catch {}\n\t}\n\n\t/**\n\t * Extract the path from the url.\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname\n\t * @param url The url to extract the path from.\n\t * @returns The extracted path.\n\t */\n\tpublic static extractPath(url: string): string | undefined {\n\t\ttry {\n\t\t\tconst convertedUrl = new URL(url);\n\t\t\treturn convertedUrl.pathname;\n\t\t} catch {}\n\t}\n\n\t/**\n\t * Extract the search from the url.\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/URL/search\n\t * @param url The url to extract the search from.\n\t * @returns The extracted search.\n\t */\n\tpublic static extractSearch(url: string): string | undefined {\n\t\ttry {\n\t\t\tconst convertedUrl = new URL(url);\n\t\t\treturn convertedUrl.search;\n\t\t} catch {}\n\t}\n\n\t/**\n\t * Extract the path and search from the url.\n\t * @param url The url to extract the path and search from.\n\t * @returns The extracted path and search.\n\t */\n\tpublic static extractPathAndSearch(url: string): string | undefined {\n\t\ttry {\n\t\t\tconst convertedUrl = new URL(url);\n\t\t\treturn `${convertedUrl.pathname}${convertedUrl.search}`;\n\t\t} catch {}\n\t}\n\n\t/**\n\t * Combine an optional origin and an optional path into a single URL string.\n\t * Relative paths (no protocol, no leading slash) have a leading slash prepended.\n\t * Trailing slashes are trimmed from the origin before joining.\n\t * Returns undefined when both arguments are absent or empty.\n\t * @param origin The optional origin (e.g. \"https://example.com\").\n\t * @param path The optional path or URL template (e.g. \"/api/items\" or \"api/items\").\n\t * @returns The combined string, or undefined when both are absent.\n\t */\n\tpublic static combineOriginPath(origin?: string, path?: string): string | undefined {\n\t\tconst normalizedPath =\n\t\t\tIs.stringValue(path) && !path.includes(\"://\")\n\t\t\t\t? `/${StringHelper.trimLeadingSlashes(path)}`\n\t\t\t\t: path;\n\n\t\tif (Is.stringValue(origin) && Is.stringValue(normalizedPath)) {\n\t\t\treturn `${StringHelper.trimTrailingSlashes(origin)}${normalizedPath}`;\n\t\t} else if (Is.stringValue(origin)) {\n\t\t\treturn origin;\n\t\t} else if (Is.stringValue(normalizedPath)) {\n\t\t\treturn normalizedPath;\n\t\t}\n\t}\n\n\t/**\n\t * Encode a single URL path segment per RFC 3986 §3.3.\n\t * Unlike encodeURIComponent, sub-delimiters ($ & + , ; =) and the colon and\n\t * at-sign characters that are valid unencoded in path segments are preserved.\n\t * @see https://datatracker.ietf.org/doc/html/rfc3986#section-3.3\n\t * @param segment The raw path segment value to encode.\n\t * @returns The percent-encoded path segment.\n\t */\n\tpublic static encodeUriPathSegment(segment: string): string {\n\t\t// RFC 3986 §3.3: only encode characters outside the allowed path segment set.\n\t\t// Allowed: unreserved (A-Za-z0-9 - . _ ~), sub-delimiters (! $ & ' ( ) * + , ; =), and : @\n\t\treturn segment.replace(/[^\\w!$&'()*+,.:;=@~-]/g, ch => encodeURIComponent(ch));\n\t}\n\n\t/**\n\t * Replace the origin in the url.\n\t * @param url The url to replace the origin in.\n\t * @param newOrigin The new origin to use.\n\t * @returns The url with the replaced origin.\n\t */\n\tpublic static replaceOrigin(url: string, newOrigin?: string): string {\n\t\tif (!Is.stringValue(url) || !Is.stringValue(newOrigin) || !newOrigin.startsWith(\"http\")) {\n\t\t\treturn url;\n\t\t}\n\n\t\ttry {\n\t\t\tconst parsedUrl = new URL(url.startsWith(\"/\") ? `http://placeholder${url}` : url);\n\t\t\tconst newParsedUrl = new URL(newOrigin);\n\t\t\tparsedUrl.protocol = newParsedUrl.protocol;\n\t\t\tparsedUrl.host = newParsedUrl.host;\n\t\t\tparsedUrl.port = newParsedUrl.port;\n\t\t\treturn parsedUrl.toString();\n\t\t} catch {}\n\n\t\treturn url;\n\t}\n\n\t/**\n\t * Add a query string parameter to the url.\n\t * @param url The url to add the query string parameter to.\n\t * @param key The key of the query string parameter.\n\t * @param value The value of the query string parameter.\n\t * @returns The url with the added query string parameter.\n\t */\n\tpublic static addQueryStringParam(url: string, key: string, value: string): string {\n\t\tif (!Is.stringValue(url) || !Is.stringValue(key) || !Is.stringValue(value)) {\n\t\t\treturn url;\n\t\t}\n\n\t\ttry {\n\t\t\tconst isRelative = url.startsWith(\"/\");\n\t\t\tconst parsedUrl = new URL(isRelative ? `http://placeholder${url}` : url);\n\t\t\tparsedUrl.searchParams.set(key, value);\n\t\t\treturn isRelative\n\t\t\t\t? `${parsedUrl.pathname}${parsedUrl.search}${parsedUrl.hash}`\n\t\t\t\t: parsedUrl.toString();\n\t\t} catch {}\n\n\t\treturn url;\n\t}\n\n\t/**\n\t * Get a query string parameter from the url.\n\t * @param url The url to get the query string parameter from.\n\t * @param key The key of the query string parameter.\n\t * @returns The value of the query string parameter.\n\t */\n\tpublic static getQueryStringParam(url: string, key: string): string | undefined {\n\t\tif (!Is.stringValue(url) || !Is.stringValue(key)) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\ttry {\n\t\t\tconst parsedUrl = new URL(url);\n\t\t\treturn parsedUrl.searchParams.get(key) ?? undefined;\n\t\t} catch {}\n\n\t\treturn undefined;\n\t}\n}\n"]}
|
package/dist/es/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// Copyright 2026 3Sixty Trade Ltd.
|
|
2
3
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
4
|
export * from "./errors/forbiddenError.js";
|
|
4
5
|
export * from "./errors/tooManyRequestsError.js";
|
|
@@ -10,7 +11,6 @@ export * from "./helpers/httpErrorHelper.js";
|
|
|
10
11
|
export * from "./helpers/httpHeaderHelper.js";
|
|
11
12
|
export * from "./helpers/httpParameterHelper.js";
|
|
12
13
|
export * from "./helpers/httpUrlHelper.js";
|
|
13
|
-
export * from "./helpers/scopeHelper.js";
|
|
14
14
|
export * from "./models/api/IServerFavIconResponse.js";
|
|
15
15
|
export * from "./models/api/IServerHealthResponse.js";
|
|
16
16
|
export * from "./models/api/IServerInfoResponse.js";
|
|
@@ -58,6 +58,7 @@ export * from "./models/routes/IRestRouteRequestExample.js";
|
|
|
58
58
|
export * from "./models/routes/IRestRouteResponseAttachmentOptions.js";
|
|
59
59
|
export * from "./models/routes/IRestRouteResponseExample.js";
|
|
60
60
|
export * from "./models/routes/IRestRouteResponseOptions.js";
|
|
61
|
+
export * from "./models/routes/IRouteAuthorization.js";
|
|
61
62
|
export * from "./models/routes/ISocketRoute.js";
|
|
62
63
|
export * from "./models/routes/ISocketRouteEntryPoint.js";
|
|
63
64
|
export * from "./models/routes/ITag.js";
|
|
@@ -75,4 +76,6 @@ export * from "./models/services/IPlatformComponent.js";
|
|
|
75
76
|
export * from "./models/services/IServerInfo.js";
|
|
76
77
|
export * from "./models/services/ITenant.js";
|
|
77
78
|
export * from "./models/services/ITenantAdminComponent.js";
|
|
79
|
+
export * from "./models/services/tenantEventCallback.js";
|
|
80
|
+
export * from "./models/services/tenantEventType.js";
|
|
78
81
|
//# sourceMappingURL=index.js.map
|
package/dist/es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,mCAAmC;AACnC,uCAAuC;AACvC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,kCAAkC,CAAC;AACjD,cAAc,yCAAyC,CAAC;AACxD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sCAAsC,CAAC;AACrD,cAAc,uCAAuC,CAAC;AACtD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D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C;AACzD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sCAAsC,CAAC;AACrD,cAAc,iDAAiD,CAAC;AAChE,cAAc,uCAAuC,CAAC;AACtD,cAAc,+CAA+C,CAAC;AAC9D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,yCAAyC,CAAC;AACxD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// Copyright 2026 3Sixty Trade Ltd.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./errors/forbiddenError.js\";\nexport * from \"./errors/tooManyRequestsError.js\";\nexport * from \"./factories/mimeTypeProcessorFactory.js\";\nexport * from \"./factories/restClientProcessorFactory.js\";\nexport * from \"./factories/restRouteProcessorFactory.js\";\nexport * from \"./factories/socketRouteProcessorFactory.js\";\nexport * from \"./helpers/httpErrorHelper.js\";\nexport * from \"./helpers/httpHeaderHelper.js\";\nexport * from \"./helpers/httpParameterHelper.js\";\nexport * from \"./helpers/httpUrlHelper.js\";\nexport * from \"./models/api/IServerFavIconResponse.js\";\nexport * from \"./models/api/IServerHealthResponse.js\";\nexport * from \"./models/api/IServerInfoResponse.js\";\nexport * from \"./models/api/IServerLivezResponse.js\";\nexport * from \"./models/api/IServerReadyzResponse.js\";\nexport * from \"./models/api/IServerRootResponse.js\";\nexport * from \"./models/api/IServerSpecResponse.js\";\nexport * from \"./models/client/IRestClientProcessor.js\";\nexport * from \"./models/client/IRestClientProcessorContext.js\";\nexport * from \"./models/config/IBaseRestClientConfig.js\";\nexport * from \"./models/config/IBaseSocketClientConfig.js\";\nexport * from \"./models/healthCategory.js\";\nexport * from \"./models/healthStatus.js\";\nexport * from \"./models/httpContextIdKeys.js\";\nexport * from \"./models/IHealth.js\";\nexport * from \"./models/protocol/IHttpRequest.js\";\nexport * from \"./models/protocol/IHttpRequestContext.js\";\nexport * from \"./models/protocol/IHttpRequestPathParams.js\";\nexport * from \"./models/protocol/IHttpRequestQuery.js\";\nexport * from \"./models/protocol/IHttpResponse.js\";\nexport * from \"./models/protocol/IHttpServerRequest.js\";\nexport * from \"./models/protocol/ISocketRequestContext.js\";\nexport * from \"./models/protocol/ISocketServerRequest.js\";\nexport * from \"./models/requests/INoContentRequest.js\";\nexport * from \"./models/responses/errors/IBadRequestResponse.js\";\nexport * from \"./models/responses/errors/IConflictResponse.js\";\nexport * from \"./models/responses/errors/IForbiddenResponse.js\";\nexport * from \"./models/responses/errors/IInternalServerErrorResponse.js\";\nexport * from \"./models/responses/errors/INotFoundResponse.js\";\nexport * from \"./models/responses/errors/INotImplementedResponse.js\";\nexport * from \"./models/responses/errors/ITooManyRequestsResponse.js\";\nexport * from \"./models/responses/errors/IUnauthorizedResponse.js\";\nexport * from \"./models/responses/errors/IUnprocessableEntityResponse.js\";\nexport * from \"./models/responses/success/IAcceptedResponse.js\";\nexport * from \"./models/responses/success/ICreatedResponse.js\";\nexport * from \"./models/responses/success/INoContentResponse.js\";\nexport * from \"./models/responses/success/IOkResponse.js\";\nexport * from \"./models/routes/httpBodyLimit.js\";\nexport * from \"./models/routes/IBaseRoute.js\";\nexport * from \"./models/routes/IBaseRouteEntryPoint.js\";\nexport * from \"./models/routes/IRestRoute.js\";\nexport * from \"./models/routes/IRestRouteEntryPoint.js\";\nexport * from \"./models/routes/IRestRouteExample.js\";\nexport * from \"./models/routes/IRestRouteRequestExample.js\";\nexport * from \"./models/routes/IRestRouteResponseAttachmentOptions.js\";\nexport * from \"./models/routes/IRestRouteResponseExample.js\";\nexport * from \"./models/routes/IRestRouteResponseOptions.js\";\nexport * from \"./models/routes/IRouteAuthorization.js\";\nexport * from \"./models/routes/ISocketRoute.js\";\nexport * from \"./models/routes/ISocketRouteEntryPoint.js\";\nexport * from \"./models/routes/ITag.js\";\nexport * from \"./models/server/IBaseRouteProcessor.js\";\nexport * from \"./models/server/IMimeTypeProcessor.js\";\nexport * from \"./models/server/IRestRouteProcessor.js\";\nexport * from \"./models/server/ISocketRouteProcessor.js\";\nexport * from \"./models/server/IWebServer.js\";\nexport * from \"./models/server/IWebServerOptions.js\";\nexport * from \"./models/services/IHealthApplicationCallback.js\";\nexport * from \"./models/services/IHealthComponent.js\";\nexport * from \"./models/services/IHealthProviderComponent.js\";\nexport * from \"./models/services/IInformationComponent.js\";\nexport * from \"./models/services/IPlatformComponent.js\";\nexport * from \"./models/services/IServerInfo.js\";\nexport * from \"./models/services/ITenant.js\";\nexport * from \"./models/services/ITenantAdminComponent.js\";\nexport * from \"./models/services/tenantEventCallback.js\";\nexport * from \"./models/services/tenantEventType.js\";\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IHealth.js","
|
|
1
|
+
{"version":3,"file":"IHealth.js","sources":["../../../src/models/IHealth.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { HealthCategory } from \"./healthCategory.js\";\nimport type { HealthStatus } from \"./healthStatus.js\";\n\n/**\n * Provides health information for a component.\n */\nexport interface IHealth {\n\t/**\n\t * The source of the health information.\n\t */\n\tsource: string;\n\n\t/**\n\t * The description of the component as an i18n key.\n\t */\n\tdescription?: string;\n\n\t/**\n\t * The category of the health check.\n\t */\n\tcategory?: HealthCategory;\n\n\t/**\n\t * The overall status of the component, the entries can also report their own health.\n\t */\n\tstatus: HealthStatus;\n\n\t/**\n\t * The error details when the status is not Ok.\n\t */\n\terror?: IError;\n\n\t/**\n\t * The message for the status if there are further details to provide as an i18n key.\n\t */\n\tmessage?: string;\n\n\t/**\n\t * Data to substitute in the i18n key for the message.\n\t */\n\tdata?: { [id: string]: unknown };\n\n\t/**\n\t * The grouped child components, if any.\n\t */\n\tgrouped?: IHealth[];\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IServerFavIconResponse.js","
|
|
1
|
+
{"version":3,"file":"IServerFavIconResponse.js","sources":["../../../../src/models/api/IServerFavIconResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * The favicon for the server.\n */\nexport interface IServerFavIconResponse {\n\t/**\n\t * Additional response headers.\n\t */\n\theaders?: {\n\t\t/**\n\t\t * The content type for the response.\n\t\t */\n\t\t[HeaderTypes.ContentType]?: string;\n\t};\n\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode?: HttpStatusCode;\n\n\t/**\n\t * The favicon for the server.\n\t */\n\tbody?: Uint8Array;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IServerHealthResponse.js","
|
|
1
|
+
{"version":3,"file":"IServerHealthResponse.js","sources":["../../../../src/models/api/IServerHealthResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HealthStatus } from \"../healthStatus.js\";\nimport type { IHealth } from \"../IHealth.js\";\n\n/**\n * The health of the server.\n */\nexport interface IServerHealthResponse {\n\t/**\n\t * The health for the server.\n\t */\n\tbody: { status: HealthStatus; components: IHealth[] };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IServerInfoResponse.js","
|
|
1
|
+
{"version":3,"file":"IServerInfoResponse.js","sources":["../../../../src/models/api/IServerInfoResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IServerInfo } from \"../services/IServerInfo.js\";\n\n/**\n * The information about the server.\n */\nexport interface IServerInfoResponse {\n\t/**\n\t * The information for the server.\n\t */\n\tbody: IServerInfo;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IServerLivezResponse.js","
|
|
1
|
+
{"version":3,"file":"IServerLivezResponse.js","sources":["../../../../src/models/api/IServerLivezResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@3sixty/web\";\n\n/**\n * The livez of the server.\n */\nexport interface IServerLivezResponse {\n\t/**\n\t * The headers for the response.\n\t */\n\theaders: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.PlainText;\n\t};\n\n\t/**\n\t * The livez information for the server.\n\t */\n\tbody: \"alive\" | \"dead\";\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IServerReadyzResponse.js","
|
|
1
|
+
{"version":3,"file":"IServerReadyzResponse.js","sources":["../../../../src/models/api/IServerReadyzResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@3sixty/web\";\n\n/**\n * The readyz of the server.\n */\nexport interface IServerReadyzResponse {\n\t/**\n\t * The headers for the response.\n\t */\n\theaders: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.PlainText;\n\t};\n\n\t/**\n\t * The readyz information for the server.\n\t */\n\tbody: \"ready\" | \"not ready\";\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IServerRootResponse.js","
|
|
1
|
+
{"version":3,"file":"IServerRootResponse.js","sources":["../../../../src/models/api/IServerRootResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@3sixty/web\";\n\n/**\n * The root text for the server.\n */\nexport interface IServerRootResponse {\n\t/**\n\t * The headers for the response.\n\t */\n\theaders: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.PlainText;\n\t};\n\n\t/**\n\t * The root text for the server.\n\t */\n\tbody: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IServerSpecResponse.js","
|
|
1
|
+
{"version":3,"file":"IServerSpecResponse.js","sources":["../../../../src/models/api/IServerSpecResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * The OpenAPI spec for the endpoints.\n */\nexport interface IServerSpecResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode?: HttpStatusCode;\n\n\t/**\n\t * The spec for the server.\n\t */\n\tbody?: unknown;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IRestClientProcessor.js","
|
|
1
|
+
{"version":3,"file":"IRestClientProcessor.js","sources":["../../../../src/models/client/IRestClientProcessor.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@3sixty/core\";\nimport type { IRestClientProcessorContext } from \"./IRestClientProcessorContext.js\";\n\n/**\n * A processor that participates in an outbound REST request.\n */\nexport interface IRestClientProcessor extends IComponent {\n\t/**\n\t * Run the processor before the fetch takes place.\n\t * @param context The details of the request being made.\n\t * @param next Performs the request, or calls the next processor in the chain.\n\t * @returns The result of next.\n\t */\n\tpre?(context: IRestClientProcessorContext, next: () => Promise<Response>): Promise<Response>;\n\n\t/**\n\t * Run the processor after the fetch completes.\n\t * @param context The details of the request that was made.\n\t * @param response The response from the request.\n\t * @param next Performs the post processing, or calls the next processor in the chain.\n\t * @returns The result of next.\n\t */\n\tpost?(\n\t\tcontext: IRestClientProcessorContext,\n\t\tresponse: Response,\n\t\tnext: () => Promise<Response>\n\t): Promise<Response>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IRestClientProcessorContext.js","
|
|
1
|
+
{"version":3,"file":"IRestClientProcessorContext.js","sources":["../../../../src/models/client/IRestClientProcessorContext.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HttpMethod, IHttpHeaders } from \"@3sixty/web\";\n\n/**\n * The context of a rest client processor.\n */\nexport interface IRestClientProcessorContext {\n\t/**\n\t * The name of the REST client making the request.\n\t */\n\trestClientClassName: string;\n\n\t/**\n\t * The base URL of the request.\n\t */\n\tbaseUrl: string;\n\n\t/**\n\t * The route template before path parameter substitution.\n\t */\n\trouteTemplate: string;\n\n\t/**\n\t * The route being requested.\n\t */\n\troute: string;\n\n\t/**\n\t * The HTTP method of the request.\n\t */\n\tmethod: HttpMethod;\n\n\t/**\n\t * The headers being sent with the request.\n\t */\n\theaders: IHttpHeaders;\n\n\t/**\n\t * The timeout for the request in milliseconds.\n\t */\n\ttimeout?: number;\n\n\t/**\n\t * Whether to include credentials in the request.\n\t */\n\tincludeCredentials?: boolean;\n\n\t/**\n\t * The request being made.\n\t */\n\tbody?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IBaseRestClientConfig.js","
|
|
1
|
+
{"version":3,"file":"IBaseRestClientConfig.js","sources":["../../../../src/models/config/IBaseRestClientConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { IHttpHeaders } from \"@3sixty/web\";\n\n/**\n * Definition for the configuration of a rest client.\n */\nexport interface IBaseRestClientConfig {\n\t/**\n\t * The endpoint where the api is hosted.\n\t */\n\tendpoint: string;\n\n\t/**\n\t * The prefix to the routes.\n\t */\n\tpathPrefix?: string;\n\n\t/**\n\t * The headers to include in requests.\n\t */\n\theaders?: IHttpHeaders;\n\n\t/**\n\t * Timeout for requests in ms.\n\t */\n\ttimeout?: number;\n\n\t/**\n\t * Include credentials in the request, defaults to true.\n\t */\n\tincludeCredentials?: boolean;\n\n\t/**\n\t * The types of the processors to run around each request, resolved from the `RestClientProcessorFactory`.\n\t */\n\tprocessorTypes?: string[];\n\n\t/**\n\t * Hook to provide headers asynchronously.\n\t * @returns A promise that resolves to the headers.\n\t */\n\tcustomHeaders?: () => Promise<IHttpHeaders>;\n\n\t/**\n\t * Hook to provide an authorization header value asynchronously.\n\t * @returns A promise that resolves to the authorization header value.\n\t */\n\tcustomAuthHeader?: () => Promise<string>;\n\n\t/**\n\t * Hook to handle authorization failures asynchronously.\n\t * @returns A promise that resolves when the auth failure handling is complete.\n\t */\n\tonAuthFailure?: (err: IError) => Promise<void>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IBaseSocketClientConfig.js","
|
|
1
|
+
{"version":3,"file":"IBaseSocketClientConfig.js","sources":["../../../../src/models/config/IBaseSocketClientConfig.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHttpHeaders } from \"@3sixty/web\";\n\n/**\n * Definition for the configuration of a socket service.\n */\nexport interface IBaseSocketClientConfig {\n\t/**\n\t * Base path for the socket service, defaults to /socket.\n\t */\n\tbasePath?: string;\n\n\t/**\n\t * The endpoint where the api is hosted.\n\t */\n\tendpoint: string;\n\n\t/**\n\t * The prefix to the routes.\n\t */\n\tpathPrefix?: string;\n\n\t/**\n\t * The headers to include in requests.\n\t */\n\theaders?: IHttpHeaders;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"healthCategory.js","
|
|
1
|
+
{"version":3,"file":"healthCategory.js","sources":["../../../src/models/healthCategory.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,WAAW,EAAE,aAAa;CACjB,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The category of a health check.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const HealthCategory = {\n\t/**\n\t * Connectivity health check for infrastructure connectors.\n\t */\n\tConnectivity: \"connectivity\",\n\n\t/**\n\t * Application health check for domain services.\n\t */\n\tApplication: \"application\"\n} as const;\n\n/**\n * The category of a health check.\n */\nexport type HealthCategory = (typeof HealthCategory)[keyof typeof HealthCategory];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"healthStatus.js","
|
|
1
|
+
{"version":3,"file":"healthStatus.js","sources":["../../../src/models/healthStatus.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B;;OAEG;IACH,EAAE,EAAE,IAAI;IAER;;OAEG;IACH,OAAO,EAAE,SAAS;IAElB;;OAEG;IACH,KAAK,EAAE,OAAO;CACL,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The health status of the component.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const HealthStatus = {\n\t/**\n\t * OK.\n\t */\n\tOk: \"ok\",\n\n\t/**\n\t * Warning.\n\t */\n\tWarning: \"warning\",\n\n\t/**\n\t * Error.\n\t */\n\tError: \"error\"\n} as const;\n\n/**\n * The health status of the component.\n */\nexport type HealthStatus = (typeof HealthStatus)[keyof typeof HealthStatus];\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Copyright 2026 IOTA Stiftung.
|
|
2
|
+
// Copyright 2026 3Sixty Trade Ltd.
|
|
2
3
|
// SPDX-License-Identifier: Apache-2.0.
|
|
3
4
|
/**
|
|
4
5
|
* HTTP definition of some context keys.
|
|
@@ -29,10 +30,6 @@ export const HttpContextIdKeys = {
|
|
|
29
30
|
* Local Origin of the request.
|
|
30
31
|
*/
|
|
31
32
|
LocalOrigin: "localOrigin",
|
|
32
|
-
/**
|
|
33
|
-
* The comma-separated scope claim from the verified JWT for the current request.
|
|
34
|
-
*/
|
|
35
|
-
Scope: "scope",
|
|
36
33
|
/**
|
|
37
34
|
* The caller's original tenant ID before an escalated privilege tenant override was applied.
|
|
38
35
|
* Only present when overrideTenant substitution is active for the current request.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"httpContextIdKeys.js","
|
|
1
|
+
{"version":3,"file":"httpContextIdKeys.js","sources":["../../../src/models/httpContextIdKeys.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,mCAAmC;AACnC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC;;OAEG;IACH,SAAS,EAAE,WAAW;IAEtB;;OAEG;IACH,SAAS,EAAE,WAAW;IAEtB;;OAEG;IACH,aAAa,EAAE,eAAe;IAE9B;;OAEG;IACH,aAAa,EAAE,eAAe;IAE9B;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,WAAW,EAAE,aAAa;IAE1B;;;OAGG;IACH,cAAc,EAAE,gBAAgB;CACvB,CAAC","sourcesContent":["// Copyright 2026 IOTA Stiftung.\n// Copyright 2026 3Sixty Trade Ltd.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * HTTP definition of some context keys.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const HttpContextIdKeys = {\n\t/**\n\t * IP address of the client.\n\t */\n\tIpAddress: \"ipAddress\",\n\n\t/**\n\t * User agent of the client.\n\t */\n\tUserAgent: \"userAgent\",\n\n\t/**\n\t * Correlation ID of the request.\n\t */\n\tCorrelationId: \"correlationId\",\n\n\t/**\n\t * Is this a remote request, will be a random UUID if request arrived through a REST endpoint, otherwise undefined.\n\t */\n\tRemoteRequest: \"remoteRequest\",\n\n\t/**\n\t * Public Origin of the request.\n\t */\n\tPublicOrigin: \"publicOrigin\",\n\n\t/**\n\t * Local Origin of the request.\n\t */\n\tLocalOrigin: \"localOrigin\",\n\n\t/**\n\t * The caller's original tenant ID before an escalated privilege tenant override was applied.\n\t * Only present when overrideTenant substitution is active for the current request.\n\t */\n\tOriginalTenant: \"originalTenant\"\n} as const;\n\n/**\n * HTTP definition of some context keys.\n */\nexport type HttpContextIdKeys = (typeof HttpContextIdKeys)[keyof typeof HttpContextIdKeys];\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IHttpRequest.js","
|
|
1
|
+
{"version":3,"file":"IHttpRequest.js","sources":["../../../../src/models/protocol/IHttpRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHttpHeaders } from \"@3sixty/web\";\nimport type { IHttpRequestPathParams } from \"./IHttpRequestPathParams.js\";\nimport type { IHttpRequestQuery } from \"./IHttpRequestQuery.js\";\n\n/**\n * Model for the standard parameters for an http request.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IHttpRequest<T = any> {\n\t/**\n\t * Incoming Http Headers.\n\t */\n\theaders?: IHttpHeaders;\n\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams?: IHttpRequestPathParams;\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: IHttpRequestQuery;\n\n\t/**\n\t * Data to return send as the body.\n\t */\n\tbody?: T;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IHttpRequestContext.js","
|
|
1
|
+
{"version":3,"file":"IHttpRequestContext.js","sources":["../../../../src/models/protocol/IHttpRequestContext.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHttpServerRequest } from \"./IHttpServerRequest.js\";\n\n/**\n * Context data from the HTTP request.\n */\nexport interface IHttpRequestContext {\n\t/**\n\t * The raw HTTP request.\n\t */\n\tserverRequest: IHttpServerRequest;\n\n\t/**\n\t * The state handed through the processors.\n\t */\n\tprocessorState: { [id: string]: unknown };\n\n\t/**\n\t * Logging component type for the request.\n\t */\n\tloggingComponentType?: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IHttpRequestPathParams.js","
|
|
1
|
+
{"version":3,"file":"IHttpRequestPathParams.js","sources":["../../../../src/models/protocol/IHttpRequestPathParams.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Model for the standard parameters for an http request.\n */\nexport interface IHttpRequestPathParams {\n\t[id: string]: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IHttpRequestQuery.js","
|
|
1
|
+
{"version":3,"file":"IHttpRequestQuery.js","sources":["../../../../src/models/protocol/IHttpRequestQuery.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Model used for Http request query parameters.\n */\nexport interface IHttpRequestQuery {\n\t[id: string]: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IHttpResponse.js","
|
|
1
|
+
{"version":3,"file":"IHttpResponse.js","sources":["../../../../src/models/protocol/IHttpResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HttpStatusCode, IHttpHeaders } from \"@3sixty/web\";\n\n/**\n * Model for the standard parameters for an http response.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IHttpResponse<T = any> {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode?: HttpStatusCode;\n\n\t/**\n\t * Response headers.\n\t */\n\theaders?: IHttpHeaders;\n\n\t/**\n\t * Data to return as the main payload.\n\t */\n\tbody?: T;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IHttpServerRequest.js","
|
|
1
|
+
{"version":3,"file":"IHttpServerRequest.js","sources":["../../../../src/models/protocol/IHttpServerRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HttpMethod } from \"@3sixty/web\";\nimport type { IHttpRequest } from \"./IHttpRequest.js\";\n\n/**\n * Model for the standard parameters for an http request.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface IHttpServerRequest<T = any> extends IHttpRequest<T> {\n\t/**\n\t * The request url.\n\t */\n\turl: string;\n\n\t/**\n\t * The request method.\n\t */\n\tmethod?: HttpMethod;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ISocketRequestContext.js","
|
|
1
|
+
{"version":3,"file":"ISocketRequestContext.js","sources":["../../../../src/models/protocol/ISocketRequestContext.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHttpRequestContext } from \"./IHttpRequestContext.js\";\n\n/**\n * Context data from the socket request.\n */\nexport interface ISocketRequestContext extends IHttpRequestContext {\n\t/**\n\t * The id of the socket.\n\t */\n\tsocketId: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ISocketServerRequest.js","
|
|
1
|
+
{"version":3,"file":"ISocketServerRequest.js","sources":["../../../../src/models/protocol/ISocketServerRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHttpServerRequest } from \"./IHttpServerRequest.js\";\n\n/**\n * Model for the standard parameters for an http request.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface ISocketServerRequest<T = any> extends IHttpServerRequest<T> {\n\t/**\n\t * The socket id.\n\t */\n\tsocketId: string;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"INoContentRequest.js","
|
|
1
|
+
{"version":3,"file":"INoContentRequest.js","sources":["../../../../src/models/requests/INoContentRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IHttpRequest } from \"../protocol/IHttpRequest.js\";\n\n/**\n * A REST request with no input parameters.\n */\nexport interface INoContentRequest extends IHttpRequest {\n\t/**\n\t * Incoming Http Headers.\n\t */\n\theaders?: never;\n\n\t/**\n\t * The path parameters.\n\t */\n\tpathParams?: never;\n\n\t/**\n\t * The query parameters.\n\t */\n\tquery?: never;\n\n\t/**\n\t * Data to return send as the body.\n\t */\n\tbody?: never;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IBadRequestResponse.js","
|
|
1
|
+
{"version":3,"file":"IBadRequestResponse.js","sources":["../../../../../src/models/responses/errors/IBadRequestResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * The server cannot process the request, see the content for more details.\n */\nexport interface IBadRequestResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode: typeof HttpStatusCode.badRequest;\n\n\t/**\n\t * The body which contains the error.\n\t */\n\tbody: IError;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IConflictResponse.js","
|
|
1
|
+
{"version":3,"file":"IConflictResponse.js","sources":["../../../../../src/models/responses/errors/IConflictResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * The request resulted in a conflicting operation, see the content for more details.\n */\nexport interface IConflictResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode: typeof HttpStatusCode.conflict;\n\n\t/**\n\t * The body which contains the error.\n\t */\n\tbody: IError;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IForbiddenResponse.js","
|
|
1
|
+
{"version":3,"file":"IForbiddenResponse.js","sources":["../../../../../src/models/responses/errors/IForbiddenResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * The operation that you tried to perform is not possible, see the content for more details.\n */\nexport interface IForbiddenResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode: typeof HttpStatusCode.forbidden;\n\n\t/**\n\t * The body which contains the error.\n\t */\n\tbody: IError;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IInternalServerErrorResponse.js","
|
|
1
|
+
{"version":3,"file":"IInternalServerErrorResponse.js","sources":["../../../../../src/models/responses/errors/IInternalServerErrorResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * The server has encountered a situation it does not know how to handle, see the content for more details.\n */\nexport interface IInternalServerErrorResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode: typeof HttpStatusCode.internalServerError;\n\n\t/**\n\t * The body which contains the error.\n\t */\n\tbody: IError;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"INotFoundResponse.js","
|
|
1
|
+
{"version":3,"file":"INotFoundResponse.js","sources":["../../../../../src/models/responses/errors/INotFoundResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * The resource you tried to access does not exist, see the content for more details.\n */\nexport interface INotFoundResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode: typeof HttpStatusCode.notFound;\n\n\t/**\n\t * The body which contains the error.\n\t */\n\tbody: IError & {\n\t\t/**\n\t\t * The id if the item that was not found.\n\t\t */\n\t\tnotFoundId?: string;\n\t};\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"INotImplementedResponse.js","
|
|
1
|
+
{"version":3,"file":"INotImplementedResponse.js","sources":["../../../../../src/models/responses/errors/INotImplementedResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * The operation that you tried to perform is not implemented, see the content for more details.\n */\nexport interface INotImplementedResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode: typeof HttpStatusCode.notImplemented;\n\n\t/**\n\t * The body which contains the error.\n\t */\n\tbody: IError;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ITooManyRequestsResponse.js","
|
|
1
|
+
{"version":3,"file":"ITooManyRequestsResponse.js","sources":["../../../../../src/models/responses/errors/ITooManyRequestsResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * The request resulted in too many requests, see the content for more details.\n */\nexport interface ITooManyRequestsResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode: typeof HttpStatusCode.tooManyRequests;\n\n\t/**\n\t * The body which contains the error.\n\t */\n\tbody: IError;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IUnauthorizedResponse.js","
|
|
1
|
+
{"version":3,"file":"IUnauthorizedResponse.js","sources":["../../../../../src/models/responses/errors/IUnauthorizedResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * You are not authorized to use the API or no credentials were supplied, see the content for more details.\n */\nexport interface IUnauthorizedResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode: typeof HttpStatusCode.unauthorized;\n\n\t/**\n\t * The body which contains the error.\n\t */\n\tbody: IError;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IUnprocessableEntityResponse.js","
|
|
1
|
+
{"version":3,"file":"IUnprocessableEntityResponse.js","sources":["../../../../../src/models/responses/errors/IUnprocessableEntityResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IError } from \"@3sixty/core\";\nimport type { HttpStatusCode } from \"@3sixty/web\";\n\n/**\n * The server cannot process the request, see the content for more details.\n */\nexport interface IUnprocessableEntityResponse {\n\t/**\n\t * Response status code.\n\t */\n\tstatusCode: typeof HttpStatusCode.unprocessableEntity;\n\n\t/**\n\t * The body which contains the error.\n\t */\n\tbody: IError;\n}\n"]}
|