diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 6369ac4..0000000 --- a/docs/README.md +++ /dev/null @@ -1,309 +0,0 @@ -pubsub-http-handler - -# pubsub-http-handler - -## Table of contents - -### Classes - -- [PubSubHandlerResponse](classes/PubSubHandlerResponse.md) - -### Interfaces - -- [CreatePubSubHandlerResponse](interfaces/CreatePubSubHandlerResponse.md) -- [HandlePubSubMessageArgs](interfaces/HandlePubSubMessageArgs.md) -- [PubSubCloudFunctionsConfig](interfaces/PubSubCloudFunctionsConfig.md) -- [PubSubConfig](interfaces/PubSubConfig.md) -- [PubSubServerConfig](interfaces/PubSubServerConfig.md) - -### Type Aliases - -- [CloudFunctionFun](README.md#cloudfunctionfun) -- [OnErrorHandler](README.md#onerrorhandler) -- [PubSubHandler](README.md#pubsubhandler) -- [PubSubMessageType](README.md#pubsubmessagetype) -- [PubSubRequestType](README.md#pubsubrequesttype) - -### Variables - -- [PubSubMessage](README.md#pubsubmessage) -- [PubSubRequest](README.md#pubsubrequest) - -### Functions - -- [createPubSubCloudFunctions](README.md#createpubsubcloudfunctions) -- [createPubSubServer](README.md#createpubsubserver) -- [handlePubSubMessage](README.md#handlepubsubmessage) -- [makePubSubConfig](README.md#makepubsubconfig) -- [pubSubFastifyPlugin](README.md#pubsubfastifyplugin) - -## Type Aliases - -### CloudFunctionFun - -Ƭ **CloudFunctionFun**: (`req`: `express.Request`, `res`: `express.Response`) => `Promise`<`void`\> - -#### Type declaration - -▸ (`req`, `res`): `Promise`<`void`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `req` | `express.Request` | -| `res` | `express.Response` | - -##### Returns - -`Promise`<`void`\> - -#### Defined in - -[src/methods/cloud-functions.ts:12](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/methods/cloud-functions.ts#L12) - -___ - -### OnErrorHandler - -Ƭ **OnErrorHandler**<`Context`\>: (`error`: `unknown`, `context`: `Context`) => `void` \| `Promise`<`void`\> - -#### Type parameters - -| Name | -| :------ | -| `Context` | - -#### Type declaration - -▸ (`error`, `context`): `void` \| `Promise`<`void`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `error` | `unknown` | -| `context` | `Context` | - -##### Returns - -`void` \| `Promise`<`void`\> - -#### Defined in - -[src/types.ts:60](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L60) - -___ - -### PubSubHandler - -Ƭ **PubSubHandler**<`Data`, `Context`\>: (`args`: { `context?`: `Context` ; `data`: `Data` ; `log`: `FastifyBaseLogger` ; `message`: [`PubSubMessageType`](README.md#pubsubmessagetype) }) => `Promise`<[`PubSubHandlerResponse`](classes/PubSubHandlerResponse.md) \| `void`\> \| [`PubSubHandlerResponse`](classes/PubSubHandlerResponse.md) \| `void` - -#### Type parameters - -| Name | -| :------ | -| `Data` | -| `Context` | - -#### Type declaration - -▸ (`args`): `Promise`<[`PubSubHandlerResponse`](classes/PubSubHandlerResponse.md) \| `void`\> \| [`PubSubHandlerResponse`](classes/PubSubHandlerResponse.md) \| `void` - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `args` | `Object` | -| `args.context?` | `Context` | -| `args.data` | `Data` | -| `args.log` | `FastifyBaseLogger` | -| `args.message` | [`PubSubMessageType`](README.md#pubsubmessagetype) | - -##### Returns - -`Promise`<[`PubSubHandlerResponse`](classes/PubSubHandlerResponse.md) \| `void`\> \| [`PubSubHandlerResponse`](classes/PubSubHandlerResponse.md) \| `void` - -#### Defined in - -[src/types.ts:53](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L53) - -___ - -### PubSubMessageType - -Ƭ **PubSubMessageType**: `Static` - -#### Defined in - -[src/types.ts:40](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L40) - -___ - -### PubSubRequestType - -Ƭ **PubSubRequestType**: `Static` - -#### Defined in - -[src/types.ts:47](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L47) - -## Variables - -### PubSubMessage - -• `Const` **PubSubMessage**: `TObject`<{ `attributes`: `TOptional`<`TRecord`<`TString`, `TString`\>\> ; `data`: `TString` ; `messageId`: `TOptional`<`TString`\> }\> - -#### Defined in - -[src/types.ts:34](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L34) - -___ - -### PubSubRequest - -• `Const` **PubSubRequest**: `TObject`<{ `message`: `TObject`<{ `attributes`: `TOptional`<`TRecord`<`TString`, `TString`\>\> ; `data`: `TString` ; `messageId`: `TOptional`<`TString`\> }\> = PubSubMessage; `subscription`: `TString` }\> - -#### Defined in - -[src/types.ts:42](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L42) - -## Functions - -### createPubSubCloudFunctions - -▸ **createPubSubCloudFunctions**<`Data`, `Context`\>(`handler`, `options?`): [`CloudFunctionFun`](README.md#cloudfunctionfun) - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Data` | `unknown` | -| `Context` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `handler` | [`PubSubHandler`](README.md#pubsubhandler)<`Data`, `Context`\> | -| `options` | [`PubSubCloudFunctionsConfig`](interfaces/PubSubCloudFunctionsConfig.md)<`Data`, `Context`\> | - -#### Returns - -[`CloudFunctionFun`](README.md#cloudfunctionfun) - -#### Defined in - -[src/methods/cloud-functions.ts:17](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/methods/cloud-functions.ts#L17) - -___ - -### createPubSubServer - -▸ **createPubSubServer**<`Data`\>(`handler`, `config?`): [`CreatePubSubHandlerResponse`](interfaces/CreatePubSubHandlerResponse.md) - -#### Type parameters - -| Name | -| :------ | -| `Data` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `handler` | [`PubSubHandler`](README.md#pubsubhandler)<`Data`, `FastifyRequest`<`RouteGenericInterface`, `RawServerDefault`, `IncomingMessage`, `FastifySchema`, `FastifyTypeProviderDefault`, `unknown`, `FastifyBaseLogger`, `ResolveFastifyRequestType`<`FastifyTypeProviderDefault`, `FastifySchema`, `RouteGenericInterface`\>\>\> | -| `config` | [`PubSubServerConfig`](interfaces/PubSubServerConfig.md)<`Data`, `FastifyRequest`<`RouteGenericInterface`, `RawServerDefault`, `IncomingMessage`, `FastifySchema`, `FastifyTypeProviderDefault`, `unknown`, `FastifyBaseLogger`, `ResolveFastifyRequestType`<`FastifyTypeProviderDefault`, `FastifySchema`, `RouteGenericInterface`\>\>\> | - -#### Returns - -[`CreatePubSubHandlerResponse`](interfaces/CreatePubSubHandlerResponse.md) - -#### Defined in - -[src/methods/server.ts:39](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/methods/server.ts#L39) - -___ - -### handlePubSubMessage - -▸ **handlePubSubMessage**<`Data`, `Context`\>(`args`): `Promise`<[`PubSubHandlerResponse`](classes/PubSubHandlerResponse.md) \| `void`\> - -#### Type parameters - -| Name | -| :------ | -| `Data` | -| `Context` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `args` | [`HandlePubSubMessageArgs`](interfaces/HandlePubSubMessageArgs.md)<`Data`, `Context`\> | - -#### Returns - -`Promise`<[`PubSubHandlerResponse`](classes/PubSubHandlerResponse.md) \| `void`\> - -#### Defined in - -[src/common.ts:5](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/common.ts#L5) - -___ - -### makePubSubConfig - -▸ **makePubSubConfig**<`Data`, `Context`\>(`data`): [`PubSubConfig`](interfaces/PubSubConfig.md)<`Data`, `Context`\> - -#### Type parameters - -| Name | -| :------ | -| `Data` | -| `Context` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | [`PubSubConfig`](interfaces/PubSubConfig.md)<`Data`, `Context`\> | - -#### Returns - -[`PubSubConfig`](interfaces/PubSubConfig.md)<`Data`, `Context`\> - -#### Defined in - -[src/utils.ts:3](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/utils.ts#L3) - -___ - -### pubSubFastifyPlugin - -▸ **pubSubFastifyPlugin**<`Data`\>(`instance`, `opts`): `Promise`<`void`\> - -FastifyPluginAsync - -Fastify allows the user to extend its functionalities with plugins. A plugin can be a set of routes, a server decorator or whatever. To activate plugins, use the `fastify.register()` method. - -#### Type parameters - -| Name | Type | -| :------ | :------ | -| `Data` | `unknown` | - -#### Parameters - -| Name | Type | -| :------ | :------ | -| `instance` | `FastifyInstance`<`RawServerDefault`, `IncomingMessage`, `ServerResponse`<`IncomingMessage`\>, `FastifyBaseLogger`, `FastifyTypeProviderDefault`\> | -| `opts` | [`PubSubConfig`](interfaces/PubSubConfig.md)<`Data`, `FastifyRequest`<`RouteGenericInterface`, `RawServerDefault`, `IncomingMessage`, `FastifySchema`, `FastifyTypeProviderDefault`, `unknown`, `FastifyBaseLogger`, `ResolveFastifyRequestType`<`FastifyTypeProviderDefault`, `FastifySchema`, `RouteGenericInterface`\>\>\> | - -#### Returns - -`Promise`<`void`\> - -#### Defined in - -node_modules/fastify/types/plugin.d.ts:28 diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css new file mode 100644 index 0000000..1797828 --- /dev/null +++ b/docs/assets/highlight.css @@ -0,0 +1,36 @@ +:root { + --light-hl-0: #0000FF; + --dark-hl-0: #569CD6; + --light-hl-1: #000000; + --dark-hl-1: #D4D4D4; + --light-code-background: #FFFFFF; + --dark-code-background: #1E1E1E; +} + +@media (prefers-color-scheme: light) { :root { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --code-background: var(--light-code-background); +} } + +@media (prefers-color-scheme: dark) { :root { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --code-background: var(--dark-code-background); +} } + +:root[data-theme='light'] { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --code-background: var(--light-code-background); +} + +:root[data-theme='dark'] { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --code-background: var(--dark-code-background); +} + +.hl-0 { color: var(--hl-0); } +.hl-1 { color: var(--hl-1); } +pre, code { background: var(--code-background); } diff --git a/docs/assets/main.js b/docs/assets/main.js new file mode 100644 index 0000000..932e185 --- /dev/null +++ b/docs/assets/main.js @@ -0,0 +1,58 @@ +"use strict"; +"use strict";(()=>{var be=Object.create;var re=Object.defineProperty;var Se=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var Te=Object.getPrototypeOf,ke=Object.prototype.hasOwnProperty;var Qe=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Pe=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of we(e))!ke.call(t,i)&&i!==r&&re(t,i,{get:()=>e[i],enumerable:!(n=Se(e,i))||n.enumerable});return t};var Ie=(t,e,r)=>(r=t!=null?be(Te(t)):{},Pe(e||!t||!t.__esModule?re(r,"default",{value:t,enumerable:!0}):r,t));var ae=Qe((se,oe)=>{(function(){var t=function(e){var r=new t.Builder;return r.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),r.searchPipeline.add(t.stemmer),e.call(r,r),r.build()};t.version="2.3.9";t.utils={},t.utils.warn=function(e){return function(r){e.console&&console.warn&&console.warn(r)}}(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var r=Object.create(null),n=Object.keys(e),i=0;i0){var d=t.utils.clone(r)||{};d.position=[a,u],d.index=s.length,s.push(new t.Token(n.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,r){r in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+r),e.label=r,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var r=e.label&&e.label in this.registeredFunctions;r||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var r=new t.Pipeline;return e.forEach(function(n){var i=t.Pipeline.registeredFunctions[n];if(i)r.add(i);else throw new Error("Cannot load unregistered function: "+n)}),r},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(r){t.Pipeline.warnIfFunctionNotRegistered(r),this._stack.push(r)},this)},t.Pipeline.prototype.after=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");n=n+1,this._stack.splice(n,0,r)},t.Pipeline.prototype.before=function(e,r){t.Pipeline.warnIfFunctionNotRegistered(r);var n=this._stack.indexOf(e);if(n==-1)throw new Error("Cannot find existingFn");this._stack.splice(n,0,r)},t.Pipeline.prototype.remove=function(e){var r=this._stack.indexOf(e);r!=-1&&this._stack.splice(r,1)},t.Pipeline.prototype.run=function(e){for(var r=this._stack.length,n=0;n1&&(oe&&(n=s),o!=e);)i=n-r,s=r+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(ol?d+=2:a==l&&(r+=n[u+1]*i[d+1],u+=2,d+=2);return r},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),r=1,n=0;r0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}if(s.str.length==0&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var u=s.node.edges["*"];else{var u=new t.TokenSet;s.node.edges["*"]=u}s.str.length==1&&(u.final=!0),i.push({node:u,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),m=s.str.charAt(1),y;m in s.node.edges?y=s.node.edges[m]:(y=new t.TokenSet,s.node.edges[m]=y),s.str.length==1&&(y.final=!0),i.push({node:y,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return n},t.TokenSet.fromString=function(e){for(var r=new t.TokenSet,n=r,i=0,s=e.length;i=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),l=0;l1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,r){var n=e[this._ref],i=Object.keys(this._fields);this._documents[n]=r||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,r;do e=this.next(),r=e.charCodeAt(0);while(r>47&&r<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var r=e.next();if(r==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(r.charCodeAt(0)==92){e.escapeCharacter();continue}if(r==":")return t.QueryLexer.lexField;if(r=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(r=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(r=="+"&&e.width()===1||r=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(r.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,r){this.lexer=new t.QueryLexer(e),this.query=r,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var r=e.peekLexeme();if(r!=null)switch(r.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expected either a field or a term, found "+r.type;throw r.str.length>=1&&(n+=" with value '"+r.str+"'"),new t.QueryParseError(n,r.start,r.end)}},t.QueryParser.parsePresence=function(e){var r=e.consumeLexeme();if(r!=null){switch(r.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var n="unrecognised presence operator'"+r.str+"'";throw new t.QueryParseError(n,r.start,r.end)}var i=e.peekLexeme();if(i==null){var n="expecting term or field, found nothing";throw new t.QueryParseError(n,r.start,r.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var n="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(n,i.start,i.end)}}},t.QueryParser.parseField=function(e){var r=e.consumeLexeme();if(r!=null){if(e.query.allFields.indexOf(r.str)==-1){var n=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+r.str+"', possible fields: "+n;throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.fields=[r.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,r.start,r.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var r=e.consumeLexeme();if(r!=null){e.currentClause.term=r.str.toLowerCase(),r.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var n=e.peekLexeme();if(n==null){e.nextClause();return}switch(n.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+n.type+"'";throw new t.QueryParseError(i,n.start,n.end)}}},t.QueryParser.parseEditDistance=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="edit distance must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.editDistance=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var r=e.consumeLexeme();if(r!=null){var n=parseInt(r.str,10);if(isNaN(n)){var i="boost must be numeric";throw new t.QueryParseError(i,r.start,r.end)}e.currentClause.boost=n;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},function(e,r){typeof define=="function"&&define.amd?define(r):typeof se=="object"?oe.exports=r():e.lunr=r()}(this,function(){return t})})()});var ne=[];function G(t,e){ne.push({selector:e,constructor:t})}var U=class{constructor(){this.alwaysVisibleMember=null;this.createComponents(document.body),this.ensureActivePageVisible(),this.ensureFocusedElementVisible(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible())}createComponents(e){ne.forEach(r=>{e.querySelectorAll(r.selector).forEach(n=>{n.dataset.hasInstance||(new r.constructor({el:n,app:this}),n.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),r=e?.parentElement;for(;r&&!r.classList.contains(".tsd-navigation");)r instanceof HTMLDetailsElement&&e?.parentElement?.parentElement!==r&&(r.open=!0),r=r.parentElement;if(e){let n=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=n}}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let r=e.parentElement;for(;r&&r.tagName!=="SECTION";)r=r.parentElement;if(r&&r.offsetParent==null){this.alwaysVisibleMember=r,r.classList.add("always-visible");let n=document.createElement("p");n.classList.add("warning"),n.textContent="This member is normally hidden due to your filter settings.",r.prepend(n)}}};var ie=(t,e=100)=>{let r;return()=>{clearTimeout(r),r=setTimeout(()=>t(),e)}};var ce=Ie(ae());function de(){let t=document.getElementById("tsd-search");if(!t)return;let e=document.getElementById("tsd-search-script");t.classList.add("loading"),e&&(e.addEventListener("error",()=>{t.classList.remove("loading"),t.classList.add("failure")}),e.addEventListener("load",()=>{t.classList.remove("loading"),t.classList.add("ready")}),window.searchData&&t.classList.remove("loading"));let r=document.querySelector("#tsd-search input"),n=document.querySelector("#tsd-search .results");if(!r||!n)throw new Error("The input field or the result list wrapper was not found");let i=!1;n.addEventListener("mousedown",()=>i=!0),n.addEventListener("mouseup",()=>{i=!1,t.classList.remove("has-focus")}),r.addEventListener("focus",()=>t.classList.add("has-focus")),r.addEventListener("blur",()=>{i||(i=!1,t.classList.remove("has-focus"))});let s={base:t.dataset.base+"/"};Ce(t,n,r,s)}function Ce(t,e,r,n){r.addEventListener("input",ie(()=>{_e(t,e,r,n)},200));let i=!1;r.addEventListener("keydown",s=>{i=!0,s.key=="Enter"?Re(e,r):s.key=="Escape"?r.blur():s.key=="ArrowUp"?ue(e,-1):s.key==="ArrowDown"?ue(e,1):i=!1}),r.addEventListener("keypress",s=>{i&&s.preventDefault()}),document.body.addEventListener("keydown",s=>{s.altKey||s.ctrlKey||s.metaKey||!r.matches(":focus")&&s.key==="/"&&(r.focus(),s.preventDefault())})}function Oe(t,e){t.index||window.searchData&&(e.classList.remove("loading"),e.classList.add("ready"),t.data=window.searchData,t.index=ce.Index.load(window.searchData.index))}function _e(t,e,r,n){if(Oe(n,t),!n.index||!n.data)return;e.textContent="";let i=r.value.trim(),s=i?n.index.search(`*${i}*`):[];for(let o=0;oa.score-o.score);for(let o=0,a=Math.min(10,s.length);o${le(l.parent,i)}.${u}`);let d=document.createElement("li");d.classList.value=l.classes??"";let m=document.createElement("a");m.href=n.base+l.url,m.innerHTML=u,d.append(m),e.appendChild(d)}}function ue(t,e){let r=t.querySelector(".current");if(!r)r=t.querySelector(e==1?"li:first-child":"li:last-child"),r&&r.classList.add("current");else{let n=r;if(e===1)do n=n.nextElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);else do n=n.previousElementSibling??void 0;while(n instanceof HTMLElement&&n.offsetParent==null);n&&(r.classList.remove("current"),n.classList.add("current"))}}function Re(t,e){let r=t.querySelector(".current");if(r||(r=t.querySelector("li:first-child")),r){let n=r.querySelector("a");n&&(window.location.href=n.href),e.blur()}}function le(t,e){if(e==="")return t;let r=t.toLocaleLowerCase(),n=e.toLocaleLowerCase(),i=[],s=0,o=r.indexOf(n);for(;o!=-1;)i.push(K(t.substring(s,o)),`${K(t.substring(o,o+n.length))}`),s=o+n.length,o=r.indexOf(n,s);return i.push(K(t.substring(s))),i.join("")}var Fe={"&":"&","<":"<",">":">","'":"'",'"':"""};function K(t){return t.replace(/[&<>"'"]/g,e=>Fe[e])}var P=class{constructor(e){this.el=e.el,this.app=e.app}};var M="mousedown",fe="mousemove",N="mouseup",J={x:0,y:0},he=!1,ee=!1,Me=!1,D=!1,pe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(pe?"is-mobile":"not-mobile");pe&&"ontouchstart"in document.documentElement&&(Me=!0,M="touchstart",fe="touchmove",N="touchend");document.addEventListener(M,t=>{ee=!0,D=!1;let e=M=="touchstart"?t.targetTouches[0]:t;J.y=e.pageY||0,J.x=e.pageX||0});document.addEventListener(fe,t=>{if(ee&&!D){let e=M=="touchstart"?t.targetTouches[0]:t,r=J.x-(e.pageX||0),n=J.y-(e.pageY||0);D=Math.sqrt(r*r+n*n)>10}});document.addEventListener(N,()=>{ee=!1});document.addEventListener("click",t=>{he&&(t.preventDefault(),t.stopImmediatePropagation(),he=!1)});var X=class extends P{constructor(r){super(r);this.className=this.el.dataset.toggle||"",this.el.addEventListener(N,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(M,n=>this.onDocumentPointerDown(n)),document.addEventListener(N,n=>this.onDocumentPointerUp(n))}setActive(r){if(this.active==r)return;this.active=r,document.documentElement.classList.toggle("has-"+this.className,r),this.el.classList.toggle("active",r);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(r){D||(this.setActive(!0),r.preventDefault())}onDocumentPointerDown(r){if(this.active){if(r.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(r){if(!D&&this.active&&r.target.closest(".col-sidebar")){let n=r.target.closest("a");if(n){let i=window.location.href;i.indexOf("#")!=-1&&(i=i.substring(0,i.indexOf("#"))),n.href.substring(0,i.length)==i&&setTimeout(()=>this.setActive(!1),250)}}}};var te;try{te=localStorage}catch{te={getItem(){return null},setItem(){}}}var Q=te;var me=document.head.appendChild(document.createElement("style"));me.dataset.for="filters";var Y=class extends P{constructor(r){super(r);this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),me.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`}fromLocalStorage(){let r=Q.getItem(this.key);return r?r==="true":this.el.checked}setLocalStorage(r){Q.setItem(this.key,r.toString()),this.value=r,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),this.app.filterChanged(),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let n=Array.from(r.querySelectorAll(".tsd-index-link")).every(i=>i.offsetParent==null);r.style.display=n?"none":"block"})}};var Z=class extends P{constructor(r){super(r);this.summary=this.el.querySelector(".tsd-accordion-summary"),this.icon=this.summary.querySelector("svg"),this.key=`tsd-accordion-${this.summary.dataset.key??this.summary.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`;let n=Q.getItem(this.key);this.el.open=n?n==="true":this.el.open,this.el.addEventListener("toggle",()=>this.update()),this.update()}update(){this.icon.style.transform=`rotate(${this.el.open?0:-90}deg)`,Q.setItem(this.key,this.el.open.toString())}};function ve(t){let e=Q.getItem("tsd-theme")||"os";t.value=e,ye(e),t.addEventListener("change",()=>{Q.setItem("tsd-theme",t.value),ye(t.value)})}function ye(t){document.documentElement.dataset.theme=t}addEventListener("load",()=>{de(),G(X,"a[data-toggle]"),G(Z,".tsd-index-accordion"),G(Y,".tsd-filter-item input[type=checkbox]");let t=document.getElementById("tsd-theme");t&&ve(t);let e=new U;Object.defineProperty(window,"app",{value:e})});})(); +/*! Bundled license information: + +lunr/lunr.js: + (** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + *) + (*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + *) + (*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + *) +*/ diff --git a/docs/assets/search.js b/docs/assets/search.js new file mode 100644 index 0000000..6ed35c9 --- /dev/null +++ b/docs/assets/search.js @@ -0,0 +1 @@ +window.searchData = JSON.parse("{\"rows\":[{\"kind\":64,\"name\":\"createPubSubCloudFunctions\",\"url\":\"functions/createPubSubCloudFunctions.html\",\"classes\":\"\"},{\"kind\":256,\"name\":\"PubSubCloudFunctionsConfig\",\"url\":\"interfaces/PubSubCloudFunctionsConfig.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"logger\",\"url\":\"interfaces/PubSubCloudFunctionsConfig.html#logger\",\"classes\":\"\",\"parent\":\"PubSubCloudFunctionsConfig\"},{\"kind\":1024,\"name\":\"context\",\"url\":\"interfaces/PubSubCloudFunctionsConfig.html#context\",\"classes\":\"\",\"parent\":\"PubSubCloudFunctionsConfig\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/PubSubCloudFunctionsConfig.html#context.__type\",\"classes\":\"\",\"parent\":\"PubSubCloudFunctionsConfig.context\"},{\"kind\":1024,\"name\":\"onError\",\"url\":\"interfaces/PubSubCloudFunctionsConfig.html#onError\",\"classes\":\"tsd-is-inherited\",\"parent\":\"PubSubCloudFunctionsConfig\"},{\"kind\":1024,\"name\":\"parser\",\"url\":\"interfaces/PubSubCloudFunctionsConfig.html#parser\",\"classes\":\"tsd-is-inherited\",\"parent\":\"PubSubCloudFunctionsConfig\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/PubSubCloudFunctionsConfig.html#parser.__type-2\",\"classes\":\"\",\"parent\":\"PubSubCloudFunctionsConfig.parser\"},{\"kind\":1024,\"name\":\"parseJson\",\"url\":\"interfaces/PubSubCloudFunctionsConfig.html#parseJson\",\"classes\":\"tsd-is-inherited\",\"parent\":\"PubSubCloudFunctionsConfig\"},{\"kind\":1024,\"name\":\"path\",\"url\":\"interfaces/PubSubCloudFunctionsConfig.html#path\",\"classes\":\"tsd-is-inherited\",\"parent\":\"PubSubCloudFunctionsConfig\"},{\"kind\":4194304,\"name\":\"CloudFunctionFun\",\"url\":\"types/CloudFunctionFun.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/CloudFunctionFun.html#__type\",\"classes\":\"\",\"parent\":\"CloudFunctionFun\"},{\"kind\":256,\"name\":\"PubSubHandlerFastifyConfig\",\"url\":\"interfaces/PubSubHandlerFastifyConfig.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"handler\",\"url\":\"interfaces/PubSubHandlerFastifyConfig.html#handler\",\"classes\":\"\",\"parent\":\"PubSubHandlerFastifyConfig\"},{\"kind\":1024,\"name\":\"context\",\"url\":\"interfaces/PubSubHandlerFastifyConfig.html#context\",\"classes\":\"\",\"parent\":\"PubSubHandlerFastifyConfig\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/PubSubHandlerFastifyConfig.html#context.__type\",\"classes\":\"\",\"parent\":\"PubSubHandlerFastifyConfig.context\"},{\"kind\":1024,\"name\":\"onError\",\"url\":\"interfaces/PubSubHandlerFastifyConfig.html#onError\",\"classes\":\"tsd-is-inherited\",\"parent\":\"PubSubHandlerFastifyConfig\"},{\"kind\":1024,\"name\":\"parser\",\"url\":\"interfaces/PubSubHandlerFastifyConfig.html#parser\",\"classes\":\"tsd-is-inherited\",\"parent\":\"PubSubHandlerFastifyConfig\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/PubSubHandlerFastifyConfig.html#parser.__type-2\",\"classes\":\"\",\"parent\":\"PubSubHandlerFastifyConfig.parser\"},{\"kind\":1024,\"name\":\"parseJson\",\"url\":\"interfaces/PubSubHandlerFastifyConfig.html#parseJson\",\"classes\":\"tsd-is-inherited\",\"parent\":\"PubSubHandlerFastifyConfig\"},{\"kind\":1024,\"name\":\"path\",\"url\":\"interfaces/PubSubHandlerFastifyConfig.html#path\",\"classes\":\"tsd-is-inherited\",\"parent\":\"PubSubHandlerFastifyConfig\"},{\"kind\":64,\"name\":\"pubSubFastifyPlugin\",\"url\":\"functions/pubSubFastifyPlugin.html\",\"classes\":\"\"},{\"kind\":64,\"name\":\"handlePubSubMessage\",\"url\":\"functions/handlePubSubMessage.html\",\"classes\":\"\"},{\"kind\":256,\"name\":\"HandlePubSubMessageArgs\",\"url\":\"interfaces/HandlePubSubMessageArgs.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"message\",\"url\":\"interfaces/HandlePubSubMessageArgs.html#message\",\"classes\":\"\",\"parent\":\"HandlePubSubMessageArgs\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/HandlePubSubMessageArgs.html#message.__type\",\"classes\":\"\",\"parent\":\"HandlePubSubMessageArgs.message\"},{\"kind\":1024,\"name\":\"attributes\",\"url\":\"interfaces/HandlePubSubMessageArgs.html#message.__type.attributes\",\"classes\":\"\",\"parent\":\"HandlePubSubMessageArgs.message.__type\"},{\"kind\":1024,\"name\":\"messageId\",\"url\":\"interfaces/HandlePubSubMessageArgs.html#message.__type.messageId\",\"classes\":\"\",\"parent\":\"HandlePubSubMessageArgs.message.__type\"},{\"kind\":1024,\"name\":\"data\",\"url\":\"interfaces/HandlePubSubMessageArgs.html#message.__type.data\",\"classes\":\"\",\"parent\":\"HandlePubSubMessageArgs.message.__type\"},{\"kind\":1024,\"name\":\"handler\",\"url\":\"interfaces/HandlePubSubMessageArgs.html#handler\",\"classes\":\"\",\"parent\":\"HandlePubSubMessageArgs\"},{\"kind\":1024,\"name\":\"parseJson\",\"url\":\"interfaces/HandlePubSubMessageArgs.html#parseJson\",\"classes\":\"\",\"parent\":\"HandlePubSubMessageArgs\"},{\"kind\":1024,\"name\":\"parser\",\"url\":\"interfaces/HandlePubSubMessageArgs.html#parser\",\"classes\":\"\",\"parent\":\"HandlePubSubMessageArgs\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/HandlePubSubMessageArgs.html#parser.__type-1\",\"classes\":\"\",\"parent\":\"HandlePubSubMessageArgs.parser\"},{\"kind\":1024,\"name\":\"context\",\"url\":\"interfaces/HandlePubSubMessageArgs.html#context\",\"classes\":\"\",\"parent\":\"HandlePubSubMessageArgs\"},{\"kind\":1024,\"name\":\"log\",\"url\":\"interfaces/HandlePubSubMessageArgs.html#log\",\"classes\":\"\",\"parent\":\"HandlePubSubMessageArgs\"},{\"kind\":32,\"name\":\"pubSubMessageSchema\",\"url\":\"variables/pubSubMessageSchema.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"PubSubMessage\",\"url\":\"types/PubSubMessage.html\",\"classes\":\"\"},{\"kind\":32,\"name\":\"pubSubRequestSchema\",\"url\":\"variables/pubSubRequestSchema.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"PubSubRequest\",\"url\":\"types/PubSubRequest.html\",\"classes\":\"\"},{\"kind\":4194304,\"name\":\"OnErrorHandler\",\"url\":\"types/OnErrorHandler.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/OnErrorHandler.html#__type\",\"classes\":\"\",\"parent\":\"OnErrorHandler\"},{\"kind\":128,\"name\":\"PubSubHandlerResponse\",\"url\":\"classes/PubSubHandlerResponse.html\",\"classes\":\"\"},{\"kind\":512,\"name\":\"constructor\",\"url\":\"classes/PubSubHandlerResponse.html#constructor\",\"classes\":\"\",\"parent\":\"PubSubHandlerResponse\"},{\"kind\":1024,\"name\":\"statusCode\",\"url\":\"classes/PubSubHandlerResponse.html#statusCode\",\"classes\":\"\",\"parent\":\"PubSubHandlerResponse\"},{\"kind\":4194304,\"name\":\"PubSubHandler\",\"url\":\"types/PubSubHandler.html\",\"classes\":\"\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"types/PubSubHandler.html#__type\",\"classes\":\"\",\"parent\":\"PubSubHandler\"},{\"kind\":256,\"name\":\"PubSubConfig\",\"url\":\"interfaces/PubSubConfig.html\",\"classes\":\"\"},{\"kind\":1024,\"name\":\"onError\",\"url\":\"interfaces/PubSubConfig.html#onError\",\"classes\":\"\",\"parent\":\"PubSubConfig\"},{\"kind\":1024,\"name\":\"parser\",\"url\":\"interfaces/PubSubConfig.html#parser\",\"classes\":\"\",\"parent\":\"PubSubConfig\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/PubSubConfig.html#parser.__type-2\",\"classes\":\"\",\"parent\":\"PubSubConfig.parser\"},{\"kind\":1024,\"name\":\"context\",\"url\":\"interfaces/PubSubConfig.html#context\",\"classes\":\"\",\"parent\":\"PubSubConfig\"},{\"kind\":65536,\"name\":\"__type\",\"url\":\"interfaces/PubSubConfig.html#context.__type\",\"classes\":\"\",\"parent\":\"PubSubConfig.context\"},{\"kind\":1024,\"name\":\"parseJson\",\"url\":\"interfaces/PubSubConfig.html#parseJson\",\"classes\":\"\",\"parent\":\"PubSubConfig\"},{\"kind\":1024,\"name\":\"path\",\"url\":\"interfaces/PubSubConfig.html#path\",\"classes\":\"\",\"parent\":\"PubSubConfig\"},{\"kind\":64,\"name\":\"makePubSubConfig\",\"url\":\"functions/makePubSubConfig.html\",\"classes\":\"\"}],\"index\":{\"version\":\"2.3.9\",\"fields\":[\"name\",\"comment\"],\"fieldVectors\":[[\"name/0\",[0,36.199]],[\"comment/0\",[]],[\"name/1\",[1,36.199]],[\"comment/1\",[]],[\"name/2\",[2,36.199]],[\"comment/2\",[]],[\"name/3\",[3,25.213]],[\"comment/3\",[]],[\"name/4\",[4,15.83]],[\"comment/4\",[]],[\"name/5\",[5,27.726]],[\"comment/5\",[]],[\"name/6\",[6,25.213]],[\"comment/6\",[]],[\"name/7\",[4,15.83]],[\"comment/7\",[]],[\"name/8\",[7,25.213]],[\"comment/8\",[]],[\"name/9\",[8,27.726]],[\"comment/9\",[]],[\"name/10\",[9,36.199]],[\"comment/10\",[]],[\"name/11\",[4,15.83]],[\"comment/11\",[]],[\"name/12\",[10,36.199]],[\"comment/12\",[]],[\"name/13\",[11,31.091]],[\"comment/13\",[]],[\"name/14\",[3,25.213]],[\"comment/14\",[]],[\"name/15\",[4,15.83]],[\"comment/15\",[]],[\"name/16\",[5,27.726]],[\"comment/16\",[]],[\"name/17\",[6,25.213]],[\"comment/17\",[]],[\"name/18\",[4,15.83]],[\"comment/18\",[]],[\"name/19\",[7,25.213]],[\"comment/19\",[]],[\"name/20\",[8,27.726]],[\"comment/20\",[]],[\"name/21\",[12,36.199]],[\"comment/21\",[]],[\"name/22\",[13,36.199]],[\"comment/22\",[]],[\"name/23\",[14,36.199]],[\"comment/23\",[]],[\"name/24\",[15,36.199]],[\"comment/24\",[]],[\"name/25\",[4,15.83]],[\"comment/25\",[]],[\"name/26\",[16,36.199]],[\"comment/26\",[]],[\"name/27\",[17,36.199]],[\"comment/27\",[]],[\"name/28\",[18,36.199]],[\"comment/28\",[]],[\"name/29\",[11,31.091]],[\"comment/29\",[]],[\"name/30\",[7,25.213]],[\"comment/30\",[]],[\"name/31\",[6,25.213]],[\"comment/31\",[]],[\"name/32\",[4,15.83]],[\"comment/32\",[]],[\"name/33\",[3,25.213]],[\"comment/33\",[]],[\"name/34\",[19,36.199]],[\"comment/34\",[]],[\"name/35\",[20,36.199]],[\"comment/35\",[]],[\"name/36\",[21,36.199]],[\"comment/36\",[]],[\"name/37\",[22,36.199]],[\"comment/37\",[]],[\"name/38\",[23,36.199]],[\"comment/38\",[]],[\"name/39\",[24,36.199]],[\"comment/39\",[]],[\"name/40\",[4,15.83]],[\"comment/40\",[]],[\"name/41\",[25,36.199]],[\"comment/41\",[]],[\"name/42\",[26,36.199]],[\"comment/42\",[]],[\"name/43\",[27,36.199]],[\"comment/43\",[]],[\"name/44\",[28,36.199]],[\"comment/44\",[]],[\"name/45\",[4,15.83]],[\"comment/45\",[]],[\"name/46\",[29,36.199]],[\"comment/46\",[]],[\"name/47\",[5,27.726]],[\"comment/47\",[]],[\"name/48\",[6,25.213]],[\"comment/48\",[]],[\"name/49\",[4,15.83]],[\"comment/49\",[]],[\"name/50\",[3,25.213]],[\"comment/50\",[]],[\"name/51\",[4,15.83]],[\"comment/51\",[]],[\"name/52\",[7,25.213]],[\"comment/52\",[]],[\"name/53\",[8,27.726]],[\"comment/53\",[]],[\"name/54\",[30,36.199]],[\"comment/54\",[]]],\"invertedIndex\":[[\"__type\",{\"_index\":4,\"name\":{\"4\":{},\"7\":{},\"11\":{},\"15\":{},\"18\":{},\"25\":{},\"32\":{},\"40\":{},\"45\":{},\"49\":{},\"51\":{}},\"comment\":{}}],[\"attributes\",{\"_index\":16,\"name\":{\"26\":{}},\"comment\":{}}],[\"cloudfunctionfun\",{\"_index\":9,\"name\":{\"10\":{}},\"comment\":{}}],[\"constructor\",{\"_index\":26,\"name\":{\"42\":{}},\"comment\":{}}],[\"context\",{\"_index\":3,\"name\":{\"3\":{},\"14\":{},\"33\":{},\"50\":{}},\"comment\":{}}],[\"createpubsubcloudfunctions\",{\"_index\":0,\"name\":{\"0\":{}},\"comment\":{}}],[\"data\",{\"_index\":18,\"name\":{\"28\":{}},\"comment\":{}}],[\"handlepubsubmessage\",{\"_index\":13,\"name\":{\"22\":{}},\"comment\":{}}],[\"handlepubsubmessageargs\",{\"_index\":14,\"name\":{\"23\":{}},\"comment\":{}}],[\"handler\",{\"_index\":11,\"name\":{\"13\":{},\"29\":{}},\"comment\":{}}],[\"log\",{\"_index\":19,\"name\":{\"34\":{}},\"comment\":{}}],[\"logger\",{\"_index\":2,\"name\":{\"2\":{}},\"comment\":{}}],[\"makepubsubconfig\",{\"_index\":30,\"name\":{\"54\":{}},\"comment\":{}}],[\"message\",{\"_index\":15,\"name\":{\"24\":{}},\"comment\":{}}],[\"messageid\",{\"_index\":17,\"name\":{\"27\":{}},\"comment\":{}}],[\"onerror\",{\"_index\":5,\"name\":{\"5\":{},\"16\":{},\"47\":{}},\"comment\":{}}],[\"onerrorhandler\",{\"_index\":24,\"name\":{\"39\":{}},\"comment\":{}}],[\"parsejson\",{\"_index\":7,\"name\":{\"8\":{},\"19\":{},\"30\":{},\"52\":{}},\"comment\":{}}],[\"parser\",{\"_index\":6,\"name\":{\"6\":{},\"17\":{},\"31\":{},\"48\":{}},\"comment\":{}}],[\"path\",{\"_index\":8,\"name\":{\"9\":{},\"20\":{},\"53\":{}},\"comment\":{}}],[\"pubsubcloudfunctionsconfig\",{\"_index\":1,\"name\":{\"1\":{}},\"comment\":{}}],[\"pubsubconfig\",{\"_index\":29,\"name\":{\"46\":{}},\"comment\":{}}],[\"pubsubfastifyplugin\",{\"_index\":12,\"name\":{\"21\":{}},\"comment\":{}}],[\"pubsubhandler\",{\"_index\":28,\"name\":{\"44\":{}},\"comment\":{}}],[\"pubsubhandlerfastifyconfig\",{\"_index\":10,\"name\":{\"12\":{}},\"comment\":{}}],[\"pubsubhandlerresponse\",{\"_index\":25,\"name\":{\"41\":{}},\"comment\":{}}],[\"pubsubmessage\",{\"_index\":21,\"name\":{\"36\":{}},\"comment\":{}}],[\"pubsubmessageschema\",{\"_index\":20,\"name\":{\"35\":{}},\"comment\":{}}],[\"pubsubrequest\",{\"_index\":23,\"name\":{\"38\":{}},\"comment\":{}}],[\"pubsubrequestschema\",{\"_index\":22,\"name\":{\"37\":{}},\"comment\":{}}],[\"statuscode\",{\"_index\":27,\"name\":{\"43\":{}},\"comment\":{}}]],\"pipeline\":[]}}"); \ No newline at end of file diff --git a/docs/assets/style.css b/docs/assets/style.css new file mode 100644 index 0000000..da6c789 --- /dev/null +++ b/docs/assets/style.css @@ -0,0 +1,1338 @@ +:root { + /* Light */ + --light-color-background: #f2f4f8; + --light-color-background-secondary: #eff0f1; + --light-color-warning-text: #222; + --light-color-background-warning: #e6e600; + --light-color-icon-background: var(--light-color-background); + --light-color-accent: #c5c7c9; + --light-color-active-menu-item: var(--light-color-accent); + --light-color-text: #222; + --light-color-text-aside: #6e6e6e; + --light-color-link: #1f70c2; + + --light-color-ts-project: #b111c9; + --light-color-ts-module: var(--light-color-ts-project); + --light-color-ts-namespace: var(--light-color-ts-project); + --light-color-ts-enum: #7e6f15; + --light-color-ts-enum-member: var(--light-color-ts-enum); + --light-color-ts-variable: #4760ec; + --light-color-ts-function: #572be7; + --light-color-ts-class: #1f70c2; + --light-color-ts-interface: #108024; + --light-color-ts-constructor: var(--light-color-ts-class); + --light-color-ts-property: var(--light-color-ts-variable); + --light-color-ts-method: var(--light-color-ts-function); + --light-color-ts-call-signature: var(--light-color-ts-method); + --light-color-ts-index-signature: var(--light-color-ts-property); + --light-color-ts-constructor-signature: var(--light-color-ts-constructor); + --light-color-ts-parameter: var(--light-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --light-color-ts-type-parameter: var(--light-color-ts-type-alias); + --light-color-ts-accessor: var(--light-color-ts-property); + --light-color-ts-get-signature: var(--light-color-ts-accessor); + --light-color-ts-set-signature: var(--light-color-ts-accessor); + /* object literal not included as it is not used and will be removed in 0.25 */ + --light-color-ts-type-alias: #d51270; + /* reference not included as links will be colored with the kind that it points to */ + + --light-external-icon: url("data:image/svg+xml;utf8,"); + --light-color-scheme: light; + + /* Dark */ + --dark-color-background: #2b2e33; + --dark-color-background-secondary: #1e2024; + --dark-color-background-warning: #bebe00; + --dark-color-warning-text: #222; + --dark-color-icon-background: var(--dark-color-background-secondary); + --dark-color-accent: #9096a2; + --dark-color-active-menu-item: #5d5d6a; + --dark-color-text: #f5f5f5; + --dark-color-text-aside: #dddddd; + --dark-color-link: #00aff4; + + --dark-color-ts-project: #e14dff; + --dark-color-ts-module: var(--dark-color-ts-project); + --dark-color-ts-namespace: var(--dark-color-ts-project); + --dark-color-ts-enum: #f4d93e; + --dark-color-ts-enum-member: var(--dark-color-ts-enum); + --dark-color-ts-variable: #798dff; + --dark-color-ts-function: #9772ff; + --dark-color-ts-class: #8ac4ff; + --dark-color-ts-interface: #6cff87; + --dark-color-ts-constructor: var(--dark-color-ts-class); + --dark-color-ts-property: var(--dark-color-ts-variable); + --dark-color-ts-method: var(--dark-color-ts-function); + --dark-color-ts-call-signature: var(--dark-color-ts-method); + --dark-color-ts-index-signature: var(--dark-color-ts-property); + --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); + --dark-color-ts-parameter: var(--dark-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --dark-color-ts-type-parameter: var(--dark-color-ts-type-alias); + --dark-color-ts-accessor: var(--dark-color-ts-property); + --dark-color-ts-get-signature: var(--dark-color-ts-accessor); + --dark-color-ts-set-signature: var(--dark-color-ts-accessor); + /* object literal not included as it is not used and will be removed in 0.25 */ + --dark-color-ts-type-alias: #ff6492; + /* reference not included as links will be colored with the kind that it points to */ + + --dark-external-icon: url("data:image/svg+xml;utf8,"); + --dark-color-scheme: dark; +} + +@media (prefers-color-scheme: light) { + :root { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-link: var(--light-color-link); + + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); + } +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-link: var(--dark-color-link); + + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); + } +} + +html { + color-scheme: var(--color-scheme); +} + +body { + margin: 0; +} + +:root[data-theme="light"] { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-text-aside: var(--light-color-text-aside); + --color-link: var(--light-color-link); + + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); +} + +:root[data-theme="dark"] { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-text-aside: var(--dark-color-text-aside); + --color-link: var(--dark-color-link); + + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); +} + +.always-visible, +.always-visible .tsd-signatures { + display: inherit !important; +} + +h1, +h2, +h3, +h4, +h5, +h6 { + line-height: 1.2; +} + +h1 { + font-size: 1.875rem; + margin: 0.67rem 0; +} + +h2 { + font-size: 1.5rem; + margin: 0.83rem 0; +} + +h3 { + font-size: 1.25rem; + margin: 1rem 0; +} + +h4 { + font-size: 1.05rem; + margin: 1.33rem 0; +} + +h5 { + font-size: 1rem; + margin: 1.5rem 0; +} + +h6 { + font-size: 0.875rem; + margin: 2.33rem 0; +} + +.uppercase { + text-transform: uppercase; +} + +pre { + white-space: pre; + white-space: pre-wrap; + word-wrap: break-word; +} + +dl, +menu, +ol, +ul { + margin: 1em 0; +} + +dd { + margin: 0 0 0 40px; +} + +.container { + max-width: 1700px; + padding: 0 2rem; +} + +/* Footer */ +.tsd-generator { + border-top: 1px solid var(--color-accent); + padding-top: 1rem; + padding-bottom: 1rem; + max-height: 3.5rem; +} + +.tsd-generator > p { + margin-top: 0; + margin-bottom: 0; + padding: 0 1rem; +} + +.container-main { + margin: 0 auto; + /* toolbar, footer, margin */ + min-height: calc(100vh - 41px - 56px - 4rem); +} + +@keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} +@keyframes fade-out { + from { + opacity: 1; + visibility: visible; + } + to { + opacity: 0; + } +} +@keyframes fade-in-delayed { + 0% { + opacity: 0; + } + 33% { + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes fade-out-delayed { + 0% { + opacity: 1; + visibility: visible; + } + 66% { + opacity: 0; + } + 100% { + opacity: 0; + } +} +@keyframes pop-in-from-right { + from { + transform: translate(100%, 0); + } + to { + transform: translate(0, 0); + } +} +@keyframes pop-out-to-right { + from { + transform: translate(0, 0); + visibility: visible; + } + to { + transform: translate(100%, 0); + } +} +body { + background: var(--color-background); + font-family: "Segoe UI", sans-serif; + font-size: 16px; + color: var(--color-text); +} + +a { + color: var(--color-link); + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +a.external[target="_blank"] { + background-image: var(--external-icon); + background-position: top 3px right; + background-repeat: no-repeat; + padding-right: 13px; +} + +code, +pre { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + padding: 0.2em; + margin: 0; + font-size: 0.875rem; + border-radius: 0.8em; +} + +pre { + padding: 10px; + border: 0.1em solid var(--color-accent); +} +pre code { + padding: 0; + font-size: 100%; +} + +blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 4px solid gray; +} + +.tsd-typography { + line-height: 1.333em; +} +.tsd-typography ul { + list-style: square; + padding: 0 0 0 20px; + margin: 0; +} +.tsd-typography h4, +.tsd-typography .tsd-index-panel h3, +.tsd-index-panel .tsd-typography h3, +.tsd-typography h5, +.tsd-typography h6 { + font-size: 1em; + margin: 0; +} +.tsd-typography h5, +.tsd-typography h6 { + font-weight: normal; +} +.tsd-typography p, +.tsd-typography ul, +.tsd-typography ol { + margin: 1em 0; +} + +.tsd-breadcrumb { + margin: 0; + padding: 0; + color: var(--color-text-aside); +} +.tsd-breadcrumb a { + color: var(--color-text-aside); + text-decoration: none; +} +.tsd-breadcrumb a:hover { + text-decoration: underline; +} +.tsd-breadcrumb li { + display: inline; +} +.tsd-breadcrumb li:after { + content: " / "; +} + +.tsd-comment-tags { + display: flex; + flex-direction: column; +} +dl.tsd-comment-tag-group { + display: flex; + align-items: center; + overflow: hidden; + margin: 0.5em 0; +} +dl.tsd-comment-tag-group dt { + display: flex; + margin-right: 0.5em; + font-size: 0.875em; + font-weight: normal; +} +dl.tsd-comment-tag-group dd { + margin: 0; +} +code.tsd-tag { + padding: 0.25em 0.4em; + border: 0.1em solid var(--color-accent); + margin-right: 0.25em; + font-size: 70%; +} +h1 code.tsd-tag:first-of-type { + margin-left: 0.25em; +} + +dl.tsd-comment-tag-group dd:before, +dl.tsd-comment-tag-group dd:after { + content: " "; +} +dl.tsd-comment-tag-group dd pre, +dl.tsd-comment-tag-group dd:after { + clear: both; +} +dl.tsd-comment-tag-group p { + margin: 0; +} + +.tsd-panel.tsd-comment .lead { + font-size: 1.1em; + line-height: 1.333em; + margin-bottom: 2em; +} +.tsd-panel.tsd-comment .lead:last-child { + margin-bottom: 0; +} + +.tsd-filter-visibility h4 { + font-size: 1rem; + padding-top: 0.75rem; + padding-bottom: 0.5rem; + margin: 0; +} +.tsd-filter-item:not(:last-child) { + margin-bottom: 0.5rem; +} +.tsd-filter-input { + display: flex; + width: fit-content; + width: -moz-fit-content; + align-items: center; + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + cursor: pointer; +} +.tsd-filter-input input[type="checkbox"] { + cursor: pointer; + position: absolute; + width: 1.5em; + height: 1.5em; + opacity: 0; +} +.tsd-filter-input input[type="checkbox"]:disabled { + pointer-events: none; +} +.tsd-filter-input svg { + cursor: pointer; + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; + border-radius: 0.33em; + /* Leaving this at full opacity breaks event listeners on Firefox. + Don't remove unless you know what you're doing. */ + opacity: 0.99; +} +.tsd-filter-input input[type="checkbox"]:focus + svg { + transform: scale(0.95); +} +.tsd-filter-input input[type="checkbox"]:focus:not(:focus-visible) + svg { + transform: scale(1); +} +.tsd-checkbox-background { + fill: var(--color-accent); +} +input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { + stroke: var(--color-text); +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-background { + fill: var(--color-background); + stroke: var(--color-accent); + stroke-width: 0.25rem; +} +.tsd-filter-input input:disabled ~ svg > .tsd-checkbox-checkmark { + stroke: var(--color-accent); +} + +.tsd-theme-toggle { + padding-top: 0.75rem; +} +.tsd-theme-toggle > h4 { + display: inline; + vertical-align: middle; + margin-right: 0.75rem; +} + +.tsd-hierarchy { + list-style: square; + margin: 0; +} +.tsd-hierarchy .target { + font-weight: bold; +} + +.tsd-panel-group.tsd-index-group { + margin-bottom: 0; +} +.tsd-index-panel .tsd-index-list { + list-style: none; + line-height: 1.333em; + margin: 0; + padding: 0.25rem 0 0 0; + overflow: hidden; + display: grid; + grid-template-columns: repeat(3, 1fr); + column-gap: 1rem; + grid-template-rows: auto; +} +@media (max-width: 1024px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(2, 1fr); + } +} +@media (max-width: 768px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(1, 1fr); + } +} +.tsd-index-panel .tsd-index-list li { + -webkit-page-break-inside: avoid; + -moz-page-break-inside: avoid; + -ms-page-break-inside: avoid; + -o-page-break-inside: avoid; + page-break-inside: avoid; +} + +.tsd-flag { + display: inline-block; + padding: 0.25em 0.4em; + border-radius: 4px; + color: var(--color-comment-tag-text); + background-color: var(--color-comment-tag); + text-indent: 0; + font-size: 75%; + line-height: 1; + font-weight: normal; +} + +.tsd-anchor { + position: relative; + top: -100px; +} + +.tsd-member { + position: relative; +} +.tsd-member .tsd-anchor + h3 { + display: flex; + align-items: center; + margin-top: 0; + margin-bottom: 0; + border-bottom: none; +} + +.tsd-navigation.settings { + margin: 1rem 0; +} +.tsd-navigation a, +.tsd-page-navigation a { + display: inline-flex; + align-items: center; + padding: 0.25rem; + color: var(--color-text); + text-decoration: none; + box-sizing: border-box; +} +.tsd-navigation a { + /* why 3rem? No idea, but it seems to work. */ + width: calc(100% - 3rem); +} +.tsd-page-navigation a { + /* why is this different? */ + width: 100%; +} +.tsd-navigation a.current, +.tsd-page-navigation a.current { + background: var(--color-active-menu-item); +} +.tsd-navigation a:hover, +.tsd-page-navigation a:hover { + text-decoration: underline; +} +.tsd-navigation ul, +.tsd-page-navigation ul { + margin: 0; + padding: 0; + list-style: none; +} +.tsd-navigation li, +.tsd-page-navigation li { + padding: 0; + max-width: 100%; +} +.tsd-nested-navigation > li > a { + margin-left: 3rem; +} +.tsd-nested-navigation > li > details { + margin-left: 1.5rem; +} +.tsd-small-nested-navigation > li > a { + margin-left: 1.5rem; +} +.tsd-small-nested-navigation > li > details { + margin-left: 0; +} +.tsd-page-navigation ul { + padding-left: 1.75rem; +} + +#tsd-sidebar-links a { + margin-top: 0; + margin-bottom: 0.5rem; + line-height: 1.25rem; +} +#tsd-sidebar-links a:last-of-type { + margin-bottom: 0; +} + +a.tsd-index-link { + padding: 0.25rem 0 !important; + font-size: 1rem; + line-height: 1.25rem; + display: inline-flex; + align-items: center; + color: var(--color-text); +} +.tsd-accordion-summary, +.tsd-accordion-summary a { + user-select: none; + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + + display: flex; + align-items: center; + cursor: pointer; +} +.tsd-accordion-summary > * { + margin-top: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; +} +.tsd-accordion-summary::-webkit-details-marker { + display: none; +} +.tsd-index-accordion .tsd-accordion-summary svg { + margin-right: 0.25rem; +} +.tsd-index-content > :not(:first-child) { + margin-top: 0.75rem; +} +.tsd-index-heading { + margin-top: 1.5rem; + margin-bottom: 0.75rem; +} + +.tsd-kind-icon { + margin-right: 0.5rem; + width: 1.25rem; + height: 1.25rem; + min-width: 1.25rem; + min-height: 1.25rem; +} +.tsd-kind-icon path { + transform-origin: center; + transform: scale(1.1); +} +.tsd-signature > .tsd-kind-icon { + margin-right: 0.8rem; +} + +.tsd-panel { + margin-bottom: 2.5rem; +} +.tsd-panel.tsd-member { + margin-bottom: 4rem; +} +.tsd-panel:empty { + display: none; +} +.tsd-panel > h1, +.tsd-panel > h2, +.tsd-panel > h3 { + margin: 1.5rem -1.5rem 0.75rem -1.5rem; + padding: 0 1.5rem 0.75rem 1.5rem; +} +.tsd-panel > h1.tsd-before-signature, +.tsd-panel > h2.tsd-before-signature, +.tsd-panel > h3.tsd-before-signature { + margin-bottom: 0; + border-bottom: none; +} + +.tsd-panel-group { + margin: 4rem 0; +} +.tsd-panel-group.tsd-index-group { + margin: 2rem 0; +} +.tsd-panel-group.tsd-index-group details { + margin: 2rem 0; +} + +#tsd-search { + transition: background-color 0.2s; +} +#tsd-search .title { + position: relative; + z-index: 2; +} +#tsd-search .field { + position: absolute; + left: 0; + top: 0; + right: 2.5rem; + height: 100%; +} +#tsd-search .field input { + box-sizing: border-box; + position: relative; + top: -50px; + z-index: 1; + width: 100%; + padding: 0 10px; + opacity: 0; + outline: 0; + border: 0; + background: transparent; + color: var(--color-text); +} +#tsd-search .field label { + position: absolute; + overflow: hidden; + right: -40px; +} +#tsd-search .field input, +#tsd-search .title, +#tsd-toolbar-links a { + transition: opacity 0.2s; +} +#tsd-search .results { + position: absolute; + visibility: hidden; + top: 40px; + width: 100%; + margin: 0; + padding: 0; + list-style: none; + box-shadow: 0 0 4px rgba(0, 0, 0, 0.25); +} +#tsd-search .results li { + padding: 0 10px; + background-color: var(--color-background); +} +#tsd-search .results li:nth-child(even) { + background-color: var(--color-background-secondary); +} +#tsd-search .results li.state { + display: none; +} +#tsd-search .results li.current, +#tsd-search .results li:hover { + background-color: var(--color-accent); +} +#tsd-search .results a { + display: block; +} +#tsd-search .results a:before { + top: 10px; +} +#tsd-search .results span.parent { + color: var(--color-text-aside); + font-weight: normal; +} +#tsd-search.has-focus { + background-color: var(--color-accent); +} +#tsd-search.has-focus .field input { + top: 0; + opacity: 1; +} +#tsd-search.has-focus .title, +#tsd-search.has-focus #tsd-toolbar-links a { + z-index: 0; + opacity: 0; +} +#tsd-search.has-focus .results { + visibility: visible; +} +#tsd-search.loading .results li.state.loading { + display: block; +} +#tsd-search.failure .results li.state.failure { + display: block; +} + +#tsd-toolbar-links { + position: absolute; + top: 0; + right: 2rem; + height: 100%; + display: flex; + align-items: center; + justify-content: flex-end; +} +#tsd-toolbar-links a { + margin-left: 1.5rem; +} +#tsd-toolbar-links a:hover { + text-decoration: underline; +} + +.tsd-signature { + margin: 0 0 1rem 0; + padding: 1rem 0.5rem; + border: 1px solid var(--color-accent); + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 14px; + overflow-x: auto; +} + +.tsd-signature-symbol { + color: var(--color-text-aside); + font-weight: normal; +} + +.tsd-signature-type { + font-style: italic; + font-weight: normal; +} + +.tsd-signatures { + padding: 0; + margin: 0 0 1em 0; + list-style-type: none; +} +.tsd-signatures .tsd-signature { + margin: 0; + border-color: var(--color-accent); + border-width: 1px 0; + transition: background-color 0.1s; +} +.tsd-description .tsd-signatures .tsd-signature { + border-width: 1px; +} + +ul.tsd-parameter-list, +ul.tsd-type-parameter-list { + list-style: square; + margin: 0; + padding-left: 20px; +} +ul.tsd-parameter-list > li.tsd-parameter-signature, +ul.tsd-type-parameter-list > li.tsd-parameter-signature { + list-style: none; + margin-left: -20px; +} +ul.tsd-parameter-list h5, +ul.tsd-type-parameter-list h5 { + font-size: 16px; + margin: 1em 0 0.5em 0; +} +.tsd-sources { + margin-top: 1rem; + font-size: 0.875em; +} +.tsd-sources a { + color: var(--color-text-aside); + text-decoration: underline; +} +.tsd-sources ul { + list-style: none; + padding: 0; +} + +.tsd-page-toolbar { + position: sticky; + z-index: 1; + top: 0; + left: 0; + width: 100%; + color: var(--color-text); + background: var(--color-background-secondary); + border-bottom: 1px var(--color-accent) solid; + transition: transform 0.3s ease-in-out; +} +.tsd-page-toolbar a { + color: var(--color-text); + text-decoration: none; +} +.tsd-page-toolbar a.title { + font-weight: bold; +} +.tsd-page-toolbar a.title:hover { + text-decoration: underline; +} +.tsd-page-toolbar .tsd-toolbar-contents { + display: flex; + justify-content: space-between; + height: 2.5rem; + margin: 0 auto; +} +.tsd-page-toolbar .table-cell { + position: relative; + white-space: nowrap; + line-height: 40px; +} +.tsd-page-toolbar .table-cell:first-child { + width: 100%; +} +.tsd-page-toolbar .tsd-toolbar-icon { + box-sizing: border-box; + line-height: 0; + padding: 12px 0; +} + +.tsd-widget { + display: inline-block; + overflow: hidden; + opacity: 0.8; + height: 40px; + transition: opacity 0.1s, background-color 0.2s; + vertical-align: bottom; + cursor: pointer; +} +.tsd-widget:hover { + opacity: 0.9; +} +.tsd-widget.active { + opacity: 1; + background-color: var(--color-accent); +} +.tsd-widget.no-caption { + width: 40px; +} +.tsd-widget.no-caption:before { + margin: 0; +} + +.tsd-widget.options, +.tsd-widget.menu { + display: none; +} +input[type="checkbox"] + .tsd-widget:before { + background-position: -120px 0; +} +input[type="checkbox"]:checked + .tsd-widget:before { + background-position: -160px 0; +} + +img { + max-width: 100%; +} + +.tsd-anchor-icon { + display: inline-flex; + align-items: center; + margin-left: 0.5rem; + vertical-align: middle; + color: var(--color-text); +} + +.tsd-anchor-icon svg { + width: 1em; + height: 1em; + visibility: hidden; +} + +.tsd-anchor-link:hover > .tsd-anchor-icon svg { + visibility: visible; +} + +.deprecated { + text-decoration: line-through; +} + +.warning { + padding: 1rem; + color: var(--color-warning-text); + background: var(--color-background-warning); +} + +.tsd-kind-project { + color: var(--color-ts-project); +} +.tsd-kind-module { + color: var(--color-ts-module); +} +.tsd-kind-namespace { + color: var(--color-ts-namespace); +} +.tsd-kind-enum { + color: var(--color-ts-enum); +} +.tsd-kind-enum-member { + color: var(--color-ts-enum-member); +} +.tsd-kind-variable { + color: var(--color-ts-variable); +} +.tsd-kind-function { + color: var(--color-ts-function); +} +.tsd-kind-class { + color: var(--color-ts-class); +} +.tsd-kind-interface { + color: var(--color-ts-interface); +} +.tsd-kind-constructor { + color: var(--color-ts-constructor); +} +.tsd-kind-property { + color: var(--color-ts-property); +} +.tsd-kind-method { + color: var(--color-ts-method); +} +.tsd-kind-call-signature { + color: var(--color-ts-call-signature); +} +.tsd-kind-index-signature { + color: var(--color-ts-index-signature); +} +.tsd-kind-constructor-signature { + color: var(--color-ts-constructor-signature); +} +.tsd-kind-parameter { + color: var(--color-ts-parameter); +} +.tsd-kind-type-literal { + color: var(--color-ts-type-literal); +} +.tsd-kind-type-parameter { + color: var(--color-ts-type-parameter); +} +.tsd-kind-accessor { + color: var(--color-ts-accessor); +} +.tsd-kind-get-signature { + color: var(--color-ts-get-signature); +} +.tsd-kind-set-signature { + color: var(--color-ts-set-signature); +} +.tsd-kind-type-alias { + color: var(--color-ts-type-alias); +} + +/* if we have a kind icon, don't color the text by kind */ +.tsd-kind-icon ~ span { + color: var(--color-text); +} + +* { + scrollbar-width: thin; + scrollbar-color: var(--color-accent) var(--color-icon-background); +} + +*::-webkit-scrollbar { + width: 0.75rem; +} + +*::-webkit-scrollbar-track { + background: var(--color-icon-background); +} + +*::-webkit-scrollbar-thumb { + background-color: var(--color-accent); + border-radius: 999rem; + border: 0.25rem solid var(--color-icon-background); +} + +/* mobile */ +@media (max-width: 769px) { + .tsd-widget.options, + .tsd-widget.menu { + display: inline-block; + } + + .container-main { + display: flex; + } + html .col-content { + float: none; + max-width: 100%; + width: 100%; + } + html .col-sidebar { + position: fixed !important; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + z-index: 1024; + top: 0 !important; + bottom: 0 !important; + left: auto !important; + right: 0 !important; + padding: 1.5rem 1.5rem 0 0; + width: 75vw; + visibility: hidden; + background-color: var(--color-background); + transform: translate(100%, 0); + } + html .col-sidebar > *:last-child { + padding-bottom: 20px; + } + html .overlay { + content: ""; + display: block; + position: fixed; + z-index: 1023; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.75); + visibility: hidden; + } + + .to-has-menu .overlay { + animation: fade-in 0.4s; + } + + .to-has-menu .col-sidebar { + animation: pop-in-from-right 0.4s; + } + + .from-has-menu .overlay { + animation: fade-out 0.4s; + } + + .from-has-menu .col-sidebar { + animation: pop-out-to-right 0.4s; + } + + .has-menu body { + overflow: hidden; + } + .has-menu .overlay { + visibility: visible; + } + .has-menu .col-sidebar { + visibility: visible; + transform: translate(0, 0); + display: flex; + flex-direction: column; + gap: 1.5rem; + max-height: 100vh; + padding: 1rem 2rem; + } + .has-menu .tsd-navigation { + max-height: 100%; + } +} + +/* one sidebar */ +@media (min-width: 770px) { + .container-main { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); + grid-template-areas: "sidebar content"; + margin: 2rem auto; + } + + .col-sidebar { + grid-area: sidebar; + } + .col-content { + grid-area: content; + padding: 0 1rem; + } +} +@media (min-width: 770px) and (max-width: 1399px) { + .col-sidebar { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + padding-top: 1rem; + } + .site-menu { + margin-top: 1rem; + } +} + +/* two sidebars */ +@media (min-width: 1200px) { + .container-main { + grid-template-columns: minmax(0, 1fr) minmax(0, 2.5fr) minmax(0, 20rem); + grid-template-areas: "sidebar content toc"; + } + + .col-sidebar { + display: contents; + } + + .page-menu { + grid-area: toc; + padding-left: 1rem; + } + .site-menu { + grid-area: sidebar; + } + + .site-menu { + margin-top: 1rem 0; + } + + .page-menu, + .site-menu { + max-height: calc(100vh - 2rem - 42px); + overflow: auto; + position: sticky; + top: 42px; + } +} diff --git a/docs/classes/PubSubHandlerResponse.html b/docs/classes/PubSubHandlerResponse.html new file mode 100644 index 0000000..42315b3 --- /dev/null +++ b/docs/classes/PubSubHandlerResponse.html @@ -0,0 +1,94 @@ +PubSubHandlerResponse | pubsub-http-handler
+
+ +
+
+
+
+ +

