Skip to content

Commit

Permalink
Merge pull request #40 from dubinc/release-please--branches--main--ch…
Browse files Browse the repository at this point in the history
…anges--next--components--dub

release: 0.8.0
  • Loading branch information
steven-tey authored Feb 26, 2024
2 parents 054e500 + 774ad85 commit e6cf926
Show file tree
Hide file tree
Showing 19 changed files with 175 additions and 183 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ jobs:
lint:
name: lint
runs-on: ubuntu-latest
if: github.repository == 'dubinc/dub-node'


steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18'

Expand Down
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.7.0"
".": "0.8.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 11
configured_endpoints: 9
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 0.8.0 (2024-02-26)

Full Changelog: [v0.7.0...v0.8.0](https://github.com/dubinc/dub-node/compare/v0.7.0...v0.8.0)

### Features

* update via SDK Studio ([#39](https://github.com/dubinc/dub-node/issues/39)) ([762245e](https://github.com/dubinc/dub-node/commit/762245ef4f02098c1b36b2229e8c71abba0ba236))
* update via SDK Studio ([#41](https://github.com/dubinc/dub-node/issues/41)) ([bc51cb7](https://github.com/dubinc/dub-node/commit/bc51cb781fb3ae4dfb3d16536f3659310a72e50c))

## 0.7.0 (2024-02-08)

Full Changelog: [v0.6.0...v0.7.0](https://github.com/dubinc/dub-node/compare/v0.6.0...v0.7.0)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ a subclass of `APIError` will be thrown:
<!-- prettier-ignore -->
```ts
async function main() {
const project = await dub.projects.retrieve({ projectSlug: 'REPLACE_ME' }).catch((err) => {
const projectDetails = await dub.projects.retrieve({ projectSlug: 'REPLACE_ME' }).catch((err) => {
if (err instanceof Dub.APIError) {
console.log(err.status); // 400
console.log(err.name); // BadRequestError
Expand Down
6 changes: 0 additions & 6 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,3 @@ Methods:
Types:

- <code><a href="./src/resources/projects/tags.ts">Tag</a></code>
- <code><a href="./src/resources/projects/tags.ts">TagListResponse</a></code>

Methods:

- <code title="post /projects/{projectSlug}/tags">client.projects.tags.<a href="./src/resources/projects/tags.ts">create</a>({ ...params }) -> Tag</code>
- <code title="get /projects/{projectSlug}/tags">client.projects.tags.<a href="./src/resources/projects/tags.ts">list</a>({ ...params }) -> TagListResponse</code>
4 changes: 2 additions & 2 deletions bin/check-release-environment
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ if [ -z "${NPM_TOKEN}" ]; then
errors+=("The DUB_NPM_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets")
fi

len=${#errors[@]}
lenErrors=${#errors[@]}

if [[ len -gt 0 ]]; then
if [[ lenErrors -gt 0 ]]; then
echo -e "Found the following errors in the release environment:\n"

for error in "${errors[@]}"; do
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dub",
"version": "0.7.0",
"version": "0.8.0",
"description": "The official TypeScript library for the Dub API",
"author": "Dub <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
25 changes: 21 additions & 4 deletions src/resources/links/bulk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export class Bulk extends APIResource {
* Bulk create up to 100 links for the authenticated project.
*/
create(params: BulkCreateParams, options?: Core.RequestOptions): Core.APIPromise<BulkCreateResponse> {
const { projectSlug = this._client.projectSlug, ...body } = params;
return this._client.post('/links/bulk', { query: { projectSlug }, body, ...options });
const { projectSlug = this._client.projectSlug, body } = params;
return this._client.post('/links/bulk', { query: { projectSlug }, body: body, ...options });
}
}

Expand All @@ -23,6 +23,11 @@ export interface BulkCreateParams {
* `app.dub.co/acme`, the projectSlug is `acme`.
*/
projectSlug?: string;

/**
* Body param:
*/
body: Array<BulkCreateParams.Body>;
}

export namespace BulkCreateParams {
Expand Down Expand Up @@ -88,6 +93,13 @@ export namespace BulkCreateParams {
*/
password?: string | null;

/**
* The prefix of the short link slug for randomly-generated keys (e.g. if prefix is
* `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key`
* is provided.
*/
prefix?: string;

/**
* Whether the short link uses Custom Social Media Cards feature.
*/
Expand All @@ -104,9 +116,14 @@ export namespace BulkCreateParams {
rewrite?: boolean;

/**
* The unique id of the tag assigned to the short link.
* The unique ID of the tag assigned to the short link.
*/
tagId?: string;

/**
* The unique IDs of the tags assigned to the short link.
*/
tagId?: string | null;
tagIds?: Array<string>;

/**
* The title of the short link generated via `api.dub.co/metatags`. Will be used
Expand Down
63 changes: 55 additions & 8 deletions src/resources/links/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { APIResource } from 'dub/resource';
import * as LinksAPI from 'dub/resources/links/links';
import * as BulkAPI from 'dub/resources/links/bulk';
import * as InfoAPI from 'dub/resources/links/info';
import * as TagsAPI from 'dub/resources/projects/tags';

export class Links extends APIResource {
info: InfoAPI.Info = new InfoAPI.Info(this._client);
Expand Down Expand Up @@ -130,6 +131,13 @@ export interface Link {
*/
password?: string | null;

/**
* The prefix of the short link slug for randomly-generated keys (e.g. if prefix is
* `/c/`, generated keys will be in the `/c/:key` format). Will be ignored if `key`
* is provided.
*/
prefix?: string;

/**
* The project ID of the short link.
*/
Expand Down Expand Up @@ -163,9 +171,19 @@ export interface Link {
shortLink?: string;

/**
* The unique id of the tag assigned to the short link.
* The unique ID of the tag assigned to the short link.
*/
tagId?: string;

/**
* The unique IDs of the tags assigned to the short link.
*/
tagId?: string | null;
tagIds?: Array<string>;

/**
* The tags assigned to the short link.
*/
tags?: Array<TagsAPI.Tag>;

/**
* The title of the short link generated via `api.dub.co/metatags`. Will be used
Expand Down Expand Up @@ -292,6 +310,13 @@ export interface LinkCreateParams {
*/
password?: string | null;

/**
* Body param: The prefix of the short link slug for randomly-generated keys (e.g.
* if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be
* ignored if `key` is provided.
*/
prefix?: string;

/**
* Body param: Whether the short link uses Custom Social Media Cards feature.
*/
Expand All @@ -308,9 +333,14 @@ export interface LinkCreateParams {
rewrite?: boolean;

/**
* Body param: The unique id of the tag assigned to the short link.
* Body param: The unique ID of the tag assigned to the short link.
*/
tagId?: string;

/**
* Body param: The unique IDs of the tags assigned to the short link.
*/
tagId?: string | null;
tagIds?: Array<string>;

/**
* Body param: The title of the short link generated via `api.dub.co/metatags`.
Expand Down Expand Up @@ -390,6 +420,13 @@ export interface LinkUpdateParams {
*/
password?: string | null;

/**
* Body param: The prefix of the short link slug for randomly-generated keys (e.g.
* if prefix is `/c/`, generated keys will be in the `/c/:key` format). Will be
* ignored if `key` is provided.
*/
prefix?: string;

/**
* Body param: Whether the short link uses Custom Social Media Cards feature.
*/
Expand All @@ -406,9 +443,14 @@ export interface LinkUpdateParams {
rewrite?: boolean;

/**
* Body param: The unique id of the tag assigned to the short link.
* Body param: The unique ID of the tag assigned to the short link.
*/
tagId?: string;

/**
* Body param: The unique IDs of the tags assigned to the short link.
*/
tagId?: string | null;
tagIds?: Array<string>;

/**
* Body param: The title of the short link generated via `api.dub.co/metatags`.
Expand Down Expand Up @@ -459,14 +501,19 @@ export interface LinkListParams {
sort?: 'createdAt' | 'clicks' | 'lastClicked';

/**
* The tag ID to filter the links by.
* The tag ID(s) to filter the links by.
*/
tagId?: string;
tagId?: string | Array<string>;

/**
* The user ID to filter the links by.
*/
userId?: string;

/**
* Only return links with tags. Defaults to `false` if not provided.
*/
withTags?: true | false;
}

export interface LinkDeleteLinkParams {
Expand Down
2 changes: 1 addition & 1 deletion src/resources/projects/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// File generated from our OpenAPI spec by Stainless.

export { Project, ProjectDetails, ProjectListResponse, ProjectRetrieveParams, Projects } from './projects';
export { Tag, TagListResponse, TagCreateParams, TagListParams, Tags } from './tags';
export { Tag, Tags } from './tags';
3 changes: 0 additions & 3 deletions src/resources/projects/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,4 @@ export namespace Projects {
export import ProjectRetrieveParams = ProjectsAPI.ProjectRetrieveParams;
export import Tags = TagsAPI.Tags;
export import Tag = TagsAPI.Tag;
export import TagListResponse = TagsAPI.TagListResponse;
export import TagCreateParams = TagsAPI.TagCreateParams;
export import TagListParams = TagsAPI.TagListParams;
}
45 changes: 1 addition & 44 deletions src/resources/projects/tags.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
// File generated from our OpenAPI spec by Stainless.

import * as Core from 'dub/core';
import { APIResource } from 'dub/resource';
import * as TagsAPI from 'dub/resources/projects/tags';

export class Tags extends APIResource {
/**
* Create a new tag for the authenticated project.
*/
create(params: TagCreateParams, options?: Core.RequestOptions): Core.APIPromise<Tag> {
const { projectSlug = this._client.projectSlug, ...body } = params;
return this._client.post(`/projects/${projectSlug}/tags`, { body, ...options });
}

/**
* Retrieve a list of tags for the authenticated project.
*/
list(params: TagListParams, options?: Core.RequestOptions): Core.APIPromise<TagListResponse> {
const { projectSlug = this._client.projectSlug } = params;
return this._client.get(`/projects/${projectSlug}/tags`, options);
}
}
export class Tags extends APIResource {}

export interface Tag {
/**
Expand All @@ -39,32 +22,6 @@ export interface Tag {
name?: string;
}

export type TagListResponse = Array<Tag>;

export interface TagCreateParams {
/**
* Path param: The slug for the project to create tags for. E.g. for
* `app.dub.co/acme`, the projectSlug is `acme`.
*/
projectSlug?: string;

/**
* Body param: The name of the tag to create.
*/
tag?: string;
}

export interface TagListParams {
/**
* The slug for the project to retrieve tags for. E.g. for `app.dub.co/acme`, the
* projectSlug is `acme`.
*/
projectSlug?: string;
}

export namespace Tags {
export import Tag = TagsAPI.Tag;
export import TagListResponse = TagsAPI.TagListResponse;
export import TagCreateParams = TagsAPI.TagCreateParams;
export import TagListParams = TagsAPI.TagListParams;
}
5 changes: 2 additions & 3 deletions src/uploads.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,8 @@ async function getBytes(value: ToFileInput): Promise<Array<BlobPart>> {
}
} else {
throw new Error(
`Unexpected data type: ${typeof value}; constructor: ${
value?.constructor?.name
}; props: ${propsForError(value)}`,
`Unexpected data type: ${typeof value}; constructor: ${value?.constructor
?.name}; props: ${propsForError(value)}`,
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '0.7.0'; // x-release-please-version
export const VERSION = '0.8.0'; // x-release-please-version
Loading

0 comments on commit e6cf926

Please sign in to comment.