@refoldai/refold-js 10.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/method/SKILL.md +282 -0
- package/.claude/skills/review-pr/SKILL.md +80 -0
- package/.claude/skills/style/SKILL.md +67 -0
- package/.claude/skills/verify/SKILL.md +85 -0
- package/.github/pull_request_template.md +48 -0
- package/.github/workflows/npm-publish.yml +35 -0
- package/.github/workflows/pr-validation.yml +224 -0
- package/CLAUDE.md +127 -0
- package/LICENSE +21 -0
- package/README.md +63 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +113 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/classes/Refold.html +123 -0
- package/docs/enums/AuthStatus.html +3 -0
- package/docs/enums/AuthType.html +4 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +36 -0
- package/docs/interfaces/Application.html +37 -0
- package/docs/interfaces/Config.html +6 -0
- package/docs/interfaces/ConfigField.html +17 -0
- package/docs/interfaces/ConfigPayload.html +8 -0
- package/docs/interfaces/ConfigWorkflow.html +6 -0
- package/docs/interfaces/ExecuteWorkflowPayload.html +9 -0
- package/docs/interfaces/Execution.html +19 -0
- package/docs/interfaces/ExecutionFilters.html +16 -0
- package/docs/interfaces/GetExecutionsParams.html +19 -0
- package/docs/interfaces/InputField.html +18 -0
- package/docs/interfaces/Label.html +6 -0
- package/docs/interfaces/PublicWorkflow.html +16 -0
- package/docs/interfaces/PublicWorkflowPayload.html +8 -0
- package/docs/interfaces/PublicWorkflowsPayload.html +15 -0
- package/docs/interfaces/RefoldOptions.html +5 -0
- package/docs/interfaces/RuleOptions.html +4 -0
- package/docs/interfaces/UpdateConfigPayload.html +10 -0
- package/docs/interfaces/WorkflowPayload.html +8 -0
- package/docs/interfaces/WorkflowPayloadResponse.html +4 -0
- package/docs/llms.txt +986 -0
- package/docs/modules.html +1 -0
- package/docs/types/ExecutionSource.html +2 -0
- package/docs/types/ExecutionStatus.html +2 -0
- package/docs/types/ExecutionType.html +2 -0
- package/package.json +38 -0
- package/refold.d.ts +556 -0
- package/refold.js +667 -0
- package/refold.ts +1044 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
name: PR Validation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches: [uat]
|
|
6
|
+
types: [opened, edited, synchronize, reopened]
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
pr-validation:
|
|
10
|
+
name: pr-validation
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
permissions:
|
|
13
|
+
pull-requests: write
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Validate PR template
|
|
18
|
+
uses: actions/github-script@v7
|
|
19
|
+
with:
|
|
20
|
+
script: |
|
|
21
|
+
const pr = context.payload.pull_request;
|
|
22
|
+
const title = pr.title || '';
|
|
23
|
+
const body = pr.body || '';
|
|
24
|
+
const labels = pr.labels.map(l => l.name);
|
|
25
|
+
const isHotfix = labels.includes('hotfix');
|
|
26
|
+
|
|
27
|
+
const errors = [];
|
|
28
|
+
const warnings = [];
|
|
29
|
+
|
|
30
|
+
function section(heading) {
|
|
31
|
+
const esc = heading.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
32
|
+
const re = new RegExp(`#{1,6}\\s+${esc}\\s*\\n([\\s\\S]*?)(?=\\n#{1,6}\\s|$)`, 'i');
|
|
33
|
+
const m = body.match(re);
|
|
34
|
+
if (!m) return null;
|
|
35
|
+
return m[1].replace(/<!--[\s\\S]*?-->/g, '').trim();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (isHotfix) {
|
|
39
|
+
warnings.push(
|
|
40
|
+
'This PR is labelled **hotfix** — template checks skipped. ' +
|
|
41
|
+
'Tests are still required.'
|
|
42
|
+
);
|
|
43
|
+
} else {
|
|
44
|
+
const titleRe = /^(feat|fix|chore|refactor|build|perf|breaking|docs|internal)(\(.+\))?: .{3,}/;
|
|
45
|
+
const isInternal = /^internal(\(.+\))?:/.test(title);
|
|
46
|
+
if (!titleRe.test(title)) {
|
|
47
|
+
errors.push(
|
|
48
|
+
'**Title format** — must match `type(scope): short description`\n' +
|
|
49
|
+
' Valid types: `feat` `fix` `chore` `refactor` `build` `perf` `breaking` `docs` `internal`\n' +
|
|
50
|
+
' Example: `fix(auth): resolve token expiry on refresh`\n' +
|
|
51
|
+
' Use `internal` for tooling/process PRs that have no Linear ticket\n' +
|
|
52
|
+
` Got: \`${title}\``
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const summary = section('Summary') || '';
|
|
57
|
+
if (summary.length < 20) {
|
|
58
|
+
errors.push(
|
|
59
|
+
`**Summary** — must be at least 20 characters (got ${summary.length})`
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (!isInternal && !/^\w+\s+[A-Z]+-\d+\b|^[A-Z]+-\d+\b/m.test(body)) {
|
|
64
|
+
errors.push(
|
|
65
|
+
'**Linear ticket** — a valid ticket ID must appear on its own line in the PR body\n' +
|
|
66
|
+
' Valid formats: `DEV-123`, `closes DEV-123`, `resolves AIA-456`, `fixes DEV-789`\n' +
|
|
67
|
+
' If there is no ticket, use `internal` as the title type to skip this check'
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const testPlan = section('Test Plan') || '';
|
|
72
|
+
if (!/- \[ \] .+/.test(testPlan)) {
|
|
73
|
+
errors.push(
|
|
74
|
+
'**Test Plan** — must include at least one step with text, e.g. `- [ ] Navigate to X and verify Y`'
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
let prFiles = [];
|
|
79
|
+
try {
|
|
80
|
+
const { data: files } = await github.rest.pulls.listFiles({
|
|
81
|
+
owner: context.repo.owner,
|
|
82
|
+
repo: context.repo.repo,
|
|
83
|
+
pull_number: pr.number,
|
|
84
|
+
per_page: 100,
|
|
85
|
+
});
|
|
86
|
+
prFiles = files;
|
|
87
|
+
} catch (e) {
|
|
88
|
+
core.warning(`Could not list PR files: ${e.message}`);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const needsPlan = /^(feat|refactor|breaking)(\(.+\))?:/.test(title);
|
|
92
|
+
const hasPlanFile = prFiles.some(f =>
|
|
93
|
+
f.filename.startsWith('docs/superpowers/plans/') ||
|
|
94
|
+
f.filename.startsWith('docs/superpowers/specs/')
|
|
95
|
+
);
|
|
96
|
+
if (needsPlan && !hasPlanFile) {
|
|
97
|
+
warnings.push(
|
|
98
|
+
'**Superpowers plan file missing** — feature PRs should include a plan file in `docs/superpowers/plans/`.\n' +
|
|
99
|
+
' Run `superpowers:brainstorming` + `superpowers:writing-plans` in Claude Code before implementing.\n' +
|
|
100
|
+
' If you intentionally skipped planning (trivial change), you can ignore this warning.'
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const envPatterns = [
|
|
105
|
+
/\.env(\.|$)/i,
|
|
106
|
+
/(^|\/)\.env$/i,
|
|
107
|
+
/(^|\/)env\//i,
|
|
108
|
+
/(^|\/)config\//i,
|
|
109
|
+
/helm\/.*values.*\.ya?ml$/i,
|
|
110
|
+
/docker-compose.*\.ya?ml$/i,
|
|
111
|
+
/kubernetes\/.*\.ya?ml$/i,
|
|
112
|
+
/k8s\/.*\.ya?ml$/i,
|
|
113
|
+
];
|
|
114
|
+
const touchesEnvFiles = prFiles.some(f =>
|
|
115
|
+
envPatterns.some(p => p.test(f.filename))
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
if (touchesEnvFiles) {
|
|
119
|
+
const envSection = section('Env Changes') || '';
|
|
120
|
+
const hasContent =
|
|
121
|
+
/none/i.test(envSection) ||
|
|
122
|
+
/- name:\s*\S+/.test(envSection);
|
|
123
|
+
if (!hasContent) {
|
|
124
|
+
errors.push(
|
|
125
|
+
'**Env Changes** — this PR modifies config/env files but ' +
|
|
126
|
+
'the Env Changes section is empty.\n' +
|
|
127
|
+
' Document all env variable changes, or write `none` if no variables changed.'
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const MARKER = '<!-- pr-validation-bot -->';
|
|
134
|
+
if (errors.length > 0 || warnings.length > 0) {
|
|
135
|
+
const lines = [MARKER];
|
|
136
|
+
if (isHotfix) {
|
|
137
|
+
lines.push('### ⚠️ PR Validation — Hotfix Mode');
|
|
138
|
+
lines.push('');
|
|
139
|
+
warnings.forEach(w => lines.push(`> ${w}`));
|
|
140
|
+
} else {
|
|
141
|
+
if (errors.length > 0) {
|
|
142
|
+
lines.push('### ⚠️ PR Validation Failed');
|
|
143
|
+
lines.push('');
|
|
144
|
+
lines.push(
|
|
145
|
+
`The following ${errors.length === 1 ? 'field requires' : `${errors.length} fields require`} attention:`
|
|
146
|
+
);
|
|
147
|
+
lines.push('');
|
|
148
|
+
errors.forEach(e => lines.push(`- ${e}`));
|
|
149
|
+
lines.push('');
|
|
150
|
+
lines.push('_Fix the above and the check will re-run automatically._');
|
|
151
|
+
}
|
|
152
|
+
if (warnings.length > 0) {
|
|
153
|
+
if (errors.length > 0) lines.push('');
|
|
154
|
+
lines.push(errors.length > 0 ? '### ⚠️ Warnings' : '### ⚠️ PR Validation — Warnings');
|
|
155
|
+
lines.push('');
|
|
156
|
+
warnings.forEach(w => lines.push(`> ${w}`));
|
|
157
|
+
lines.push('');
|
|
158
|
+
lines.push('_Warnings will not fail the check — address them if applicable._');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
const commentBody = lines.join('\n');
|
|
163
|
+
const { data: comments } = await github.rest.issues.listComments({
|
|
164
|
+
owner: context.repo.owner,
|
|
165
|
+
repo: context.repo.repo,
|
|
166
|
+
issue_number: pr.number,
|
|
167
|
+
});
|
|
168
|
+
const existing = comments.find(
|
|
169
|
+
c => c.user.type === 'Bot' && c.body.includes(MARKER)
|
|
170
|
+
);
|
|
171
|
+
if (existing) {
|
|
172
|
+
await github.rest.issues.updateComment({
|
|
173
|
+
owner: context.repo.owner,
|
|
174
|
+
repo: context.repo.repo,
|
|
175
|
+
comment_id: existing.id,
|
|
176
|
+
body: commentBody,
|
|
177
|
+
});
|
|
178
|
+
} else {
|
|
179
|
+
await github.rest.issues.createComment({
|
|
180
|
+
owner: context.repo.owner,
|
|
181
|
+
repo: context.repo.repo,
|
|
182
|
+
issue_number: pr.number,
|
|
183
|
+
body: commentBody,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (errors.length > 0) {
|
|
189
|
+
core.setFailed(
|
|
190
|
+
`PR validation failed — ${errors.length} field(s) need attention. ` +
|
|
191
|
+
`See PR comment for details.`
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
- name: Notify Slack on failure
|
|
196
|
+
if: failure()
|
|
197
|
+
env:
|
|
198
|
+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
|
|
199
|
+
PR_URL: ${{ github.event.pull_request.html_url }}
|
|
200
|
+
PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
201
|
+
PR_TITLE: ${{ github.event.pull_request.title }}
|
|
202
|
+
PR_BRANCH: ${{ github.head_ref }}
|
|
203
|
+
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
|
|
204
|
+
run: |
|
|
205
|
+
payload=$(jq -n \
|
|
206
|
+
--arg url "$PR_URL" \
|
|
207
|
+
--arg number "$PR_NUMBER" \
|
|
208
|
+
--arg title "$PR_TITLE" \
|
|
209
|
+
--arg branch "$PR_BRANCH" \
|
|
210
|
+
--arg author "$PR_AUTHOR" \
|
|
211
|
+
'{
|
|
212
|
+
text: ":warning: *PR Validation Failed* — refold-js",
|
|
213
|
+
attachments: [{
|
|
214
|
+
color: "warning",
|
|
215
|
+
fields: [
|
|
216
|
+
{ title: "PR", value: ("<" + $url + "|#" + $number + " " + $title + ">"), short: false },
|
|
217
|
+
{ title: "Branch", value: ("`" + $branch + "`"), short: true },
|
|
218
|
+
{ title: "Author", value: $author, short: true }
|
|
219
|
+
]
|
|
220
|
+
}]
|
|
221
|
+
}')
|
|
222
|
+
curl -s -X POST "$SLACK_WEBHOOK" \
|
|
223
|
+
-H "Content-Type: application/json" \
|
|
224
|
+
-d "$payload"
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
Refold JS SDK (`@refoldai/refold-js`) — a zero-dependency TypeScript frontend SDK for integrating with the Refold platform. Provides methods for application connection (OAuth2 + key-based), configuration management, workflow execution, and execution monitoring. Published to npm as a public package. Single-file library (`refold.ts`, ~970 lines).
|
|
8
|
+
|
|
9
|
+
## Commands
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm run build # Compile TypeScript (tsc) → refold.js + refold.d.ts
|
|
13
|
+
npm run docs # Generate TypeDoc HTML documentation
|
|
14
|
+
npm run docs:llms # Generate LLM-optimized markdown docs (docs/llms.txt)
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
No test runner is configured. No runtime dependencies.
|
|
18
|
+
|
|
19
|
+
## Build Output
|
|
20
|
+
|
|
21
|
+
- `refold.js` — Compiled CommonJS module (main entry point)
|
|
22
|
+
- `refold.d.ts` — TypeScript type definitions
|
|
23
|
+
- `docs/` — Generated TypeDoc documentation (HTML + `llms.txt`)
|
|
24
|
+
|
|
25
|
+
Published to npm (`@refoldai/refold-js`) and served via jsDelivr CDN.
|
|
26
|
+
|
|
27
|
+
## Architecture
|
|
28
|
+
|
|
29
|
+
### Single-Class Design
|
|
30
|
+
The entire SDK is a single `Refold` class using native `fetch` API. No external dependencies.
|
|
31
|
+
|
|
32
|
+
### Authentication
|
|
33
|
+
- Bearer token auth via `Authorization` header on all requests
|
|
34
|
+
- Token set via constructor option or `refold.token = "..."` after initialization
|
|
35
|
+
- Default base URL: `https://app.refold.ai` (configurable via `baseUrl` option)
|
|
36
|
+
|
|
37
|
+
### Public API
|
|
38
|
+
|
|
39
|
+
**Constructor:**
|
|
40
|
+
```typescript
|
|
41
|
+
const refold = new Refold({ token?: string, baseUrl?: string })
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Application Management:**
|
|
45
|
+
- `getApp(): Promise<Application[]>` — Get all enabled apps
|
|
46
|
+
- `getApp(slug: string): Promise<Application>` — Get specific app
|
|
47
|
+
- `getApps(): Promise<Application[]>` — Alias for getApp()
|
|
48
|
+
|
|
49
|
+
**Connection:**
|
|
50
|
+
- `connect({ slug, type?, payload? }): Promise<boolean>` — Connect app (OAuth2 popup or key-based POST)
|
|
51
|
+
- `disconnect(slug, type?): Promise<unknown>` — Disconnect app
|
|
52
|
+
|
|
53
|
+
**Configuration:**
|
|
54
|
+
- `config(payload): Promise<Config>` — Create/get config
|
|
55
|
+
- `getConfigs(slug): Promise<{ config_id }[]>` — List configs
|
|
56
|
+
- `getConfig(slug, configId?): Promise<Config>` — Get specific config
|
|
57
|
+
- `updateConfig(payload): Promise<Config>` — Update config
|
|
58
|
+
- `deleteConfig(slug, configId?): Promise<unknown>` — Delete config
|
|
59
|
+
- `getConfigField(slug, fieldId, workflowId?): Promise<Config>` — Get field
|
|
60
|
+
- `updateConfigField(slug, fieldId, value, workflowId?): Promise<Config>` — Update field
|
|
61
|
+
- `deleteConfigField(slug, fieldId, workflowId?): Promise<unknown>` — Delete field
|
|
62
|
+
- `getFieldOptions(lhs, slug, fieldId, workflowId?): Promise<RuleOptions>` — Rule engine options
|
|
63
|
+
|
|
64
|
+
**Workflows:**
|
|
65
|
+
- `getWorkflows(params?): Promise<PaginatedResponse<PublicWorkflow>>` — List workflows
|
|
66
|
+
- `createWorkflow(params): Promise<PublicWorkflow>` — Create workflow
|
|
67
|
+
- `deleteWorkflow(workflowId): Promise<unknown>` — Delete workflow
|
|
68
|
+
- `getWorkflowPayload(workflowId): Promise<WorkflowPayloadResponse>` — Get payload schema
|
|
69
|
+
- `executeWorkflow(options): Promise<unknown>` — Execute workflow
|
|
70
|
+
|
|
71
|
+
**Executions:**
|
|
72
|
+
- `getExecutions({ page?, limit? }?): Promise<PaginatedResponse<Execution>>` — List executions
|
|
73
|
+
- `getExecution(executionId): Promise<Execution>` — Get execution details
|
|
74
|
+
|
|
75
|
+
### Key Types
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
enum AuthType { OAuth2 = "oauth2", KeyBased = "keybased" }
|
|
79
|
+
enum AuthStatus { Active = "active", Expired = "expired" }
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Application** — app_id, name, slug, icon, tags, auth_type_options, connected_accounts (with status)
|
|
83
|
+
**Config** — slug, config_id, fields (ConfigField[]), workflows (ConfigWorkflow[]), field_errors
|
|
84
|
+
**Execution** — status (COMPLETED/RUNNING/ERRORED/STOPPED/STOPPING/TIMED_OUT), nodes with node_status, completion_percentage
|
|
85
|
+
|
|
86
|
+
### OAuth Flow
|
|
87
|
+
- Opens popup via `window.open(oauthUrl)`
|
|
88
|
+
- Polls `/api/v2/f-sdk/application/{slug}` every 3 seconds
|
|
89
|
+
- Resolves when `connected_accounts` shows active OAuth connection or window closes
|
|
90
|
+
|
|
91
|
+
### Error Handling
|
|
92
|
+
All 4xx/5xx HTTP responses throw the parsed JSON error response. No try/catch in SDK — errors propagate to caller.
|
|
93
|
+
|
|
94
|
+
### Backend API Endpoints Used
|
|
95
|
+
All requests include `Authorization: Bearer ${token}`:
|
|
96
|
+
- Auth service: `/api/v3/org/basics`, `/api/v2/public/linked-account`
|
|
97
|
+
- Apps: `/api/v2/f-sdk/application`, `/api/v1/{slug}/integrate`, `/api/v2/app/{slug}/save`
|
|
98
|
+
- Config: `/api/v2/f-sdk/config`, `/api/v2/f-sdk/slug/{slug}/config/{configId}`, `/api/v2/public/config/field/{fieldId}`
|
|
99
|
+
- Workflows: `/api/v2/public/workflow`, `/api/v2/public/workflow/{id}/execute`
|
|
100
|
+
- Executions: `/api/v2/public/execution`
|
|
101
|
+
|
|
102
|
+
### Browser & Node Compatibility
|
|
103
|
+
- **Browser:** Uses native `fetch`, `window.open()` for OAuth popups, `setInterval` for polling
|
|
104
|
+
- **Node.js:** Works in Node 18+ (native fetch). No browser APIs called in non-OAuth flows.
|
|
105
|
+
|
|
106
|
+
## TypeScript Configuration
|
|
107
|
+
|
|
108
|
+
- Target: ES6, Module: CommonJS
|
|
109
|
+
- Strict mode enabled
|
|
110
|
+
- Declarations emitted (`refold.d.ts`)
|
|
111
|
+
- LF line endings enforced
|
|
112
|
+
|
|
113
|
+
## Version History
|
|
114
|
+
|
|
115
|
+
- **v9.x:** Added `getWorkflowPayload()`, `executeWorkflow()`, multi-auth support
|
|
116
|
+
- **v8.x:** Introduced `AuthType` enum for multi-auth
|
|
117
|
+
- Deprecated fields maintained for backward compatibility
|
|
118
|
+
|
|
119
|
+
## Claude Code Skills
|
|
120
|
+
|
|
121
|
+
All development using Claude Code must use the superpowers skills plugin. Required before every task:
|
|
122
|
+
|
|
123
|
+
- **Before building features or components:** invoke `superpowers:brainstorming` to explore intent and design first
|
|
124
|
+
- **Before multi-step implementation:** invoke `superpowers:writing-plans` — this saves a plan to `docs/superpowers/plans/`
|
|
125
|
+
- **Before claiming work is done:** invoke `superpowers:verification-before-completion` before committing or opening a PR
|
|
126
|
+
|
|
127
|
+
For feature work (`feat/*` branches), include the plan file from `docs/superpowers/plans/` in the PR. PRs without a plan file for feature branches will receive a warning from the PR validation bot.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Breakout-Embed
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# Refold Javascript SDK
|
|
2
|
+
Refold frontend SDK.
|
|
3
|
+
|
|
4
|
+
## Install
|
|
5
|
+
|
|
6
|
+
#### npm
|
|
7
|
+
```bash
|
|
8
|
+
npm install @refoldai/refold-js
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
#### yarn
|
|
12
|
+
```bash
|
|
13
|
+
yarn add @refoldai/refold-js
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage
|
|
17
|
+
|
|
18
|
+
### Include
|
|
19
|
+
|
|
20
|
+
#### Browser
|
|
21
|
+
```html
|
|
22
|
+
<!-- use this if you get an error saying `exports` is not defined. -->
|
|
23
|
+
<script>var exports = {};</script>
|
|
24
|
+
<!-- use a specific version -->
|
|
25
|
+
<script src="https://cdn.jsdelivr.net/npm/@refoldai/refold-js@10.0.0"></script>
|
|
26
|
+
<!-- use a version range instead of a specific version -->
|
|
27
|
+
<script src="https://cdn.jsdelivr.net/npm/@refoldai/refold-js@10"></script>
|
|
28
|
+
<script src="https://cdn.jsdelivr.net/npm/@refoldai/refold-js@10.0"></script>
|
|
29
|
+
<!-- omit the version completely to use the latest one -->
|
|
30
|
+
<!-- you should NOT use this in production -->
|
|
31
|
+
<script src="https://cdn.jsdelivr.net/npm/@refoldai/refold-js"></script>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### Node
|
|
35
|
+
```js
|
|
36
|
+
import { Refold } from "@refoldai/refold-js";
|
|
37
|
+
// or, if you're using CommonJS
|
|
38
|
+
const { Refold } = require("@refoldai/refold-js");
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Initialize
|
|
42
|
+
```js
|
|
43
|
+
// initialize with token
|
|
44
|
+
const refold = new Refold({
|
|
45
|
+
// the token you generate for linked accounts using the Refold backend SDK
|
|
46
|
+
token: "REFOLD_SESSION_TOKEN",
|
|
47
|
+
// OPTIONAL: set custom base url for all API requests. only useful if you are hosting Refold on premise.
|
|
48
|
+
baseUrl: "https://refold.example.com/backend",
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Or, initialize without token
|
|
52
|
+
const refold = new Refold();
|
|
53
|
+
// and you can set the token later.
|
|
54
|
+
refold.token = "REFOLD_SESSION_TOKEN";
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
# Documentation
|
|
58
|
+
|
|
59
|
+
- You can read the [SDK documentation here](https://gocobalt.github.io/refold-js).
|
|
60
|
+
|
|
61
|
+
- [`llms.txt`](https://gocobalt.github.io/refold-js/llms.txt)
|
|
62
|
+
|
|
63
|
+
This documentation is also available in [llms.txt](https://llmstxt.org) format, which is a simple markdown standard that LLMs can consume easily.
|
package/docs/.nojekyll
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
window.hierarchyData = "eJyNjj0LwjAQhv/LzalaRYfs6uouHUJypcF8QO4KQsl/97IUEUGnF94vngVKzkyg7/3uMCgoOAa07HMSbwExmyQTETScn2jnll18YCwECh4+OdD740nBXIJ0fJJkNBZp+1nfTByDbGwwJO/A5Lq279ZNCycfXMHUiPp+qApE3hiuyOsv3Uwx8RfGl8UfJLXWF/BbYLU="
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--light-hl-0: #795E26;
|
|
3
|
+
--dark-hl-0: #DCDCAA;
|
|
4
|
+
--light-hl-1: #000000;
|
|
5
|
+
--dark-hl-1: #D4D4D4;
|
|
6
|
+
--light-hl-2: #A31515;
|
|
7
|
+
--dark-hl-2: #CE9178;
|
|
8
|
+
--light-hl-3: #008000;
|
|
9
|
+
--dark-hl-3: #6A9955;
|
|
10
|
+
--light-hl-4: #800000;
|
|
11
|
+
--dark-hl-4: #808080;
|
|
12
|
+
--light-hl-5: #800000;
|
|
13
|
+
--dark-hl-5: #569CD6;
|
|
14
|
+
--light-hl-6: #0000FF;
|
|
15
|
+
--dark-hl-6: #569CD6;
|
|
16
|
+
--light-hl-7: #000000FF;
|
|
17
|
+
--dark-hl-7: #D4D4D4;
|
|
18
|
+
--light-hl-8: #001080;
|
|
19
|
+
--dark-hl-8: #9CDCFE;
|
|
20
|
+
--light-hl-9: #E50000;
|
|
21
|
+
--dark-hl-9: #9CDCFE;
|
|
22
|
+
--light-hl-10: #0000FF;
|
|
23
|
+
--dark-hl-10: #CE9178;
|
|
24
|
+
--light-hl-11: #AF00DB;
|
|
25
|
+
--dark-hl-11: #C586C0;
|
|
26
|
+
--light-hl-12: #0070C1;
|
|
27
|
+
--dark-hl-12: #4FC1FF;
|
|
28
|
+
--light-code-background: #FFFFFF;
|
|
29
|
+
--dark-code-background: #1E1E1E;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@media (prefers-color-scheme: light) { :root {
|
|
33
|
+
--hl-0: var(--light-hl-0);
|
|
34
|
+
--hl-1: var(--light-hl-1);
|
|
35
|
+
--hl-2: var(--light-hl-2);
|
|
36
|
+
--hl-3: var(--light-hl-3);
|
|
37
|
+
--hl-4: var(--light-hl-4);
|
|
38
|
+
--hl-5: var(--light-hl-5);
|
|
39
|
+
--hl-6: var(--light-hl-6);
|
|
40
|
+
--hl-7: var(--light-hl-7);
|
|
41
|
+
--hl-8: var(--light-hl-8);
|
|
42
|
+
--hl-9: var(--light-hl-9);
|
|
43
|
+
--hl-10: var(--light-hl-10);
|
|
44
|
+
--hl-11: var(--light-hl-11);
|
|
45
|
+
--hl-12: var(--light-hl-12);
|
|
46
|
+
--code-background: var(--light-code-background);
|
|
47
|
+
} }
|
|
48
|
+
|
|
49
|
+
@media (prefers-color-scheme: dark) { :root {
|
|
50
|
+
--hl-0: var(--dark-hl-0);
|
|
51
|
+
--hl-1: var(--dark-hl-1);
|
|
52
|
+
--hl-2: var(--dark-hl-2);
|
|
53
|
+
--hl-3: var(--dark-hl-3);
|
|
54
|
+
--hl-4: var(--dark-hl-4);
|
|
55
|
+
--hl-5: var(--dark-hl-5);
|
|
56
|
+
--hl-6: var(--dark-hl-6);
|
|
57
|
+
--hl-7: var(--dark-hl-7);
|
|
58
|
+
--hl-8: var(--dark-hl-8);
|
|
59
|
+
--hl-9: var(--dark-hl-9);
|
|
60
|
+
--hl-10: var(--dark-hl-10);
|
|
61
|
+
--hl-11: var(--dark-hl-11);
|
|
62
|
+
--hl-12: var(--dark-hl-12);
|
|
63
|
+
--code-background: var(--dark-code-background);
|
|
64
|
+
} }
|
|
65
|
+
|
|
66
|
+
:root[data-theme='light'] {
|
|
67
|
+
--hl-0: var(--light-hl-0);
|
|
68
|
+
--hl-1: var(--light-hl-1);
|
|
69
|
+
--hl-2: var(--light-hl-2);
|
|
70
|
+
--hl-3: var(--light-hl-3);
|
|
71
|
+
--hl-4: var(--light-hl-4);
|
|
72
|
+
--hl-5: var(--light-hl-5);
|
|
73
|
+
--hl-6: var(--light-hl-6);
|
|
74
|
+
--hl-7: var(--light-hl-7);
|
|
75
|
+
--hl-8: var(--light-hl-8);
|
|
76
|
+
--hl-9: var(--light-hl-9);
|
|
77
|
+
--hl-10: var(--light-hl-10);
|
|
78
|
+
--hl-11: var(--light-hl-11);
|
|
79
|
+
--hl-12: var(--light-hl-12);
|
|
80
|
+
--code-background: var(--light-code-background);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
:root[data-theme='dark'] {
|
|
84
|
+
--hl-0: var(--dark-hl-0);
|
|
85
|
+
--hl-1: var(--dark-hl-1);
|
|
86
|
+
--hl-2: var(--dark-hl-2);
|
|
87
|
+
--hl-3: var(--dark-hl-3);
|
|
88
|
+
--hl-4: var(--dark-hl-4);
|
|
89
|
+
--hl-5: var(--dark-hl-5);
|
|
90
|
+
--hl-6: var(--dark-hl-6);
|
|
91
|
+
--hl-7: var(--dark-hl-7);
|
|
92
|
+
--hl-8: var(--dark-hl-8);
|
|
93
|
+
--hl-9: var(--dark-hl-9);
|
|
94
|
+
--hl-10: var(--dark-hl-10);
|
|
95
|
+
--hl-11: var(--dark-hl-11);
|
|
96
|
+
--hl-12: var(--dark-hl-12);
|
|
97
|
+
--code-background: var(--dark-code-background);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.hl-0 { color: var(--hl-0); }
|
|
101
|
+
.hl-1 { color: var(--hl-1); }
|
|
102
|
+
.hl-2 { color: var(--hl-2); }
|
|
103
|
+
.hl-3 { color: var(--hl-3); }
|
|
104
|
+
.hl-4 { color: var(--hl-4); }
|
|
105
|
+
.hl-5 { color: var(--hl-5); }
|
|
106
|
+
.hl-6 { color: var(--hl-6); }
|
|
107
|
+
.hl-7 { color: var(--hl-7); }
|
|
108
|
+
.hl-8 { color: var(--hl-8); }
|
|
109
|
+
.hl-9 { color: var(--hl-9); }
|
|
110
|
+
.hl-10 { color: var(--hl-10); }
|
|
111
|
+
.hl-11 { color: var(--hl-11); }
|
|
112
|
+
.hl-12 { color: var(--hl-12); }
|
|
113
|
+
pre, code { background: var(--code-background); }
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
addIcons();
|
|
3
|
+
function addIcons() {
|
|
4
|
+
if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons);
|
|
5
|
+
const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg"));
|
|
6
|
+
svg.innerHTML = `<g id="icon-1" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></g><g id="icon-2" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></g><g id="icon-4" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">N</text></g><g id="icon-8" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">E</text></g><g id="icon-16" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></g><g id="icon-32" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">V</text></g><g id="icon-64" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">F</text></g><g id="icon-128" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></g><g id="icon-256" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">I</text></g><g id="icon-512" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></g><g id="icon-1024" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></g><g id="icon-2048" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-method)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></g><g id="icon-4096" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">F</text></g><g id="icon-8192" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></g><g id="icon-16384" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></g><g id="icon-32768" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></g><g id="icon-65536" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></g><g id="icon-131072" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></g><g id="icon-262144" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></g><g id="icon-524288" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></g><g id="icon-1048576" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></g><g id="icon-2097152" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></g><g id="icon-4194304" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-reference)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">R</text></g><g id="icon-8388608" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="6,5 6,19 18,19, 18,10 13,5"></polygon><line x1="9" y1="9" x2="13" y2="9"></line><line x1="9" y1="12" x2="15" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line></g></g><g id="icon-folder" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="5,5 10,5 12,8 19,8 19,18 5,18"></polygon></g></g><g id="icon-chevronDown" class="tsd-no-select"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-icon-text)"></path></g><g id="icon-chevronSmall" class="tsd-no-select"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-icon-text)"></path></g><g id="icon-checkbox" class="tsd-no-select"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></g><g id="icon-menu" class="tsd-no-select"><rect x="1" y="3" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-icon-text)"></rect></g><g id="icon-search" class="tsd-no-select"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-icon-text)"></path></g><g id="icon-anchor" class="tsd-no-select"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></g><g id="icon-alertNote" class="tsd-no-select"><path fill="var(--color-alert-note)" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></g><g id="icon-alertTip" class="tsd-no-select"><path fill="var(--color-alert-tip)" d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></g><g id="icon-alertImportant" class="tsd-no-select"><path fill="var(--color-alert-important)" d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></g><g id="icon-alertWarning" class="tsd-no-select"><path fill="var(--color-alert-warning)" d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></g><g id="icon-alertCaution" class="tsd-no-select"><path fill="var(--color-alert-caution)" d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></g>`;
|
|
7
|
+
svg.style.display = "none";
|
|
8
|
+
if (location.protocol === "file:") updateUseElements();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function updateUseElements() {
|
|
12
|
+
document.querySelectorAll("use").forEach(el => {
|
|
13
|
+
if (el.getAttribute("href").includes("#icon-")) {
|
|
14
|
+
el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#"));
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
})()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg"><g id="icon-1" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></g><g id="icon-2" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-module)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></g><g id="icon-4" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-namespace)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">N</text></g><g id="icon-8" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-enum)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">E</text></g><g id="icon-16" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></g><g id="icon-32" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-variable)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">V</text></g><g id="icon-64" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">F</text></g><g id="icon-128" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-class)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></g><g id="icon-256" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-interface)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">I</text></g><g id="icon-512" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></g><g id="icon-1024" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></g><g id="icon-2048" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-method)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">M</text></g><g id="icon-4096" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-function)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">F</text></g><g id="icon-8192" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></g><g id="icon-16384" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-constructor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">C</text></g><g id="icon-32768" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-property)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">P</text></g><g id="icon-65536" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></g><g id="icon-131072" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></g><g id="icon-262144" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></g><g id="icon-524288" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></g><g id="icon-1048576" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-accessor)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">A</text></g><g id="icon-2097152" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-type-alias)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">T</text></g><g id="icon-4194304" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-ts-reference)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="12"></rect><text fill="var(--color-icon-text)" x="50%" y="50%" dy="0.35em" text-anchor="middle">R</text></g><g id="icon-8388608" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="6,5 6,19 18,19, 18,10 13,5"></polygon><line x1="9" y1="9" x2="13" y2="9"></line><line x1="9" y1="12" x2="15" y2="12"></line><line x1="9" y1="15" x2="15" y2="15"></line></g></g><g id="icon-folder" class="tsd-no-select"><rect fill="var(--color-icon-background)" stroke="var(--color-document)" stroke-width="1.5" x="1" y="1" width="22" height="22" rx="6"></rect><g stroke="var(--color-icon-text)" fill="none" stroke-width="1.5"><polygon points="5,5 10,5 12,8 19,8 19,18 5,18"></polygon></g></g><g id="icon-chevronDown" class="tsd-no-select"><path d="M4.93896 8.531L12 15.591L19.061 8.531L16.939 6.409L12 11.349L7.06098 6.409L4.93896 8.531Z" fill="var(--color-icon-text)"></path></g><g id="icon-chevronSmall" class="tsd-no-select"><path d="M1.5 5.50969L8 11.6609L14.5 5.50969L12.5466 3.66086L8 7.96494L3.45341 3.66086L1.5 5.50969Z" fill="var(--color-icon-text)"></path></g><g id="icon-checkbox" class="tsd-no-select"><rect class="tsd-checkbox-background" width="30" height="30" x="1" y="1" rx="6" fill="none"></rect><path class="tsd-checkbox-checkmark" d="M8.35422 16.8214L13.2143 21.75L24.6458 10.25" stroke="none" stroke-width="3.5" stroke-linejoin="round" fill="none"></path></g><g id="icon-menu" class="tsd-no-select"><rect x="1" y="3" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="7" width="14" height="2" fill="var(--color-icon-text)"></rect><rect x="1" y="11" width="14" height="2" fill="var(--color-icon-text)"></rect></g><g id="icon-search" class="tsd-no-select"><path d="M15.7824 13.833L12.6666 10.7177C12.5259 10.5771 12.3353 10.499 12.1353 10.499H11.6259C12.4884 9.39596 13.001 8.00859 13.001 6.49937C13.001 2.90909 10.0914 0 6.50048 0C2.90959 0 0 2.90909 0 6.49937C0 10.0896 2.90959 12.9987 6.50048 12.9987C8.00996 12.9987 9.39756 12.4863 10.5008 11.6239V12.1332C10.5008 12.3332 10.5789 12.5238 10.7195 12.6644L13.8354 15.7797C14.1292 16.0734 14.6042 16.0734 14.8948 15.7797L15.7793 14.8954C16.0731 14.6017 16.0731 14.1267 15.7824 13.833ZM6.50048 10.499C4.29094 10.499 2.50018 8.71165 2.50018 6.49937C2.50018 4.29021 4.28781 2.49976 6.50048 2.49976C8.71001 2.49976 10.5008 4.28708 10.5008 6.49937C10.5008 8.70852 8.71314 10.499 6.50048 10.499Z" fill="var(--color-icon-text)"></path></g><g id="icon-anchor" class="tsd-no-select"><g stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M10 14a3.5 3.5 0 0 0 5 0l4 -4a3.5 3.5 0 0 0 -5 -5l-.5 .5"></path><path d="M14 10a3.5 3.5 0 0 0 -5 0l-4 4a3.5 3.5 0 0 0 5 5l.5 -.5"></path></g></g><g id="icon-alertNote" class="tsd-no-select"><path fill="var(--color-alert-note)" d="M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></g><g id="icon-alertTip" class="tsd-no-select"><path fill="var(--color-alert-tip)" d="M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z"></path></g><g id="icon-alertImportant" class="tsd-no-select"><path fill="var(--color-alert-important)" d="M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></g><g id="icon-alertWarning" class="tsd-no-select"><path fill="var(--color-alert-warning)" d="M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z"></path></g><g id="icon-alertCaution" class="tsd-no-select"><path fill="var(--color-alert-caution)" d="M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z"></path></g></svg>
|