Class PubSubHandlerResponse

+
+

Hierarchy

+
    +
  • PubSubHandlerResponse
+
+
+
+ +
+
+

Constructors

+
+
+

Properties

+
+
+

Constructors

+
+ +
+
+

Properties

+
+ +
statusCode?: number
+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/classes/PubSubHandlerResponse.md b/docs/classes/PubSubHandlerResponse.md deleted file mode 100644 index 29a01f0..0000000 --- a/docs/classes/PubSubHandlerResponse.md +++ /dev/null @@ -1,29 +0,0 @@ -[pubsub-http-handler](../README.md) / PubSubHandlerResponse - -# Class: PubSubHandlerResponse - -## Table of contents - -### Constructors - -- [constructor](PubSubHandlerResponse.md#constructor) - -### Properties - -- [statusCode](PubSubHandlerResponse.md#statuscode) - -## Constructors - -### constructor - -• **new PubSubHandlerResponse**() - -## Properties - -### statusCode - -• `Optional` **statusCode**: `number` - -#### Defined in - -[src/types.ts:50](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L50) diff --git a/docs/functions/createPubSubCloudFunctions.html b/docs/functions/createPubSubCloudFunctions.html new file mode 100644 index 0000000..2788cd7 --- /dev/null +++ b/docs/functions/createPubSubCloudFunctions.html @@ -0,0 +1,75 @@ +createPubSubCloudFunctions | pubsub-http-handler
+
+ +
+
+
+
+ +

