Skip to content

Commit

Permalink
Merge pull request #7 from neo773/release-please--branches--main--cha…
Browse files Browse the repository at this point in the history
…nges--next--components--test-sc-openapi

release: 0.1.0-alpha.1
  • Loading branch information
neo773 authored Jan 8, 2025
2 parents 0a2ea5b + 5b3b852 commit c399aeb
Show file tree
Hide file tree
Showing 31 changed files with 144 additions and 136 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
run: |
bash ./bin/publish-npm
env:
NPM_TOKEN: ${{ secrets.NEP773_NPM_TOKEN || secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NEO773_NPM_TOKEN || secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
run: |
bash ./bin/check-release-environment
env:
NPM_TOKEN: ${{ secrets.NEP773_NPM_TOKEN || secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NEO773_NPM_TOKEN || secrets.NPM_TOKEN }}

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.1-alpha.1"
".": "0.1.0-alpha.1"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 23
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/none-neo773%2Fnep773-d1c7b421ebbc36e6da2729a265224ade9ed7fe420dfd9ecb1aa37cbfafc05048.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/none-neo773%2Fnep773-09ca6847badea0bcd807a20acc1186d3db1c2e831e7892bee8ad0ad64b6bce91.yml
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.1.0-alpha.1 (2025-01-08)

Full Changelog: [v0.0.1-alpha.1...v0.1.0-alpha.1](https://github.com/neo773/screenpipe/compare/v0.0.1-alpha.1...v0.1.0-alpha.1)

### Features

* **api:** update via SDK Studio ([#6](https://github.com/neo773/screenpipe/issues/6)) ([876dd2a](https://github.com/neo773/screenpipe/commit/876dd2a1737a487727374a83bc77a8237f90387a))

## 0.0.1-alpha.1 (2025-01-08)

Full Changelog: [v0.0.1-alpha.0...v0.0.1-alpha.1](https://github.com/neo773/screenpipe/compare/v0.0.1-alpha.0...v0.0.1-alpha.1)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2025 Nep773
Copyright 2025 Neo773

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Nep773 Node API Library
# Neo773 Node API Library

[![NPM version](https://img.shields.io/npm/v/test-sc-openapi.svg)](https://npmjs.org/package/test-sc-openapi) ![npm bundle size](https://img.shields.io/bundlephobia/minzip/test-sc-openapi)

This library provides convenient access to the Nep773 REST API from server-side TypeScript or JavaScript.
This library provides convenient access to the Neo773 REST API from server-side TypeScript or JavaScript.

The REST API documentation can be found on [docs.nep773.com](https://docs.nep773.com). The full API of this library can be found in [api.md](api.md).

Expand All @@ -20,9 +20,9 @@ The full API of this library can be found in [api.md](api.md).

<!-- prettier-ignore -->
```js
import Nep773 from 'test-sc-openapi';
import Neo773 from 'test-sc-openapi';

const client = new Nep773();
const client = new Neo773();

async function main() {
const response = await client.add.execute({
Expand Down Expand Up @@ -54,12 +54,12 @@ This library includes TypeScript definitions for all request params and response

<!-- prettier-ignore -->
```ts
import Nep773 from 'test-sc-openapi';
import Neo773 from 'test-sc-openapi';

const client = new Nep773();
const client = new Neo773();

async function main() {
const params: Nep773.AddExecuteParams = {
const params: Neo773.AddExecuteParams = {
content: {
content_type: 'content_type',
data: [
Expand All @@ -75,7 +75,7 @@ async function main() {
},
device_name: 'device_name',
};
const response: Nep773.AddExecuteResponse = await client.add.execute(params);
const response: Neo773.AddExecuteResponse = await client.add.execute(params);
}

main();
Expand Down Expand Up @@ -110,7 +110,7 @@ async function main() {
device_name: 'device_name',
})
.catch(async (err) => {
if (err instanceof Nep773.APIError) {
if (err instanceof Neo773.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
console.log(err.headers); // {server: 'nginx', ...}
Expand Down Expand Up @@ -147,7 +147,7 @@ You can use the `maxRetries` option to configure or disable this:
<!-- prettier-ignore -->
```js
// Configure the default for all requests:
const client = new Nep773({
const client = new Neo773({
maxRetries: 0, // default is 2
});

Expand All @@ -164,7 +164,7 @@ Requests time out after 1 minute by default. You can configure this with a `time
<!-- prettier-ignore -->
```ts
// Configure the default for all requests:
const client = new Nep773({
const client = new Neo773({
timeout: 20 * 1000, // 20 seconds (default is 1 minute)
});

Expand All @@ -188,7 +188,7 @@ You can also use the `.withResponse()` method to get the raw `Response` along wi

<!-- prettier-ignore -->
```ts
const client = new Nep773();
const client = new Neo773();

const response = await client.add
.execute({
Expand Down Expand Up @@ -283,13 +283,13 @@ By default, this library uses `node-fetch` in Node, and expects a global `fetch`

If you would prefer to use a global, web-standards-compliant `fetch` function even in a Node environment,
(for example, if you are running Node with `--experimental-fetch` or using NextJS which polyfills with `undici`),
add the following import before your first import `from "Nep773"`:
add the following import before your first import `from "Neo773"`:

```ts
// Tell TypeScript and the package to use the global web fetch instead of node-fetch.
// Note, despite the name, this does not add any polyfills, but expects them to be provided if needed.
import 'test-sc-openapi/shims/web';
import Nep773 from 'test-sc-openapi';
import Neo773 from 'test-sc-openapi';
```

To do the inverse, add `import "test-sc-openapi/shims/node"` (which does import polyfills).
Expand All @@ -302,9 +302,9 @@ which can be used to inspect or alter the `Request` or `Response` before/after e

```ts
import { fetch } from 'undici'; // as one example
import Nep773 from 'test-sc-openapi';
import Neo773 from 'test-sc-openapi';

const client = new Nep773({
const client = new Neo773({
fetch: async (url: RequestInfo, init?: RequestInit): Promise<Response> => {
console.log('About to make a request', url, init);
const response = await fetch(url, init);
Expand All @@ -329,7 +329,7 @@ import http from 'http';
import { HttpsProxyAgent } from 'https-proxy-agent';

// Configure the default for all requests:
const client = new Nep773({
const client = new Neo773({
httpAgent: new HttpsProxyAgent(process.env.PROXY_URL),
});

Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ before making any information public.
## Reporting Non-SDK Related Security Issues

If you encounter security issues that are not directly related to SDKs but pertain to the services
or products provided by Nep773 please follow the respective company's security reporting guidelines.
or products provided by Neo773 please follow the respective company's security reporting guidelines.

### Nep773 Terms and Policies
### Neo773 Terms and Policies

Please contact [email protected] for any questions or concerns regarding security of our services.

Expand Down
2 changes: 1 addition & 1 deletion bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
errors=()

if [ -z "${NPM_TOKEN}" ]; then
errors+=("The NEP773_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
errors+=("The NEO773_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

lenErrors=${#errors[@]}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "test-sc-openapi",
"version": "0.0.1-alpha.1",
"description": "The official TypeScript library for the Nep773 API",
"author": "Nep773 <[email protected]>",
"version": "0.1.0-alpha.1",
"description": "The official TypeScript library for the Neo773 API",
"author": "Neo773 <[email protected]>",
"types": "dist/index.d.ts",
"main": "dist/index.js",
"type": "commonjs",
Expand Down
2 changes: 1 addition & 1 deletion scripts/build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ npm exec tsc-multi
# copy over handwritten .js/.mjs/.d.ts files
cp src/_shims/*.{d.ts,js,mjs,md} dist/_shims
cp src/_shims/auto/*.{d.ts,js,mjs} dist/_shims/auto
# we need to add exports = module.exports = Nep773 to index.js;
# we need to add exports = module.exports = Neo773 to index.js;
# No way to get that from index.ts because it would cause compile errors
# when building .mjs
node scripts/utils/fix-index-exports.cjs
Expand Down
20 changes: 10 additions & 10 deletions src/core.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { VERSION } from './version';
import {
Nep773Error,
Neo773Error,
APIError,
APIConnectionError,
APIConnectionTimeoutError,
Expand Down Expand Up @@ -504,7 +504,7 @@ export abstract class APIClient {
if (value === null) {
return `${encodeURIComponent(key)}=`;
}
throw new Nep773Error(
throw new Neo773Error(
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
);
})
Expand Down Expand Up @@ -654,7 +654,7 @@ export abstract class AbstractPage<Item> implements AsyncIterable<Item> {
async getNextPage(): Promise<this> {
const nextInfo = this.nextPageInfo();
if (!nextInfo) {
throw new Nep773Error(
throw new Neo773Error(
'No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.',
);
}
Expand Down Expand Up @@ -990,10 +990,10 @@ export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve

const validatePositiveInteger = (name: string, n: unknown): number => {
if (typeof n !== 'number' || !Number.isInteger(n)) {
throw new Nep773Error(`${name} must be an integer`);
throw new Neo773Error(`${name} must be an integer`);
}
if (n < 0) {
throw new Nep773Error(`${name} must be a positive integer`);
throw new Neo773Error(`${name} must be a positive integer`);
}
return n;
};
Expand All @@ -1009,7 +1009,7 @@ export const castToError = (err: any): Error => {
};

export const ensurePresent = <T>(value: T | null | undefined): T => {
if (value == null) throw new Nep773Error(`Expected a value to be given but received ${value} instead.`);
if (value == null) throw new Neo773Error(`Expected a value to be given but received ${value} instead.`);
return value;
};

Expand All @@ -1034,14 +1034,14 @@ export const coerceInteger = (value: unknown): number => {
if (typeof value === 'number') return Math.round(value);
if (typeof value === 'string') return parseInt(value, 10);

throw new Nep773Error(`Could not coerce ${value} (type: ${typeof value}) into a number`);
throw new Neo773Error(`Could not coerce ${value} (type: ${typeof value}) into a number`);
};

export const coerceFloat = (value: unknown): number => {
if (typeof value === 'number') return value;
if (typeof value === 'string') return parseFloat(value);

throw new Nep773Error(`Could not coerce ${value} (type: ${typeof value}) into a number`);
throw new Neo773Error(`Could not coerce ${value} (type: ${typeof value}) into a number`);
};

export const coerceBoolean = (value: unknown): boolean => {
Expand Down Expand Up @@ -1107,7 +1107,7 @@ function applyHeadersMut(targetHeaders: Headers, newHeaders: Headers): void {

export function debug(action: string, ...args: any[]) {
if (typeof process !== 'undefined' && process?.env?.['DEBUG'] === 'true') {
console.log(`Nep773:DEBUG:${action}`, ...args);
console.log(`Neo773:DEBUG:${action}`, ...args);
}
}

Expand Down Expand Up @@ -1192,7 +1192,7 @@ export const toBase64 = (str: string | null | undefined): string => {
return btoa(str);
}

throw new Nep773Error('Cannot generate b64 string; Expected `Buffer` or `btoa` to be defined');
throw new Neo773Error('Cannot generate b64 string; Expected `Buffer` or `btoa` to be defined');
};

export function isObj(obj: unknown): obj is Record<string, unknown> {
Expand Down
4 changes: 2 additions & 2 deletions src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import { castToError, Headers } from './core';

export class Nep773Error extends Error {}
export class Neo773Error extends Error {}

export class APIError<
TStatus extends number | undefined = number | undefined,
THeaders extends Headers | undefined = Headers | undefined,
TError extends Object | undefined = Object | undefined,
> extends Nep773Error {
> extends Neo773Error {
/** HTTP status for the response that caused the error */
readonly status: TStatus;
/** HTTP headers for the response that caused the error */
Expand Down
Loading

0 comments on commit c399aeb

Please sign in to comment.