-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add prettier, dependencies and various other clean-up
- Loading branch information
Showing
84 changed files
with
3,732 additions
and
480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- uses: pnpm/action-setup@v2 | ||
name: Install pnpm | ||
with: | ||
version: 8 | ||
run_install: false | ||
|
||
- name: Get pnpm store directory | ||
shell: bash | ||
run: | | ||
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | ||
- uses: actions/cache@v3 | ||
name: Setup pnpm cache | ||
with: | ||
path: ${{ env.STORE_PATH }} | ||
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pnpm-store- | ||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Install deps | ||
run: pnpm i | ||
|
||
- name: Lint | ||
run: pnpm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"printWidth": 100, | ||
"trailingComma": "es5", | ||
"singleQuote": true, | ||
"tabWidth": 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 30 additions & 30 deletions
60
_snippets/typescript-sdk/add-customer-to-group-response.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
```ts /c_XXXXXXXXXXXXXXXXXXXXXXXXXX/ | ||
import { AttachmentType, PlainClient } from '@team-plain/typescript-sdk'; | ||
import { AttachmentType, PlainClient } from "@team-plain/typescript-sdk"; | ||
|
||
const client = new PlainClient({ apiKey: 'XXX' }); | ||
const client = new PlainClient({ apiKey: "XXX" }); | ||
|
||
const res = await client.createAttachmentUploadUrl({ | ||
customerId: 'c_XXXXXXXXXXXXXXXXXXXXXXXXXX', | ||
fileName: 'the-filename.jpeg', | ||
customerId: "c_XXXXXXXXXXXXXXXXXXXXXXXXXX", | ||
fileName: "the-filename.jpeg", | ||
fileSizeBytes: 32318, | ||
attachmentType: AttachmentType.CustomTimelineEntry, | ||
}); | ||
|
||
if (res.error) { | ||
console.error(res.error); | ||
} else { | ||
console.log('Attachment upload url created'); | ||
console.log("Attachment upload url created"); | ||
console.log(res.data); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
```tsx | ||
import { PlainClient, uiComponent } from '@team-plain/typescript-sdk'; | ||
import { PlainClient, uiComponent } from "@team-plain/typescript-sdk"; | ||
|
||
const client = new PlainClient({ | ||
apiKey: 'XXX', | ||
apiKey: "XXX", | ||
debug: true, | ||
}); | ||
|
||
const res = await client.createCustomerEvent({ | ||
title: 'API key generated', | ||
title: "API key generated", | ||
|
||
customerIdentifier: { | ||
// You can use the email: | ||
email: '[email protected]', | ||
email: "[email protected]", | ||
|
||
// ...or if you set external id on customers: | ||
// externalId: 'YOUR_ID', | ||
|
@@ -22,26 +22,26 @@ const res = await client.createCustomerEvent({ | |
|
||
components: [ | ||
uiComponent.text({ | ||
text: 'New API key was added with the fingerprint **3b7896975ee9fd15eeb7** with 4 associated roles.', | ||
text: "New API key was added with the fingerprint **3b7896975ee9fd15eeb7** with 4 associated roles.", | ||
}), | ||
uiComponent.spacer({ | ||
size: 'M', | ||
size: "M", | ||
}), | ||
uiComponent.linkButton({ | ||
label: 'View in admin', | ||
url: 'https://admin.your-app.com', | ||
label: "View in admin", | ||
url: "https://admin.your-app.com", | ||
}), | ||
], | ||
|
||
// Optional - if provided, this will ensure that this event can only | ||
// be created once and fail on the second time. This external id acts | ||
// as an idempotency key while also letting you correlate an event to | ||
// something your systems. | ||
externalId: 'XXX', | ||
externalId: "XXX", | ||
|
||
// Optional - if provided then the event will only be shown | ||
// in a single thread vs all threads from a customer | ||
threadId: 'th_01HB924RWAW8H3Q8KZDFWYBJHZ', | ||
threadId: "th_01HB924RWAW8H3Q8KZDFWYBJHZ", | ||
}); | ||
|
||
if (res.error) { | ||
|
Oops, something went wrong.