{"id":24510664,"url":"https://github.com/rhdeck/session-manager","last_synced_at":"2025-03-15T09:41:22.630Z","repository":{"id":42746632,"uuid":"280934299","full_name":"rhdeck/session-manager","owner":"rhdeck","description":"Manager for getting object instances in Lambda contexts","archived":false,"fork":false,"pushed_at":"2022-12-11T14:57:27.000Z","size":1497,"stargazers_count":0,"open_issues_count":16,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-22T22:21:44.689Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhdeck.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-19T19:19:09.000Z","updated_at":"2020-07-26T23:10:58.000Z","dependencies_parsed_at":"2023-01-27T01:25:13.577Z","dependency_job_id":null,"html_url":"https://github.com/rhdeck/session-manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhdeck%2Fsession-manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhdeck%2Fsession-manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhdeck%2Fsession-manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhdeck%2Fsession-manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhdeck","download_url":"https://codeload.github.com/rhdeck/session-manager/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243713391,"owners_count":20335566,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-22T00:30:06.571Z","updated_at":"2025-03-15T09:41:22.607Z","avatar_url":"https://github.com/rhdeck.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\u003ca name=\"readmemd\"\u003e\u003c/a\u003e\n\n[@raydeck/session-manager - v1.4.0](#readmemd)\n\n# @raydeck/session-manager - v1.4.0\n\n## Index\n\n### Interfaces\n\n* [Schemable](#interfacesschemablemd)\n* [Sessionable](#interfacessessionablemd)\n\n### Type aliases\n\n* [LambdaFunctionType](#lambdafunctiontype)\n\n### Variables\n\n* [registry](#let-registry)\n* [schemeRegistry](#const-schemeregistry)\n\n### Functions\n\n* [addClass](#addclass)\n* [flushSession](#flushsession)\n* [getFromId](#getfromid)\n* [getFromItem](#getfromitem)\n* [getFromUri](#getfromuri)\n* [isCached](#iscached)\n* [remove](#remove)\n* [set](#set)\n* [withBatch](#withbatch)\n* [withSession](#const-withsession)\n\n## Type aliases\n\n###  LambdaFunctionType\n\nƬ **LambdaFunctionType**: *function*\n\n*Defined in [index.ts:87](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L87)*\n\n#### Type declaration:\n\n▸ (`a`: any, `b?`: any, `c?`: any): *any*\n\n**Parameters:**\n\nName | Type |\n------ | ------ |\n`a` | any |\n`b?` | any |\n`c?` | any |\n\n## Variables\n\n### `Let` registry\n\n• **registry**: *object*\n\n*Defined in [index.ts:19](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L19)*\n\n#### Type declaration:\n\n* \\[ **url**: *string*\\]: [Sessionable](#interfacessessionablemd)\n\n___\n\n### `Const` schemeRegistry\n\n• **schemeRegistry**: *object*\n\n*Defined in [index.ts:18](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L18)*\n\n#### Type declaration:\n\n* \\[ **scheme**: *string*\\]: [Schemable](#interfacesschemablemd)\n\n## Functions\n\n###  addClass\n\n▸ **addClass**(`newClass`: [Schemable](#interfacesschemablemd)): *Promise‹void›*\n\n*Defined in [index.ts:46](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L46)*\n\nAdd a scheme-able class to the session registry\n\n**Parameters:**\n\nName | Type | Description |\n------ | ------ | ------ |\n`newClass` | [Schemable](#interfacesschemablemd) | Class -implementing static scheme property and getFromUri method - to add to the registry for lookups  |\n\n**Returns:** *Promise‹void›*\n\n___\n\n###  flushSession\n\n▸ **flushSession**(): *void*\n\n*Defined in [index.ts:84](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L84)*\n\nFlush the session of cached files\n\n**Returns:** *void*\n\n___\n\n###  getFromId\n\n▸ **getFromId**‹**T**›(`schemeOrClass`: string | [Schemable](#interfacesschemablemd), `id`: string): *Promise‹T›*\n\n*Defined in [index.ts:54](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L54)*\n\nRetrieve from the registry, async to permit a load. Uses the class/scheme to limit the lookup\n\n**Type parameters:**\n\n▪ **T**\n\n**Parameters:**\n\nName | Type | Description |\n------ | ------ | ------ |\n`schemeOrClass` | string \u0026#124; [Schemable](#interfacesschemablemd) | Scheme (e.g. \"myClass\") or classname (\"MyClass\") to look up |\n`id` | string | id global within the class domain  |\n\n**Returns:** *Promise‹T›*\n\n___\n\n###  getFromItem\n\n▸ **getFromItem**‹**T**›(`schemeOrClass`: string | [Schemable](#interfacesschemablemd), `item`: object): *Promise‹T›*\n\n*Defined in [index.ts:25](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L25)*\n\nLoad an item based on map of data (usually from database)\n\n**Type parameters:**\n\n▪ **T**\n\n**Parameters:**\n\nName | Type | Description |\n------ | ------ | ------ |\n`schemeOrClass` | string \u0026#124; [Schemable](#interfacesschemablemd) | Scheme (e.g. \"myClass\") or classname (\"MyClass\") to look up |\n`item` | object | Map of attributes to load from  |\n\n**Returns:** *Promise‹T›*\n\n___\n\n###  getFromUri\n\n▸ **getFromUri**‹**T**›(`uri`: string): *Promise‹T›*\n\n*Defined in [index.ts:72](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L72)*\n\nRetrieve from the registry, async to permit a load if it was not previously saved\n\n**Type parameters:**\n\n▪ **T**\n\n**Parameters:**\n\nName | Type | Description |\n------ | ------ | ------ |\n`uri` | string | URI of object to retrieve  |\n\n**Returns:** *Promise‹T›*\n\n___\n\n###  isCached\n\n▸ **isCached**(`uri`: string): *boolean*\n\n*Defined in [index.ts:149](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L149)*\n\nDetermine if an object with this uri is already cached\n\n**Parameters:**\n\nName | Type | Description |\n------ | ------ | ------ |\n`uri` | string |   |\n\n**Returns:** *boolean*\n\n___\n\n###  remove\n\n▸ **remove**(`uri`: string): *void*\n\n*Defined in [index.ts:142](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L142)*\n\nRemoves an instance from the reistry by the uri\n\n**Parameters:**\n\nName | Type | Description |\n------ | ------ | ------ |\n`uri` | string | URI of the element to remove  |\n\n**Returns:** *void*\n\n___\n\n###  set\n\n▸ **set**(`o`: [Sessionable](#interfacessessionablemd)): *void*\n\n*Defined in [index.ts:134](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L134)*\n\nSave an object instance to the session registry\n\n**Parameters:**\n\nName | Type | Description |\n------ | ------ | ------ |\n`o` | [Sessionable](#interfacessessionablemd) | instance to save in registry  |\n\n**Returns:** *void*\n\n___\n\n###  withBatch\n\n▸ **withBatch**(`f`: [LambdaFunctionType](#lambdafunctiontype)): *(Anonymous function)*\n\n*Defined in [index.ts:104](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L104)*\n\nWraps a function to be used in a AWS Appsync Batch invocation\n\n**Parameters:**\n\nName | Type | Description |\n------ | ------ | ------ |\n`f` | [LambdaFunctionType](#lambdafunctiontype) | function to wrap  |\n\n**Returns:** *(Anonymous function)*\n\n___\n\n### `Const` withSession\n\n▸ **withSession**(`f`: [LambdaFunctionType](#lambdafunctiontype)): *(Anonymous function)*\n\n*Defined in [index.ts:92](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L92)*\n\nWraps a function to guarantee a new session before it runs\n\n**Parameters:**\n\nName | Type | Description |\n------ | ------ | ------ |\n`f` | [LambdaFunctionType](#lambdafunctiontype) | function to wrap  |\n\n**Returns:** *(Anonymous function)*\n\n\n\u003ca name=\"interfacesschemablemd\"\u003e\u003c/a\u003e\n\n[@raydeck/session-manager - v1.4.0](#readmemd) › [Schemable](#interfacesschemablemd)\n\n# Interface: Schemable\n\nInterface for *static* elements on a class\n\n## Hierarchy\n\n* **Schemable**\n\n## Index\n\n### Properties\n\n* [getFromItem](#optional-getfromitem)\n* [idToUri](#optional-idtouri)\n* [scheme](#scheme)\n\n### Methods\n\n* [get](#get)\n* [getFromUri](#getfromuri)\n\n## Properties\n\n### `Optional` getFromItem\n\n• **getFromItem**? : *undefined | function*\n\n*Defined in [index.ts:10](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L10)*\n\n___\n\n### `Optional` idToUri\n\n• **idToUri**? : *undefined | function*\n\n*Defined in [index.ts:8](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L8)*\n\n___\n\n###  scheme\n\n• **scheme**: *string*\n\n*Defined in [index.ts:6](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L6)*\n\n## Methods\n\n###  get\n\n▸ **get**(`id`: string): *Promise‹[Sessionable](#interfacessessionablemd)›*\n\n*Defined in [index.ts:9](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L9)*\n\n**Parameters:**\n\nName | Type |\n------ | ------ |\n`id` | string |\n\n**Returns:** *Promise‹[Sessionable](#interfacessessionablemd)›*\n\n___\n\n###  getFromUri\n\n▸ **getFromUri**(`uri`: string): *Promise‹[Sessionable](#interfacessessionablemd)›*\n\n*Defined in [index.ts:7](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L7)*\n\n**Parameters:**\n\nName | Type |\n------ | ------ |\n`uri` | string |\n\n**Returns:** *Promise‹[Sessionable](#interfacessessionablemd)›*\n\n\n\u003ca name=\"interfacessessionablemd\"\u003e\u003c/a\u003e\n\n[@raydeck/session-manager - v1.4.0](#readmemd) › [Sessionable](#interfacessessionablemd)\n\n# Interface: Sessionable\n\nInterface for *instance* elements on a class. (Much simpler requirement)\n\n## Hierarchy\n\n* **Sessionable**\n\n## Index\n\n### Methods\n\n* [getUri](#geturi)\n\n## Methods\n\n###  getUri\n\n▸ **getUri**(): *string*\n\n*Defined in [index.ts:16](https://github.com/rhdeck/session-manager/blob/ba41d20/src/index.ts#L16)*\n\n**Returns:** *string*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhdeck%2Fsession-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhdeck%2Fsession-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhdeck%2Fsession-manager/lists"}