Function createPubSubCloudFunctions

+
+
+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/functions/handlePubSubMessage.html b/docs/functions/handlePubSubMessage.html new file mode 100644 index 0000000..a62e55b --- /dev/null +++ b/docs/functions/handlePubSubMessage.html @@ -0,0 +1,75 @@ +handlePubSubMessage | pubsub-http-handler
+
+ +
+
+
+
+ +

Function handlePubSubMessage

+
+
+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/functions/makePubSubConfig.html b/docs/functions/makePubSubConfig.html new file mode 100644 index 0000000..cd04ddc --- /dev/null +++ b/docs/functions/makePubSubConfig.html @@ -0,0 +1,73 @@ +makePubSubConfig | pubsub-http-handler
+
+ +
+
+
+
+ +

Function makePubSubConfig

+
+
+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/functions/pubSubFastifyPlugin.html b/docs/functions/pubSubFastifyPlugin.html new file mode 100644 index 0000000..299994f --- /dev/null +++ b/docs/functions/pubSubFastifyPlugin.html @@ -0,0 +1,78 @@ +pubSubFastifyPlugin | pubsub-http-handler
+
+ +
+
+
+
+ +

Function pubSubFastifyPlugin

+
+
    + +
  • +

    FastifyPluginAsync

    +

    Fastify allows the user to extend its functionalities with plugins. A plugin can be a set of routes, a server decorator or whatever. To activate plugins, use the fastify.register() method.

    +
    +
    +

    Type Parameters

    +
      +
    • +

      Data

    • +
    • +

      Context

    +
    +

    Parameters

    +
      +
    • +
      instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTypeProviderDefault>
    • +
    • +
      opts: PubSubHandlerFastifyConfig<Data, Context>
    +

    Returns Promise<void>

