fix(documentation): Updated package description and keywords
This commit is contained in:
parent
27af4bc41f
commit
50a6b99b9b
@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## 2024-12-27 - 1.2.1 - fix(documentation)
|
||||
Updated package description and keywords
|
||||
|
||||
- Standardized and expanded the package description for better clarity.
|
||||
- Added relevant keywords to enhance discoverability.
|
||||
|
||||
## 2024-12-27 - 1.2.0 - feat(ci)
|
||||
Add GitHub Actions workflows for CI/CD
|
||||
|
||||
|
@ -8,7 +8,21 @@
|
||||
"npmPackagename": "@social.io_private/interfaces",
|
||||
"license": "UNLICENSED",
|
||||
"projectDomain": "social.io",
|
||||
"description": "the interfaces for social.io"
|
||||
"description": "A TypeScript-based package providing standardized interfaces for data exchange and operations within the social.io application ecosystem.",
|
||||
"keywords": [
|
||||
"TypeScript",
|
||||
"interfaces",
|
||||
"social media",
|
||||
"data exchange",
|
||||
"session management",
|
||||
"profile management",
|
||||
"conversations",
|
||||
"node.js",
|
||||
"typed requests",
|
||||
"standardization",
|
||||
"module",
|
||||
"npm package"
|
||||
]
|
||||
}
|
||||
},
|
||||
"npmci": {
|
||||
|
20
package.json
20
package.json
@ -2,7 +2,7 @@
|
||||
"name": "@social.io/interfaces",
|
||||
"version": "1.2.0",
|
||||
"private": false,
|
||||
"description": "an interface package for social.io",
|
||||
"description": "A TypeScript-based package providing standardized interfaces for data exchange and operations within the social.io application ecosystem.",
|
||||
"main": "dist_ts/index.js",
|
||||
"typings": "dist_ts/index.d.ts",
|
||||
"type": "module",
|
||||
@ -46,5 +46,19 @@
|
||||
"bugs": {
|
||||
"url": "https://gitlab.com/social.io/private/interfaces/issues"
|
||||
},
|
||||
"homepage": "https://gitlab.com/social.io/private/interfaces#readme"
|
||||
}
|
||||
"homepage": "https://gitlab.com/social.io/private/interfaces#readme",
|
||||
"keywords": [
|
||||
"TypeScript",
|
||||
"interfaces",
|
||||
"social media",
|
||||
"data exchange",
|
||||
"session management",
|
||||
"profile management",
|
||||
"conversations",
|
||||
"node.js",
|
||||
"typed requests",
|
||||
"standardization",
|
||||
"module",
|
||||
"npm package"
|
||||
]
|
||||
}
|
178
readme.md
178
readme.md
@ -1,36 +1,162 @@
|
||||
# @social.io/private/interfaces
|
||||
# @social.io/interfaces
|
||||
|
||||
an interface package for social.io
|
||||
An interface package for social.io.
|
||||
|
||||
## Availabililty and Links
|
||||
## Install
|
||||
|
||||
- [npmjs.org (npm package)](https://www.npmjs.com/package/@social.io_private/interfaces)
|
||||
- [gitlab.com (source)](https://gitlab.com/social.io/private/interfaces)
|
||||
- [github.com (source mirror)](https://github.com/social.io/private/interfaces)
|
||||
- [docs (typedoc)](https://social.io/private.gitlab.io/interfaces/)
|
||||
To install the `@social.io/interfaces` package, you can use npm. Make sure you have Node.js installed, then run the following command in your terminal:
|
||||
|
||||
## Status for master
|
||||
```bash
|
||||
npm install @social.io/interfaces
|
||||
```
|
||||
|
||||
| Status Category | Status Badge |
|
||||
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| GitLab Pipelines | [![pipeline status](https://gitlab.com/social.io/private/interfaces/badges/master/pipeline.svg)](https://lossless.cloud) |
|
||||
| GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/social.io/private/interfaces/badges/master/coverage.svg)](https://lossless.cloud) |
|
||||
| npm | [![npm downloads per month](https://badgen.net/npm/dy/@social.io_private/interfaces)](https://lossless.cloud) |
|
||||
| Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/social.io/private/interfaces)](https://lossless.cloud) |
|
||||
| TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud) |
|
||||
| node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) |
|
||||
| Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud) |
|
||||
| PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@social.io_private/interfaces)](https://lossless.cloud) |
|
||||
| PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@social.io_private/interfaces)](https://lossless.cloud) |
|
||||
| BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@social.io_private/interfaces)](https://lossless.cloud) |
|
||||
| Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud) |
|
||||
This will fetch the latest package from the npm registry and add it to your project's dependencies.
|
||||
|
||||
## Usage
|
||||
|
||||
Use TypeScript for best in class intellisense
|
||||
For further information read the linked docs at the top of this readme.
|
||||
The `@social.io/interfaces` package provides a set of interfaces to be used with the social.io application, designed to standardize the communication and data exchange within the application. To effectively use this package, it's recommended to employ TypeScript, which provides advanced features like intellisense and type safety, promoting a better development experience.
|
||||
|
||||
> UNLICENSED licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||
> | By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
|
||||
### Setting Up Your Project
|
||||
|
||||
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)
|
||||
Firstly, ensure that you set up your project to work with ES Modules and optionally TypeScript. If you are working with JavaScript, ensure your `package.json` file contains the line `"type": "module"`. For TypeScript, you might want to add configuration in `tsconfig.json` as follows:
|
||||
|
||||
```json
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "ESNext",
|
||||
"target": "ESNext",
|
||||
"moduleResolution": "Node",
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Importing Interfaces
|
||||
|
||||
The package exports various interfaces for managing social.io data and operations. You can import them using:
|
||||
|
||||
```typescript
|
||||
import {
|
||||
ISioConversation,
|
||||
ISioSession,
|
||||
IRequest_GetSocialSession,
|
||||
IRequest_AttachProfileId,
|
||||
IRequest_GetConversations
|
||||
} from '@social.io/interfaces';
|
||||
```
|
||||
|
||||
### Managing Sessions
|
||||
|
||||
The package provides an interface `IRequest_GetSocialSession` which models a request to get a social session. This can be useful when you need to manage user sessions:
|
||||
|
||||
```typescript
|
||||
const getSessionRequest: IRequest_GetSocialSession = {
|
||||
method: 'getSocialSession',
|
||||
request: {
|
||||
existingSessionId: 'currentSessionId123'
|
||||
},
|
||||
response: {
|
||||
newSessionId: 'newSessionId456'
|
||||
}
|
||||
};
|
||||
|
||||
// Utilize getSessionRequest in your session management logic
|
||||
```
|
||||
|
||||
This follows a pattern of detailing a request/response structure, allowing you to handle sessions more seamlessly.
|
||||
|
||||
### Attaching Profile IDs
|
||||
|
||||
The interaction with user profiles is essential in most social applications. Use `IRequest_AttachProfileId` to attach a profile to a session:
|
||||
|
||||
```typescript
|
||||
const attachProfileRequest: IRequest_AttachProfileId = {
|
||||
method: 'attachProfileId',
|
||||
request: {
|
||||
sessionId: 'newSessionId456',
|
||||
profileId: 'userProfileId789'
|
||||
},
|
||||
response: {
|
||||
newSessionId: 'updatedSessionId012'
|
||||
}
|
||||
};
|
||||
|
||||
// Implement logic to leverage attachProfileRequest for profile operations
|
||||
```
|
||||
|
||||
These types ensure strict adherence to your backend contract, reducing runtime errors and improving code quality.
|
||||
|
||||
### Handling Conversations
|
||||
|
||||
Conversations are a critical part of any social platform. The package defines various interfaces to accommodate complex conversation structures:
|
||||
|
||||
```typescript
|
||||
const conversation: ISioConversation = {
|
||||
subject: 'Chat about TypeScript best practices',
|
||||
parties: [
|
||||
{ id: 'user1', name: 'Alice', description: 'TypeScript enthusiast' },
|
||||
{ id: 'user2', name: 'Bob', description: 'Node.js guru' }
|
||||
],
|
||||
conversationBlocks: [
|
||||
{ partyId: 'user1', text: 'I love using TypeScript with Node.js!' },
|
||||
{ partyId: 'user2', text: 'Same here! It makes development so much safer and robust.' }
|
||||
]
|
||||
};
|
||||
|
||||
// These conversations can be leveraged in your business logic to create engaging user experiences
|
||||
```
|
||||
|
||||
This interface allows for a detailed conversational structure including multiple participants and conversation blocks.
|
||||
|
||||
### Extending Sessions and Conversations
|
||||
|
||||
For further extensions, the `ISioSession` interface is key, providing session-level information like tenant IDs, activity status, and user profiles:
|
||||
|
||||
```typescript
|
||||
const session: ISioSession = {
|
||||
tenantId: 'socialTenant123',
|
||||
active: true,
|
||||
abandoned: false,
|
||||
markedForDeletion: false,
|
||||
profileInfo: {
|
||||
profileId: 'profileId1234',
|
||||
name: 'Alice Johnson',
|
||||
email: 'alice@example.com',
|
||||
mobilePhone: '+1234567890'
|
||||
},
|
||||
conversations: [conversation]
|
||||
};
|
||||
|
||||
// Handle session operations and data management through this detailed session structure
|
||||
```
|
||||
|
||||
This level of detail in interfaces encourages robust software design by promoting thorough type usage and better communication through shared types.
|
||||
|
||||
### Requests Pattern
|
||||
|
||||
The package uses a consistent pattern by inheriting from a base typed request interface, promoting consistency and reusability:
|
||||
|
||||
```typescript
|
||||
import * as plugins from '@social.io/interfaces';
|
||||
|
||||
export interface IRequest_GetArrayExample
|
||||
extends plugins.typedrequestInterfaces.implementsTR<
|
||||
plugins.typedrequestInterfaces.ITypedRequest,
|
||||
IRequest_GetArrayExample
|
||||
> {
|
||||
method: 'getArrayExample';
|
||||
request: {
|
||||
itemCount: number;
|
||||
};
|
||||
response: {
|
||||
items: Array<string>;
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
Such patterns simplify request and response management due to their predictability and standardization across different modules.
|
||||
|
||||
By following these patterns, you can build scalable, maintainable, and highly reliable applications centered around the social.io interfaces. Always remember to check the comprehensive module documentation and integrate the above interfaces into your TypeScript-first, node-based projects.
|
||||
undefined
|
@ -3,6 +3,6 @@
|
||||
*/
|
||||
export const commitinfo = {
|
||||
name: '@social.io/interfaces',
|
||||
version: '1.2.0',
|
||||
description: 'an interface package for social.io'
|
||||
version: '1.2.1',
|
||||
description: 'A TypeScript-based package providing standardized interfaces for data exchange and operations within the social.io application ecosystem.'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user