Skip to content

Commit 5852ebd

Browse files
authored
Merge pull request #131 from Space-DF/feat/implement-check-org-by-slug
feat: implement space check org by slug name
2 parents a5fd46a + 02eb517 commit 5852ebd

4 files changed

Lines changed: 67 additions & 25 deletions

File tree

CODE_OF_CONDUCT.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,24 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
24-
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
26-
overall community
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
- Focusing on what is best not just for us as individuals, but for the
26+
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
31-
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
35-
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
37-
professional setting
30+
- The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
- Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
3838

3939
## Enforcement Responsibilities
4040

@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
106106
### 4. Permanent Ban
107107

108108
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
110110
individual, or aggression toward or disparagement of classes of individuals.
111111

112112
**Consequence**: A permanent ban from any sort of public interaction within

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ const registerResponse = await client.auth.register(
103103
password: 'example',
104104
},
105105
{
106-
organization: 'your-organization'
106+
organization: 'your-organization',
107107
},
108108
);
109109

api.doc.md

Lines changed: 42 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,43 @@ if (joinResponse.error) {
10371037

10381038
</details>
10391039

1040+
<details>
1041+
<summary><strong>checkOrgByslugName</strong></summary>
1042+
1043+
Check organization / space by slug name.
1044+
1045+
**Signature:**
1046+
1047+
```typescript
1048+
checkOrgByslugName(slugName: string, options?: Core.RequestOptions): Core.APIPromise<CheckOrgByslugNameResponse>
1049+
```
1050+
1051+
**Parameters:**
1052+
1053+
- `slugName` _(string)_: A slug name string identifying the space.
1054+
- `options` _(Core.RequestOptions)_: Additional request options.
1055+
1056+
**Returns:** `Promise<CheckOrgByslugNameResponse>`
1057+
1058+
Where `CheckOrgByslugNameResponse` is:
1059+
1060+
```typescript
1061+
export interface CheckOrgByslugNameResponse {
1062+
result?: string;
1063+
}
1064+
```
1065+
1066+
**Example:**
1067+
1068+
```typescript
1069+
const checkResponse = await client.spaces.checkOrgByslugName('default-8e4ee506-5937-4afb-9939-38fc8304a058');
1070+
1071+
console.log(checkResponse.result);
1072+
// Output: "Space with slug 'default-8e4ee506-5937-4afb-9939-38fc8304a058' not found."
1073+
```
1074+
1075+
</details>
1076+
10401077
---
10411078

10421079
# Oauth2
@@ -3486,14 +3523,11 @@ partialUpdate(id: string, params: DeviceSpacesParams, options?: Core.RequestOpti
34863523
**Example:**
34873524

34883525
```typescript
3489-
const updated = await client.deviceSpaces.partialUpdate(
3490-
'789e0123-e89b-12d3-a456-426614174002',
3491-
{
3492-
name: 'Sensor Network A (West Wing)',
3493-
description: 'Updated description',
3494-
dev_eui: '8437687685476895',
3495-
},
3496-
);
3526+
const updated = await client.deviceSpaces.partialUpdate('789e0123-e89b-12d3-a456-426614174002', {
3527+
name: 'Sensor Network A (West Wing)',
3528+
description: 'Updated description',
3529+
dev_eui: '8437687685476895',
3530+
});
34973531
console.log(updated.name);
34983532
```
34993533

src/resources/auth/spaces.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ export class Spaces extends APIResource {
5959
joinSpace(token: string, options?: Core.RequestOptions): Core.APIPromise<JoinSpaceResponse> {
6060
return this._client.get(`/spaces/join-space/${token}`, options);
6161
}
62+
63+
checkOrgByslugName(slugName: string, options?: Core.RequestOptions): Core.APIPromise<CheckOrgByslugNameResponse> {
64+
return this._client.get(`/spaces/check/${slugName}`, options);
65+
}
6266
}
6367

6468
export interface Space {
@@ -143,3 +147,7 @@ export interface JoinSpaceResponse {
143147
error?: string;
144148
result?: string;
145149
}
150+
151+
export interface CheckOrgByslugNameResponse {
152+
result?: string;
153+
}

0 commit comments

Comments
 (0)