+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..3c09ba6 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,85 @@ +pubsub-http-handler
+
+ +
+ +
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/interfaces/CreatePubSubHandlerResponse.md b/docs/interfaces/CreatePubSubHandlerResponse.md deleted file mode 100644 index 42110f6..0000000 --- a/docs/interfaces/CreatePubSubHandlerResponse.md +++ /dev/null @@ -1,38 +0,0 @@ -[pubsub-http-handler](../README.md) / CreatePubSubHandlerResponse - -# Interface: CreatePubSubHandlerResponse - -## Table of contents - -### Properties - -- [fastify](CreatePubSubHandlerResponse.md#fastify) -- [listen](CreatePubSubHandlerResponse.md#listen) - -## Properties - -### fastify - -• **fastify**: `FastifyInstance`<`RawServerDefault`, `IncomingMessage`, `ServerResponse`<`IncomingMessage`\>, `FastifyBaseLogger`, `FastifyTypeProviderDefault`\> - -#### Defined in - -[src/methods/server.ts:36](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/methods/server.ts#L36) - -___ - -### listen - -• **listen**: () => `Promise`<`void`\> - -#### Type declaration - -▸ (): `Promise`<`void`\> - -##### Returns - -`Promise`<`void`\> - -#### Defined in - -[src/methods/server.ts:35](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/methods/server.ts#L35) diff --git a/docs/interfaces/HandlePubSubMessageArgs.html b/docs/interfaces/HandlePubSubMessageArgs.html new file mode 100644 index 0000000..9ac5cd2 --- /dev/null +++ b/docs/interfaces/HandlePubSubMessageArgs.html @@ -0,0 +1,147 @@ +HandlePubSubMessageArgs | pubsub-http-handler
+
+ +
+
+
+
+ +

