open-index/open-npm huggingface dataset:
npm package: @sparkrewards/sra-sdk
Description: @sparkrewards/sra-sdk server
Latest version: 0.0.10

## @sparkrewards/app-api-server-sdk

TypeScript server-side SDK for the Spark Rewards App API, generated from the Smithy service model.
It contains:

- Strongly typed request/response models for all operations.
- Operation handlers and service interfaces to implement the API.
- A generated OpenAPI JSON export (`OpenApiJSON`) that can be used with tooling like CDK.

### Installation

```bash
npm install @sparkrewards/app-api-server-sdk
# or
yarn add @sparkrewards/app-api-server-sdk
```

### Basic usage

```ts
import {
  AppAPIService,
  getAppAPIServiceHandler,
} from "@sparkrewards/app-api-server-sdk";

const service: AppAPIService<unknown> = {
  async GetUser(input, ctx) {
    // implement your business logic here
    return {
      message: "ok",
      user: {
        // ... user fields ...
      },
    };
  },
  // implement other operations...
};

export const handler = getAppAPIServiceHandler(service);
```

### OpenAPI export

The server SDK also exports the OpenAPI specification for the App API:

```ts
import { OpenApiJSON } from "@sparkrewards/app-api-server-sdk";

console.log(OpenApiJSON.openapi); // "3.1.0"
```

This is used by the CDK stack to configure API Gateway.

### Regenerating from the Smithy model

This package is generated by the `typescript-ssdk-codegen` Smithy plugin. To regenerate it:

```bash
./gradlew :smithy:smithyBuild
```

The generated package lives under:

- `smithy/build/smithyprojections/smithy/source/typescript-ssdk-codegen`
npm package: @sparkrewards/srw-sdk
Description: @sparkrewards/srw-sdk server
Latest version: 0.1.3

## @sparkrewards/srw-sdk

TypeScript server-side SDK for the Spark Rewards Website (SRW) API, generated from the Smithy service model.
It contains:

- Strongly typed request/response models for all operations.
- Operation handlers and service interfaces to implement the API.
- A generated OpenAPI JSON export (`OpenApiJSON`) that can be used with tooling like CDK.

### Installation

```bash
npm install @sparkrewards/srw-sdk
# or
yarn add @sparkrewards/srw-sdk
```

### Basic usage

```ts
import {
  BusinessAPIService,
  getBusinessAPIServiceHandler,
} from "@sparkrewards/srw-sdk";

const service: BusinessAPIService<unknown> = {
  async GetUser(input, ctx) {
    // implement your business logic here
    return {
      message: "ok",
      user: {
        // ... user fields ...
      },
    };
  },
  // implement other operations...
};

export const handler = getBusinessAPIServiceHandler(service);
```

### OpenAPI export

The server SDK also exports the OpenAPI specification for the Spark Rewards Website (SRW) API:

```ts
import { OpenApiJSON } from "@sparkrewards/srw-sdk";

console.log(OpenApiJSON.openapi); // "3.1.0"
```

This is used by the CDK stack to configure API Gateway.

### Regenerating from the Smithy model

This package is generated by the `typescript-ssdk-codegen` Smithy plugin. To regenerate it:

```bash
./gradlew :smithy:smithyBuild
```

The generated package lives under:

- `smithy/build/smithyprojections/smithy/source/typescript-ssdk-codegen`