Interface HandlePubSubMessageArgs<Data, Context, Logger>

+
+

Type Parameters

+
    +
  • +

    Data

  • +
  • +

    Context

  • +
  • +

    Logger

+
+

Hierarchy

+
    +
  • HandlePubSubMessageArgs
+
+
+
+ +
+
+

Properties

+
+
+

Properties

+
+ +
context: Context
+
+ +
handler: PubSubHandler<Data, Context, Logger>
+
+ +
log: Logger
+
+ +
message: {
    attributes?: Record<string, string>;
    data: string;
    messageId?: string;
}
+
+

Type declaration

+
    +
  • +
    Optional attributes?: Record<string, string>
  • +
  • +
    data: string
  • +
  • +
    Optional messageId?: string
+
+ +
parseJson?: boolean
+
+ +
parser?: ((data) => Data | Promise<Data>)
+
+

Type declaration

+
    +
  • +
      +
    • (data): Data | Promise<Data>
    • +
    • +
      +

      Parameters

      +
        +
      • +
        data: unknown
      +

      Returns Data | Promise<Data>

+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/interfaces/HandlePubSubMessageArgs.md b/docs/interfaces/HandlePubSubMessageArgs.md deleted file mode 100644 index 5d7d335..0000000 --- a/docs/interfaces/HandlePubSubMessageArgs.md +++ /dev/null @@ -1,103 +0,0 @@ -[pubsub-http-handler](../README.md) / HandlePubSubMessageArgs - -# Interface: HandlePubSubMessageArgs - -## Type parameters - -| Name | -| :------ | -| `Data` | -| `Context` | - -## Table of contents - -### Properties - -- [context](HandlePubSubMessageArgs.md#context) -- [handler](HandlePubSubMessageArgs.md#handler) -- [log](HandlePubSubMessageArgs.md#log) -- [message](HandlePubSubMessageArgs.md#message) -- [parseJson](HandlePubSubMessageArgs.md#parsejson) -- [parser](HandlePubSubMessageArgs.md#parser) - -## Properties - -### context - -• **context**: `Context` - -#### Defined in - -[src/types.ts:70](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L70) - -___ - -### handler - -• **handler**: [`PubSubHandler`](../README.md#pubsubhandler)<`Data`, `Context`\> - -#### Defined in - -[src/types.ts:67](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L67) - -___ - -### log - -• `Optional` **log**: `FastifyBaseLogger` \| `Logger`<`LoggerOptions`\> - -#### Defined in - -[src/types.ts:71](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L71) - -___ - -### message - -• **message**: `Object` - -#### Type declaration - -| Name | Type | -| :------ | :------ | -| `attributes` | `undefined` \| `Record`<`string`, `string`\> | -| `data` | `string` | -| `messageId` | `undefined` \| `string` | - -#### Defined in - -[src/types.ts:66](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L66) - -___ - -### parseJson - -• `Optional` **parseJson**: `boolean` - -#### Defined in - -[src/types.ts:68](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L68) - -___ - -### parser - -• `Optional` **parser**: (`data`: `unknown`) => `Data` \| `Promise`<`Data`\> - -#### Type declaration - -▸ (`data`): `Data` \| `Promise`<`Data`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | `unknown` | - -##### Returns - -`Data` \| `Promise`<`Data`\> - -#### Defined in - -[src/types.ts:69](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L69) diff --git a/docs/interfaces/PubSubCloudFunctionsConfig.html b/docs/interfaces/PubSubCloudFunctionsConfig.html new file mode 100644 index 0000000..e2cd5a0 --- /dev/null +++ b/docs/interfaces/PubSubCloudFunctionsConfig.html @@ -0,0 +1,171 @@ +PubSubCloudFunctionsConfig | pubsub-http-handler
+
+ +
+
+
+
+ +

Interface PubSubCloudFunctionsConfig<Data, Context>

+
+

Type Parameters

+
    +
  • +

    Data

  • +
  • +

    Context

+
+

Hierarchy

+
+
+
+
+ +
+
+

Properties

+
+ +
context?: ((req?) => Context | Promise<Context>)
+
+

Type declaration

+
    +
  • +
      +
    • (req?): Context | Promise<Context>
    • +
    • +
      +

      Parameters

      +
        +
      • +
        Optional req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
      +

      Returns Context | Promise<Context>

+
+ +
logger?: LoggerOptions
+
+ +
onError?: OnErrorHandler<Context>
+

OnError Handler

+

When this is set, errors will not be +thrown.

+
+
+ +
parseJson?: boolean
+

This will run JSON.parse on request data

+

Tip: false when sending strings

+ +

Default

true
+
+
+
+ +
parser?: ((data) => Data | Promise<Data>)
+
+

Type declaration

+
    +
  • +
      +
    • (data): Data | Promise<Data>
    • +
    • +
      +

      Parameters

      +
        +
      • +
        data: unknown
      +

      Returns Data | Promise<Data>

+
+ +
path?: string
+

Use this to set a different path

+ +

Default

/
+
+
+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/interfaces/PubSubCloudFunctionsConfig.md b/docs/interfaces/PubSubCloudFunctionsConfig.md deleted file mode 100644 index d2297d3..0000000 --- a/docs/interfaces/PubSubCloudFunctionsConfig.md +++ /dev/null @@ -1,104 +0,0 @@ -[pubsub-http-handler](../README.md) / PubSubCloudFunctionsConfig - -# Interface: PubSubCloudFunctionsConfig - -## Type parameters - -| Name | -| :------ | -| `Data` | -| `Context` | - -## Hierarchy - -- `Omit`<[`PubSubConfig`](PubSubConfig.md)<`Data`, `Context`\>, ``"handler"`` \| ``"path"``\> - - ↳ **`PubSubCloudFunctionsConfig`** - -## Table of contents - -### Properties - -- [logger](PubSubCloudFunctionsConfig.md#logger) -- [onError](PubSubCloudFunctionsConfig.md#onerror) -- [parseJson](PubSubCloudFunctionsConfig.md#parsejson) -- [parser](PubSubCloudFunctionsConfig.md#parser) - -## Properties - -### logger - -• `Optional` **logger**: `LoggerOptions` - -#### Defined in - -[src/methods/cloud-functions.ts:9](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/methods/cloud-functions.ts#L9) - -___ - -### onError - -• `Optional` **onError**: [`OnErrorHandler`](../README.md#onerrorhandler)<`Context`\> - -OnError Handler - -When this is set, errors will not be -thrown. - -#### Inherited from - -Omit.onError - -#### Defined in - -[src/types.ts:16](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L16) - -___ - -### parseJson - -• `Optional` **parseJson**: `boolean` - -This will run JSON.parse on request data - -**Tip**: `false` when sending strings - -**`Default`** - -true - -#### Inherited from - -Omit.parseJson - -#### Defined in - -[src/types.ts:25](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L25) - -___ - -### parser - -• `Optional` **parser**: (`data`: `unknown`) => `Data` \| `Promise`<`Data`\> - -#### Type declaration - -▸ (`data`): `Data` \| `Promise`<`Data`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | `unknown` | - -##### Returns - -`Data` \| `Promise`<`Data`\> - -#### Inherited from - -Omit.parser - -#### Defined in - -[src/types.ts:18](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L18) diff --git a/docs/interfaces/PubSubConfig.html b/docs/interfaces/PubSubConfig.html new file mode 100644 index 0000000..6240f84 --- /dev/null +++ b/docs/interfaces/PubSubConfig.html @@ -0,0 +1,155 @@ +PubSubConfig | pubsub-http-handler
+
+ +
+
+
+
+ +

Interface PubSubConfig<Data, Context>

+
+

Type Parameters

+
    +
  • +

    Data

  • +
  • +

    Context

+
+

Hierarchy

+
+
+
+
+ +
+
+

Properties

+
+
+

Properties

+
+ +
context?: (() => Context | Promise<Context>)
+
+

Type declaration

+
    +
  • +
      +
    • (): Context | Promise<Context>
    • +
    • +

      Returns Context | Promise<Context>

+
+ +
onError?: OnErrorHandler<Context>
+

OnError Handler

+

When this is set, errors will not be +thrown.

+
+
+ +
parseJson?: boolean
+

This will run JSON.parse on request data

+

Tip: false when sending strings

+ +

Default

true
+
+
+
+ +
parser?: ((data) => Data | Promise<Data>)
+
+

Type declaration

+
    +
  • +
      +
    • (data): Data | Promise<Data>
    • +
    • +
      +

      Parameters

      +
        +
      • +
        data: unknown
      +

      Returns Data | Promise<Data>

+
+ +
path?: string
+

Use this to set a different path

+ +

Default

/
+
+
+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/interfaces/PubSubConfig.md b/docs/interfaces/PubSubConfig.md deleted file mode 100644 index 21635a8..0000000 --- a/docs/interfaces/PubSubConfig.md +++ /dev/null @@ -1,105 +0,0 @@ -[pubsub-http-handler](../README.md) / PubSubConfig - -# Interface: PubSubConfig - -## Type parameters - -| Name | -| :------ | -| `Data` | -| `Context` | - -## Table of contents - -### Properties - -- [handler](PubSubConfig.md#handler) -- [onError](PubSubConfig.md#onerror) -- [parseJson](PubSubConfig.md#parsejson) -- [parser](PubSubConfig.md#parser) -- [path](PubSubConfig.md#path) - -## Properties - -### handler - -• **handler**: [`PubSubHandler`](../README.md#pubsubhandler)<`Data`, `Context`\> - -Handler - -#### Defined in - -[src/types.ts:9](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L9) - -___ - -### onError - -• `Optional` **onError**: [`OnErrorHandler`](../README.md#onerrorhandler)<`Context`\> - -OnError Handler - -When this is set, errors will not be -thrown. - -#### Defined in - -[src/types.ts:16](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L16) - -___ - -### parseJson - -• `Optional` **parseJson**: `boolean` - -This will run JSON.parse on request data - -**Tip**: `false` when sending strings - -**`Default`** - -true - -#### Defined in - -[src/types.ts:25](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L25) - -___ - -### parser - -• `Optional` **parser**: (`data`: `unknown`) => `Data` \| `Promise`<`Data`\> - -#### Type declaration - -▸ (`data`): `Data` \| `Promise`<`Data`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | `unknown` | - -##### Returns - -`Data` \| `Promise`<`Data`\> - -#### Defined in - -[src/types.ts:18](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L18) - -___ - -### path - -• `Optional` **path**: `string` - -Use this to set a different path - -**`Default`** - -/ - -#### Defined in - -[src/types.ts:31](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L31) diff --git a/docs/interfaces/PubSubHandlerFastifyConfig.html b/docs/interfaces/PubSubHandlerFastifyConfig.html new file mode 100644 index 0000000..79b835e --- /dev/null +++ b/docs/interfaces/PubSubHandlerFastifyConfig.html @@ -0,0 +1,171 @@ +PubSubHandlerFastifyConfig | pubsub-http-handler
+
+ +
+
+
+
+ +

Interface PubSubHandlerFastifyConfig<Data, Context>

+
+

Type Parameters

+
    +
  • +

    Data

  • +
  • +

    Context

+
+

Hierarchy

+
+
+
+
+ +
+
+

Properties

+
+ +
context?: ((req?) => Context | Promise<Context>)
+
+

Type declaration

+
    +
  • +
      +
    • (req?): Context | Promise<Context>
    • +
    • +
      +

      Parameters

      +
        +
      • +
        Optional req: FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage, FastifySchema, FastifyTypeProviderDefault, unknown, FastifyBaseLogger, ResolveFastifyRequestType<FastifyTypeProviderDefault, FastifySchema, RouteGenericInterface>>
      +

      Returns Context | Promise<Context>

+
+ +
handler: PubSubHandler<Data, Context, FastifyBaseLogger>
+
+ +
onError?: OnErrorHandler<Context>
+

OnError Handler

+

When this is set, errors will not be +thrown.

+
+
+ +
parseJson?: boolean
+

This will run JSON.parse on request data

+

Tip: false when sending strings

+ +

Default

true
+
+
+
+ +
parser?: ((data) => Data | Promise<Data>)
+
+

Type declaration

+
    +
  • +
      +
    • (data): Data | Promise<Data>
    • +
    • +
      +

      Parameters

      +
        +
      • +
        data: unknown
      +

      Returns Data | Promise<Data>

+
+ +
path?: string
+

Use this to set a different path

+ +

Default

/
+
+
+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/interfaces/PubSubServerConfig.md b/docs/interfaces/PubSubServerConfig.md deleted file mode 100644 index 29e1841..0000000 --- a/docs/interfaces/PubSubServerConfig.md +++ /dev/null @@ -1,178 +0,0 @@ -[pubsub-http-handler](../README.md) / PubSubServerConfig - -# Interface: PubSubServerConfig - -## Type parameters - -| Name | -| :------ | -| `Data` | -| `Context` | - -## Hierarchy - -- `Omit`<[`PubSubConfig`](PubSubConfig.md)<`Data`, `Context`\>, ``"handler"``\> - - ↳ **`PubSubServerConfig`** - -## Table of contents - -### Properties - -- [address](PubSubServerConfig.md#address) -- [fastifyConfig](PubSubServerConfig.md#fastifyconfig) -- [host](PubSubServerConfig.md#host) -- [onError](PubSubServerConfig.md#onerror) -- [parseJson](PubSubServerConfig.md#parsejson) -- [parser](PubSubServerConfig.md#parser) -- [path](PubSubServerConfig.md#path) -- [port](PubSubServerConfig.md#port) - -## Properties - -### address - -• `Optional` **address**: `string` - -**`Default`** - -0.0.0.0 - -**`Deprecated`** - -`address` will be removed in next major release. Please use `host` instead. - -#### Defined in - -[src/methods/server.ts:26](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/methods/server.ts#L26) - -___ - -### fastifyConfig - -• `Optional` **fastifyConfig**: `FastifyServerOptions`<`RawServerDefault`, `FastifyBaseLogger`\> - -Read more here: https://www.fastify.io/docs/latest/Server/ - -#### Defined in - -[src/methods/server.ts:31](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/methods/server.ts#L31) - -___ - -### host - -• `Optional` **host**: `string` - -**`Default`** - -0.0.0.0 - -#### Defined in - -[src/methods/server.ts:20](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/methods/server.ts#L20) - -___ - -### onError - -• `Optional` **onError**: [`OnErrorHandler`](../README.md#onerrorhandler)<`Context`\> - -OnError Handler - -When this is set, errors will not be -thrown. - -#### Inherited from - -Omit.onError - -#### Defined in - -[src/types.ts:16](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L16) - -___ - -### parseJson - -• `Optional` **parseJson**: `boolean` - -This will run JSON.parse on request data - -**Tip**: `false` when sending strings - -**`Default`** - -true - -#### Inherited from - -Omit.parseJson - -#### Defined in - -[src/types.ts:25](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L25) - -___ - -### parser - -• `Optional` **parser**: (`data`: `unknown`) => `Data` \| `Promise`<`Data`\> - -#### Type declaration - -▸ (`data`): `Data` \| `Promise`<`Data`\> - -##### Parameters - -| Name | Type | -| :------ | :------ | -| `data` | `unknown` | - -##### Returns - -`Data` \| `Promise`<`Data`\> - -#### Inherited from - -Omit.parser - -#### Defined in - -[src/types.ts:18](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L18) - -___ - -### path - -• `Optional` **path**: `string` - -Use this to set a different path - -**`Default`** - -/ - -#### Inherited from - -Omit.path - -#### Defined in - -[src/types.ts:31](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/types.ts#L31) - -___ - -### port - -• `Optional` **port**: `number` - -Will automatically pick up PORT environment variable. - -**`Default`** - -8000 - -#### Defined in - -[src/methods/server.ts:15](https://github.com/simenandre/pubsub-http-handler/blob/a2ca195/src/methods/server.ts#L15) diff --git a/docs/types/CloudFunctionFun.html b/docs/types/CloudFunctionFun.html new file mode 100644 index 0000000..d06f21f --- /dev/null +++ b/docs/types/CloudFunctionFun.html @@ -0,0 +1,72 @@ +CloudFunctionFun | pubsub-http-handler
+
+ +
+
+
+
+ +

Type alias CloudFunctionFun

+
CloudFunctionFun: ((req, res) => Promise<void>)
+
+

Type declaration

+
    +
  • +
      +
    • (req, res): Promise<void>
    • +
    • +
      +

      Parameters

      +
        +
      • +
        req: express.Request
      • +
      • +
        res: express.Response
      +

      Returns Promise<void>

+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/types/OnErrorHandler.html b/docs/types/OnErrorHandler.html new file mode 100644 index 0000000..be55a9d --- /dev/null +++ b/docs/types/OnErrorHandler.html @@ -0,0 +1,77 @@ +OnErrorHandler | pubsub-http-handler
+
+ +
+
+
+
+ +

Type alias OnErrorHandler<Context>

+
OnErrorHandler<Context>: ((error, context) => void | Promise<void>)
+
+

Type Parameters

+
    +
  • +

    Context

+
+

Type declaration

+
    +
  • +
      +
    • (error, context): void | Promise<void>
    • +
    • +
      +

      Parameters

      +
        +
      • +
        error: unknown
      • +
      • +
        context: Context
      +

      Returns void | Promise<void>

+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/types/PubSubHandler.html b/docs/types/PubSubHandler.html new file mode 100644 index 0000000..9092f0b --- /dev/null +++ b/docs/types/PubSubHandler.html @@ -0,0 +1,88 @@ +PubSubHandler | pubsub-http-handler
+
+ +
+
+
+
+ +

Type alias PubSubHandler<Data, Context, Logger>

+
PubSubHandler<Data, Context, Logger>: ((args) => Promise<PubSubHandlerResponse | void> | PubSubHandlerResponse | void)
+
+

Type Parameters

+
    +
  • +

    Data

  • +
  • +

    Context

  • +
  • +

    Logger

+
+

Type declaration

+
+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/types/PubSubMessage.html b/docs/types/PubSubMessage.html new file mode 100644 index 0000000..6f8ce07 --- /dev/null +++ b/docs/types/PubSubMessage.html @@ -0,0 +1,57 @@ +PubSubMessage | pubsub-http-handler
+
+ +
+ +
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/types/PubSubRequest.html b/docs/types/PubSubRequest.html new file mode 100644 index 0000000..6275d28 --- /dev/null +++ b/docs/types/PubSubRequest.html @@ -0,0 +1,57 @@ +PubSubRequest | pubsub-http-handler
+
+ +
+ +
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/variables/pubSubMessageSchema.html b/docs/variables/pubSubMessageSchema.html new file mode 100644 index 0000000..520ff3c --- /dev/null +++ b/docs/variables/pubSubMessageSchema.html @@ -0,0 +1,61 @@ +pubSubMessageSchema | pubsub-http-handler
+
+ +
+
+
+
+ +

Variable pubSubMessageSchemaConst

+
pubSubMessageSchema: TObject<{
    attributes: TOptional<TRecord<TString, TString>>;
    data: TString;
    messageId: TOptional<TString>;
}> = ...
+

PubSub Message Type

+

This describes the message object that is sent to the handler +from Google PubSub.

+
+
+
+

Generated using TypeDoc

+
\ No newline at end of file diff --git a/docs/variables/pubSubRequestSchema.html b/docs/variables/pubSubRequestSchema.html new file mode 100644 index 0000000..6b1f237 --- /dev/null +++ b/docs/variables/pubSubRequestSchema.html @@ -0,0 +1,61 @@ +pubSubRequestSchema | pubsub-http-handler
+
+ +
+
+
+
+ +

Variable pubSubRequestSchemaConst

+
pubSubRequestSchema: TObject<{
    message: TObject<{
        attributes: TOptional<TRecord<TString, TString>>;
        data: TString;
        messageId: TOptional<TString>;
    }>;
    subscription: TString;
}> = ...
+

PubSub Request Type

+

This describes the request object that is sent to the handler +from Google PubSub.

+
+
+
+

Generated using TypeDoc

+
\ No newline at end of file