@riseworks/riseworks-sdk 1.0.4
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/README.md +240 -0
- package/ai-skills/README.md +28 -0
- package/ai-skills/STANDARDS.md +66 -0
- package/ai-skills/references/API_WORKFLOWS.md +200 -0
- package/ai-skills/references/TYPES.md +190 -0
- package/ai-skills/rise-auth-and-setup/README.md +14 -0
- package/ai-skills/rise-auth-and-setup/SKILL.md +57 -0
- package/ai-skills/rise-auth-and-setup/metadata.json +12 -0
- package/ai-skills/rise-auth-and-setup/references/SETUP_PATTERNS.md +26 -0
- package/ai-skills/rise-debugging-and-errors/SKILL.md +51 -0
- package/ai-skills/rise-payments-workflows/README.md +19 -0
- package/ai-skills/rise-payments-workflows/SKILL.md +109 -0
- package/ai-skills/rise-payments-workflows/metadata.json +12 -0
- package/ai-skills/rise-payments-workflows/references/PAYMENT_PATTERNS.md +36 -0
- package/ai-skills/rise-sdk-integration/README.md +25 -0
- package/ai-skills/rise-sdk-integration/SKILL.md +130 -0
- package/ai-skills/rise-sdk-integration/metadata.json +12 -0
- package/ai-skills/rise-sdk-integration/references/PATTERNS.md +28 -0
- package/ai-skills/rise-security-and-approvals/SKILL.md +33 -0
- package/ai-skills/rise-teams-and-invites/README.md +13 -0
- package/ai-skills/rise-teams-and-invites/SKILL.md +66 -0
- package/ai-skills/rise-teams-and-invites/metadata.json +12 -0
- package/ai-skills/rise-teams-and-invites/references/TEAM_PATTERNS.md +25 -0
- package/ai-skills/rise-v1-migration/README.md +22 -0
- package/ai-skills/rise-v1-migration/SKILL.md +184 -0
- package/ai-skills/rise-v1-migration/metadata.json +13 -0
- package/ai-skills/rise-v1-migration/references/ENDPOINT_MAPPINGS.md +72 -0
- package/ai-skills/rise-v1-migration/references/MIGRATION_PATTERNS.md +66 -0
- package/ai-skills/rise-webhooks/README.md +41 -0
- package/ai-skills/rise-webhooks/SKILL.md +143 -0
- package/ai-skills/rise-webhooks/metadata.json +13 -0
- package/ai-skills/rise-webhooks/references/HANDLER.md +60 -0
- package/ai-skills/rise-webhooks/references/REGISTRATION.md +113 -0
- package/dist/index.cjs +1406 -0
- package/dist/index.d.cts +6865 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +6865 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +1383 -0
- package/package.json +87 -0
- package/scripts/add-skills.mjs +158 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rise-sdk-integration
|
|
3
|
+
description: Writes and reviews TypeScript or JavaScript integrations with riseworks-sdk. Use when the user mentions Rise SDK, RiseApiClient, riseworks-sdk, integrating Rise into an app, or asks for teams, invites, payments, bill pay, balances, webhooks, payroll, or company management code.
|
|
4
|
+
compatibility: Node.js, TypeScript or JavaScript. Works with Claude Code, Cursor, Windsurf, Codex.
|
|
5
|
+
metadata:
|
|
6
|
+
author: Rise Works
|
|
7
|
+
version: "1.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Rise SDK Integration
|
|
11
|
+
|
|
12
|
+
## Important: verify against the SDK source
|
|
13
|
+
|
|
14
|
+
**Always read the SDK code** when implementing or reviewing integrations. The SDK package may be updated with new functions, types, and method signatures; the skills and references in this repo can lag behind. Treat the installed `riseworks-sdk` source (e.g. `node_modules/riseworks-sdk` or the package’s TypeScript/API surface) as the source of truth for available methods, request/response types, and behavior.
|
|
15
|
+
|
|
16
|
+
## Decide the mode first
|
|
17
|
+
|
|
18
|
+
- If the user is building application code, use `RiseApiClient` directly.
|
|
19
|
+
- Do not invent or reference a `client.skills.*` layer. That helper layer was removed.
|
|
20
|
+
|
|
21
|
+
## Defaults
|
|
22
|
+
|
|
23
|
+
- Import from `riseworks-sdk`.
|
|
24
|
+
- Prefer TypeScript unless the user asks for another language.
|
|
25
|
+
- Keep `privateKey`, `riseIdAuth`, JWTs, and webhook secrets server-side.
|
|
26
|
+
- Ask for the missing environment, auth method, and relevant nanoids when the task depends on them.
|
|
27
|
+
- If the user is missing a `team_nanoid` or `company_nanoid`, generate the discovery call first (`client.user.getTeams()` or `client.user.getOrganizations()`).
|
|
28
|
+
|
|
29
|
+
## Use the current SDK surface
|
|
30
|
+
|
|
31
|
+
### Auth and identity
|
|
32
|
+
- Setup: `new RiseApiClient({ environment, jwtToken })` or `new RiseApiClient({ environment, riseIdAuth: { riseId, privateKey } })`
|
|
33
|
+
- Current user: `client.me.get()`
|
|
34
|
+
- Manual SIWE: `client.auth.getSiwe({ wallet, riseid })`, `client.auth.verifySiwe({ message, sig, nonce })`
|
|
35
|
+
|
|
36
|
+
### Organizations and teams
|
|
37
|
+
- `client.user.getOrganizations()` — list organizations for the current user
|
|
38
|
+
- `client.user.getTeams()` — list teams for the current user
|
|
39
|
+
- `client.teams.create(data)` — create a team
|
|
40
|
+
- `client.teams.get({ team_nanoid })` — get team details
|
|
41
|
+
- `client.teams.update({ team_nanoid }, data)` — update team info
|
|
42
|
+
- `client.teams.delete({ team_nanoid })` — delete a team
|
|
43
|
+
- `client.teams.getUsers({ team_nanoid })` — list team members
|
|
44
|
+
- `client.teams.removeMember({ team_nanoid, user_nanoid })` — remove a member
|
|
45
|
+
- `client.teams.getMemberSummary({ team_nanoid, user_nanoid })` — member details
|
|
46
|
+
- `client.teams.getSettings({ team_nanoid })` / `client.teams.updateSettings({ team_nanoid }, data)` — team settings
|
|
47
|
+
- `client.teams.getMemberSettings({ team_nanoid, user_nanoid })` / `client.teams.updateMemberSettings({ team_nanoid, user_nanoid }, data)` — member settings
|
|
48
|
+
- `client.company.getUsers({ nanoid })` — list company users
|
|
49
|
+
|
|
50
|
+
### Invites
|
|
51
|
+
- `client.invites.get({ company_nanoid })` — list invites
|
|
52
|
+
- `client.invites.send({ nanoid, invites })` — invite employees/contractors
|
|
53
|
+
- `client.invites.sendManagerInvite({ nanoid, emails, role })` — invite managers (requires `riseIdAuth` or `privateKey`)
|
|
54
|
+
- Manual: `client.invites.getManagerInviteTypedData()` + sign + `client.invites.executeManagerInviteWithSignedData()`
|
|
55
|
+
|
|
56
|
+
### Payments
|
|
57
|
+
- `client.payments.sendPayment({ from, to, pay_now, network })` — automatic (requires `riseIdAuth`)
|
|
58
|
+
- `client.payments.get({ team_nanoid, state, start_date, end_date, query_type })` — list payments
|
|
59
|
+
- Manual flow: `client.payments.getPaymentTypedData(data)` + sign + `client.payments.executePaymentWithSignedData(data)`
|
|
60
|
+
|
|
61
|
+
### Bill pay (external recipients)
|
|
62
|
+
- `client.billPay.createRecipient(data)` — register an external recipient
|
|
63
|
+
- `client.billPay.sendInstantPayment(data)` — send instant payment to external recipient (requires `riseIdAuth`)
|
|
64
|
+
- Manual: `client.billPay.prepareInstantPayment(data)` + sign + `client.billPay.executeInstantPayment(data)`
|
|
65
|
+
|
|
66
|
+
### Balances
|
|
67
|
+
- `client.entityBalance.get({ nanoid })` — get entity balance
|
|
68
|
+
- Withdrawals are not available via the SDK: the withdraw endpoints require reCAPTCHA verification headers only a browser session can produce. Point users to the Rise dashboard for withdrawals.
|
|
69
|
+
|
|
70
|
+
### Payroll
|
|
71
|
+
- `client.payroll.getTeamPayroll({ team_nanoid })` — get payroll details for a team
|
|
72
|
+
|
|
73
|
+
### Webhooks
|
|
74
|
+
- `client.webhooks.list(params)` — list webhook endpoints
|
|
75
|
+
- `client.webhooks.register(data)` — register a new endpoint
|
|
76
|
+
- `client.webhooks.update(webhookNanoid, data)` — update an endpoint
|
|
77
|
+
- `client.webhooks.delete(webhookNanoid)` — delete an endpoint
|
|
78
|
+
- `client.webhooks.test(webhookNanoid, data)` — send a test event
|
|
79
|
+
- `client.webhooks.getDeliveryHistory(webhookNanoid, params)` — delivery history
|
|
80
|
+
- `WebhookValidator` — validate incoming webhook signatures
|
|
81
|
+
|
|
82
|
+
## Types
|
|
83
|
+
|
|
84
|
+
- **API call types**: Prefer exported request/response types for SDK methods instead of hand-written object shapes. Common examples: `RiseApiClientOptions`, `TeamParams`, `CreateTeamRequest`, `GetBalanceRequest`, `GetBalanceResponse`, `CreatePaymentsRequest`, `CreateInstantExternalPaymentRequest`, `PostManagerInvitesRequest`.
|
|
85
|
+
- **Nanoids**: Use branded types for params and responses — `TeamNanoid`, `CompanyNanoid`, `UserNanoid`, `WebhookEndpointNanoid`, `WithdrawAccountNanoid`, etc. — all exported from the SDK.
|
|
86
|
+
- **Responses**: All client methods return `{ data, success }`; use `response.data` for the payload. Type `data` from the method’s return type when using TypeScript.
|
|
87
|
+
- **Webhooks**: Use `RiseWebhookEvent` and event-specific types (`PaymentSentV2`, `DepositReceivedV2`, etc.); narrow by `event.event_type`. For full type list and request/response shapes, see [references/TYPES.md](../references/TYPES.md).
|
|
88
|
+
|
|
89
|
+
## Typed examples
|
|
90
|
+
|
|
91
|
+
- `const config: RiseApiClientOptions = { environment: 'stg', jwtToken }`
|
|
92
|
+
- `const params: TeamParams = { team_nanoid }`
|
|
93
|
+
- `const body: CreateTeamRequest = { ... }`
|
|
94
|
+
- `const payment: CreatePaymentsRequest = { from, to, pay_now: true, network: 'arbitrum' }`
|
|
95
|
+
- `const response: GetBalanceResponse = await client.entityBalance.get({ nanoid })`
|
|
96
|
+
|
|
97
|
+
## API workflow defaults
|
|
98
|
+
|
|
99
|
+
- **Auth/bootstrap**: `client.me.get()` to confirm auth; `client.user.getTeams()` / `client.user.getOrganizations()` to fetch entity context.
|
|
100
|
+
- **Team/member operations**: discover the team first, then use `client.teams.*` or `client.company.getUsers()`.
|
|
101
|
+
- **Payments/bill pay**: choose between automatic flow (`riseIdAuth` or `privateKey`) and manual typed-data flow (`get*TypedData()` -> sign -> `execute*WithSignedData()`).
|
|
102
|
+
- **Webhooks**: receiving endpoints belong in `rise-webhooks`; webhook registration should default to the Rise UI unless the user explicitly wants backend-admin automation.
|
|
103
|
+
|
|
104
|
+
For fuller method-to-type mapping and common SDK flows, see [references/API_WORKFLOWS.md](../references/API_WORKFLOWS.md).
|
|
105
|
+
For broad generation defaults across mixed SDK tasks, see [references/PATTERNS.md](references/PATTERNS.md).
|
|
106
|
+
|
|
107
|
+
## When not to use this skill
|
|
108
|
+
|
|
109
|
+
- User is asking about a different SDK or API (e.g. Stripe, generic REST). Do not trigger for non-Rise integrations.
|
|
110
|
+
- User only needs conceptual explanation of “what is Rise” with no code. Prefer a short answer unless they ask for integration steps.
|
|
111
|
+
|
|
112
|
+
## Example (minimal)
|
|
113
|
+
|
|
114
|
+
```ts
|
|
115
|
+
import { RiseApiClient } from 'riseworks-sdk'
|
|
116
|
+
const client = new RiseApiClient({ environment: 'stg', jwtToken: process.env.RISE_JWT })
|
|
117
|
+
const { data } = await client.user.getTeams()
|
|
118
|
+
const teamNanoid = data?.teams?.[0]?.nanoid
|
|
119
|
+
// use teamNanoid with client.payments.get(), client.teams.getUsers(), etc.
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## Documentation
|
|
123
|
+
|
|
124
|
+
- **Rise B2B API docs**: [https://v2-docs.riseworks.io/](https://v2-docs.riseworks.io/) — Quickstart, Authentication, SDK Installation/Configuration, API Reference, Webhooks. Suggest this when the user needs full reference or step-by-step guides.
|
|
125
|
+
|
|
126
|
+
## Output quality bar
|
|
127
|
+
|
|
128
|
+
- Prefer real SDK code over pseudo-code.
|
|
129
|
+
- Use exported names that exist today in `riseworks-sdk`.
|
|
130
|
+
- For side-effectful flows, call out approval and audit requirements.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.1.0",
|
|
3
|
+
"domain": "sdk-integration",
|
|
4
|
+
"package": "riseworks-sdk",
|
|
5
|
+
"preferredLanguage": "TypeScript",
|
|
6
|
+
"references": [
|
|
7
|
+
"../references/TYPES.md",
|
|
8
|
+
"../references/API_WORKFLOWS.md",
|
|
9
|
+
"references/PATTERNS.md",
|
|
10
|
+
"https://v2-docs.riseworks.io/"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Broad SDK integration patterns
|
|
2
|
+
|
|
3
|
+
Use this reference when the request spans multiple Rise domains or when it is
|
|
4
|
+
not obvious which SDK method to start with.
|
|
5
|
+
|
|
6
|
+
## Generation defaults
|
|
7
|
+
|
|
8
|
+
- Generate `RiseApiClient` setup first when auth is missing.
|
|
9
|
+
- Generate discovery calls first when a `team_nanoid` or `company_nanoid` is missing.
|
|
10
|
+
- Prefer exported request/response types from `riseworks-sdk`.
|
|
11
|
+
- Prefer SDK method calls over raw HTTP.
|
|
12
|
+
- For write flows, mention whether automatic signing (`riseIdAuth`) or manual typed-data signing is required.
|
|
13
|
+
|
|
14
|
+
## Decision rules
|
|
15
|
+
|
|
16
|
+
- **Need current-user or bootstrap context**: use `client.me.get()`.
|
|
17
|
+
- **Need teams**: use `client.user.getTeams()`.
|
|
18
|
+
- **Need organizations/companies**: use `client.user.getOrganizations()`.
|
|
19
|
+
- **Need company users**: use `client.company.getUsers({ nanoid })`.
|
|
20
|
+
- **Need team users**: use `client.teams.getUsers({ team_nanoid })`.
|
|
21
|
+
- **Need payments**: go to the payments methods, and fetch a team first if needed.
|
|
22
|
+
- **Need webhooks**: registration defaults to Rise UI; receiver code uses `WebhookValidator`.
|
|
23
|
+
|
|
24
|
+
## Output quality bar
|
|
25
|
+
|
|
26
|
+
- Generate real SDK code with imports from `riseworks-sdk`.
|
|
27
|
+
- Do not invent helper layers.
|
|
28
|
+
- If the request spans many surfaces, structure the answer in the same order the app would execute the flow.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rise-security-and-approvals
|
|
3
|
+
description: Applies security and approval guidance for Rise SDK integrations. Use when the user is building payment, webhook, or agent workflows and needs safe server-side patterns, approvals, or audit controls.
|
|
4
|
+
compatibility: Any environment. Works with Claude Code, Cursor, Windsurf, Codex.
|
|
5
|
+
metadata:
|
|
6
|
+
author: Rise Works
|
|
7
|
+
version: "1.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Rise Security And Approvals
|
|
11
|
+
|
|
12
|
+
## Apply these guardrails
|
|
13
|
+
|
|
14
|
+
- Keep `privateKey`, `riseIdAuth`, JWTs, and webhook secrets on the server.
|
|
15
|
+
- Never place signing or secret material in browser code.
|
|
16
|
+
- Add approvals or confirmation gates before payments, bill pay, and webhook mutations.
|
|
17
|
+
- Prefer auditable service boundaries for money-moving actions.
|
|
18
|
+
|
|
19
|
+
## Review checklist
|
|
20
|
+
|
|
21
|
+
- Is the code server-side?
|
|
22
|
+
- Are secrets loaded from environment variables or secure storage?
|
|
23
|
+
- Is there an approval step before side effects?
|
|
24
|
+
- Is there enough logging or audit metadata for support and finance review?
|
|
25
|
+
|
|
26
|
+
## Documentation
|
|
27
|
+
|
|
28
|
+
- **Rise B2B API**: [https://v2-docs.riseworks.io/](https://v2-docs.riseworks.io/) — Authentication, Understanding Private Keys, Secondary Wallets, Webhook Security. Suggest when the user asks about key handling or validation.
|
|
29
|
+
|
|
30
|
+
## Output quality bar
|
|
31
|
+
|
|
32
|
+
- When generating code, default to safe server patterns.
|
|
33
|
+
- If the user asks for a browser example involving secrets or signing, warn and redirect to a server implementation.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Rise Teams And Invites Skill
|
|
2
|
+
|
|
3
|
+
Human-facing notes for the `rise-teams-and-invites` skill.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
This skill covers team, organization, member, and invite flows in `riseworks-sdk`.
|
|
8
|
+
|
|
9
|
+
## Extra references
|
|
10
|
+
|
|
11
|
+
- `../references/TYPES.md` — exported team and invite request/response types
|
|
12
|
+
- `../references/API_WORKFLOWS.md` — shared SDK discovery and workflow patterns
|
|
13
|
+
- `references/TEAM_PATTERNS.md` — practical defaults for discovery, CRUD, and invites
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rise-teams-and-invites
|
|
3
|
+
description: Implements organization, team, member, and invite flows with riseworks-sdk. Use when the user mentions organizations, teams, members, invites, contractors, employees, admins, or manager invites in Rise.
|
|
4
|
+
compatibility: Node.js, TypeScript or JavaScript. Works with Claude Code, Cursor, Windsurf, Codex.
|
|
5
|
+
metadata:
|
|
6
|
+
author: Rise Works
|
|
7
|
+
version: "1.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Rise Teams And Invites
|
|
11
|
+
|
|
12
|
+
**Note:** Always read the installed `riseworks-sdk` source when implementing—the SDK may have new functions or types not yet reflected in this skill.
|
|
13
|
+
|
|
14
|
+
## Pick the right scope
|
|
15
|
+
|
|
16
|
+
- Organization discovery: `client.user.getOrganizations()`.
|
|
17
|
+
- Team discovery: `client.user.getTeams()`.
|
|
18
|
+
- Team CRUD: `client.teams.create(data)`, `client.teams.get({ team_nanoid })`, `client.teams.update({ team_nanoid }, data)`, `client.teams.delete({ team_nanoid })`.
|
|
19
|
+
- Team settings: `client.teams.getSettings({ team_nanoid })`, `client.teams.updateSettings({ team_nanoid }, data)`.
|
|
20
|
+
- Team members: `client.teams.getUsers({ team_nanoid })`, `client.teams.getMemberSummary({ team_nanoid, user_nanoid })`, `client.teams.removeMember({ team_nanoid, user_nanoid })`.
|
|
21
|
+
- Member settings: `client.teams.getMemberSettings({ team_nanoid, user_nanoid })`, `client.teams.updateMemberSettings({ team_nanoid, user_nanoid }, data)`.
|
|
22
|
+
- Company users: `client.company.getUsers({ nanoid })`.
|
|
23
|
+
- List invites: `client.invites.get({ company_nanoid })`.
|
|
24
|
+
- Member invites: `client.invites.send({ nanoid, invites })`.
|
|
25
|
+
- Manager invites: `client.invites.sendManagerInvite({ nanoid, emails, role })` (requires `riseIdAuth` or `privateKey`).
|
|
26
|
+
- Manual manager invite: `client.invites.getManagerInviteTypedData(data)` + sign + `client.invites.executeManagerInviteWithSignedData(data)`.
|
|
27
|
+
|
|
28
|
+
## Inputs to confirm
|
|
29
|
+
|
|
30
|
+
- Whether the action is organization-scoped or team-scoped
|
|
31
|
+
- The target nanoid (team nanoid or company nanoid)
|
|
32
|
+
- The invite role
|
|
33
|
+
- The invitee emails and any known prefill data
|
|
34
|
+
- Whether the user wants discovery/listing, team CRUD, member management, or invites
|
|
35
|
+
|
|
36
|
+
## Notes on signing
|
|
37
|
+
|
|
38
|
+
- `sendManagerInvite()` uses EIP-712 signing internally; the client must be initialized with `riseIdAuth` or the caller must supply `privateKey`.
|
|
39
|
+
- Regular `invites.send()` for employees and contractors does not require signing.
|
|
40
|
+
|
|
41
|
+
## Types
|
|
42
|
+
|
|
43
|
+
- Use `TeamParams` and `TeamUserParams` for route params.
|
|
44
|
+
- Use `CreateTeamRequest`, `UpdateTeamRequest`, `GetTeamResponse`, `GetTeamUsersResponse`, `GetTeamSettingsResponse`, `UpdateTeamSettingsRequest` for typed team flows.
|
|
45
|
+
- Use `GetInvitesRequest`, `GetInvitesResponse`, `PostInvitesRequest`, `PostInvitesResponse`, `PostManagerInvitesRequest`, and `PostManagerInvitesResponse` for invite flows.
|
|
46
|
+
- Use branded nanoid types (`TeamNanoid`, `CompanyNanoid`, `UserNanoid`, `InviteNanoid`) for params and stored identifiers.
|
|
47
|
+
|
|
48
|
+
## API workflow defaults
|
|
49
|
+
|
|
50
|
+
- If the user needs a `team_nanoid`, start with `client.user.getTeams()`.
|
|
51
|
+
- If the user needs a `company_nanoid`, start with `client.user.getOrganizations()`.
|
|
52
|
+
- For regular member invites, prefer `client.invites.send()` first.
|
|
53
|
+
- Only use manager invite signing flows when the requested role actually requires it.
|
|
54
|
+
|
|
55
|
+
For fuller SDK workflow guidance, see [references/API_WORKFLOWS.md](../references/API_WORKFLOWS.md).
|
|
56
|
+
For team and invite decision rules, see [references/TEAM_PATTERNS.md](references/TEAM_PATTERNS.md).
|
|
57
|
+
|
|
58
|
+
## Documentation
|
|
59
|
+
|
|
60
|
+
- **Rise B2B API**: [https://v2-docs.riseworks.io/](https://v2-docs.riseworks.io/) — Team Management, Core Concepts (roles, RBAC), API Reference. Suggest when the user needs role definitions or org/team structure details.
|
|
61
|
+
|
|
62
|
+
## Output quality bar
|
|
63
|
+
|
|
64
|
+
- Use the exact Rise role values required by the SDK.
|
|
65
|
+
- Prefer direct SDK calls over pseudo-helper abstractions.
|
|
66
|
+
- If a workflow changes permissions or membership, mention review and audit expectations.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.1.0",
|
|
3
|
+
"domain": "teams-invites",
|
|
4
|
+
"package": "riseworks-sdk",
|
|
5
|
+
"preferredLanguage": "TypeScript",
|
|
6
|
+
"references": [
|
|
7
|
+
"../references/TYPES.md",
|
|
8
|
+
"../references/API_WORKFLOWS.md",
|
|
9
|
+
"references/TEAM_PATTERNS.md",
|
|
10
|
+
"https://v2-docs.riseworks.io/"
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Team and invite patterns
|
|
2
|
+
|
|
3
|
+
Use this reference when the user needs discovery, CRUD, membership, or invite logic.
|
|
4
|
+
|
|
5
|
+
## Default flow selection
|
|
6
|
+
|
|
7
|
+
- **Need team context**: `client.user.getTeams()`
|
|
8
|
+
- **Need organization/company context**: `client.user.getOrganizations()`
|
|
9
|
+
- **Need company users**: `client.company.getUsers({ nanoid })`
|
|
10
|
+
- **Need team members**: `client.teams.getUsers({ team_nanoid })`
|
|
11
|
+
- **Need team CRUD**: `client.teams.create/get/update/delete`
|
|
12
|
+
- **Need regular invites**: `client.invites.send()`
|
|
13
|
+
- **Need manager/admin invites**: `client.invites.sendManagerInvite()` or manual typed-data flow
|
|
14
|
+
|
|
15
|
+
## Invite rules
|
|
16
|
+
|
|
17
|
+
- Default to regular invites when the role does not require signing.
|
|
18
|
+
- Use manager invite flows only for roles that need EIP-712 signing.
|
|
19
|
+
- Mention whether the operation is team-scoped or company-scoped.
|
|
20
|
+
|
|
21
|
+
## Output quality bar
|
|
22
|
+
|
|
23
|
+
- Generate discovery calls when the user does not already have the required nanoid.
|
|
24
|
+
- Use branded nanoid types where possible.
|
|
25
|
+
- Call out permission and review implications when membership or admin roles change.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Rise V1 Migration Skill
|
|
2
|
+
|
|
3
|
+
Human-facing notes for the `rise-v1-migration` skill.
|
|
4
|
+
|
|
5
|
+
## Purpose
|
|
6
|
+
|
|
7
|
+
This skill helps migrate legacy Rise V1 integrations to the B2B API and
|
|
8
|
+
`riseworks-sdk`.
|
|
9
|
+
|
|
10
|
+
It is meant for cases where the existing code still uses:
|
|
11
|
+
|
|
12
|
+
- direct `/v1/...` HTTP calls
|
|
13
|
+
- numeric IDs like `teamId` and `talentId`
|
|
14
|
+
- old SIWE/auth wrappers
|
|
15
|
+
- legacy payment, invite, balance, or webhook logic
|
|
16
|
+
|
|
17
|
+
## Extra references
|
|
18
|
+
|
|
19
|
+
- `../references/TYPES.md` — exported SDK types used in migrated code
|
|
20
|
+
- `../references/API_WORKFLOWS.md` — shared end-to-end SDK workflows
|
|
21
|
+
- `references/MIGRATION_PATTERNS.md` — migration rollout order and decision rules
|
|
22
|
+
- `references/ENDPOINT_MAPPINGS.md` — concrete V1 to B2B mappings
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rise-v1-migration
|
|
3
|
+
description: Migrates legacy Rise V1 API code to the B2B v2 API. V1 had no SDK—only direct HTTP to /v1/ endpoints. Use when the user mentions migration, legacy Rise code, /v1 endpoints, numeric IDs, or moving to B2B.
|
|
4
|
+
compatibility: Node.js, TypeScript or JavaScript. Works with Claude Code, Cursor, Windsurf, Codex.
|
|
5
|
+
metadata:
|
|
6
|
+
author: Rise Works
|
|
7
|
+
version: "1.0"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Rise V1 Migration
|
|
11
|
+
|
|
12
|
+
**Note:** Always read the installed `riseworks-sdk` source when implementing—the SDK may have new functions or types not yet reflected in this skill.
|
|
13
|
+
|
|
14
|
+
## Migration mindset
|
|
15
|
+
|
|
16
|
+
- Treat this as **V1 HTTP -> B2B SDK or `/v2` HTTP**, not "old SDK -> new SDK". V1 had no SDK.
|
|
17
|
+
- Preserve behavior first, then improve ergonomics with B2B-only features.
|
|
18
|
+
- Prefer `RiseApiClient` unless the user explicitly wants raw HTTP examples.
|
|
19
|
+
- When the user only shows old endpoints, infer the closest B2B workflow and state any assumptions.
|
|
20
|
+
|
|
21
|
+
## Classify the migration first
|
|
22
|
+
|
|
23
|
+
- **Auth bootstrap**: old SIWE endpoints or custom auth wrapper.
|
|
24
|
+
- **Teams and members**: old `teamId` / `talentId` paths.
|
|
25
|
+
- **Payments**: old pay or batch-pay endpoints.
|
|
26
|
+
- **Balances**: old riseId-based balance lookup.
|
|
27
|
+
- **Invites**: employee/contractor or manager invite flows.
|
|
28
|
+
- **Webhooks**: old webhook payload format, verification, or event names.
|
|
29
|
+
- **Mixed legacy service**: a wrapper class touching several V1 areas.
|
|
30
|
+
|
|
31
|
+
## Default migration rules
|
|
32
|
+
|
|
33
|
+
- Replace numeric IDs and `teamId` / `talentId` terminology with nanoids.
|
|
34
|
+
- Update auth to `jwtToken` or `riseIdAuth`.
|
|
35
|
+
- Replace V1 response handling with B2B `{ success, data }`.
|
|
36
|
+
- For signing flows, prefer automatic SDK methods when `riseIdAuth` or `privateKey` is available.
|
|
37
|
+
- If only JWT is available, switch to typed-data flow (`get*TypedData()` -> sign -> `execute*WithSignedData()`).
|
|
38
|
+
- If the required `team_nanoid`, `company_nanoid`, or `user_nanoid` is missing, generate discovery calls first.
|
|
39
|
+
|
|
40
|
+
## Types
|
|
41
|
+
|
|
42
|
+
- Prefer exported request/response types from `riseworks-sdk` instead of anonymous objects.
|
|
43
|
+
- Use branded nanoid types (`TeamNanoid`, `CompanyNanoid`, `UserNanoid`) where possible.
|
|
44
|
+
- Type client setup with `RiseApiClientOptions`.
|
|
45
|
+
- For migration output that includes payments, invites, or balances, use the matching request/response types from [references/TYPES.md](../references/TYPES.md).
|
|
46
|
+
|
|
47
|
+
## Migration phases
|
|
48
|
+
|
|
49
|
+
### 1. Inventory the V1 surface
|
|
50
|
+
|
|
51
|
+
- Identify every `/v1/...` path still in use.
|
|
52
|
+
- Identify whether the old code is read-only, side-effectful, or signing-related.
|
|
53
|
+
- Record what identifiers the old code currently has: numeric IDs, `rise_id`, wallet address, JWT, etc.
|
|
54
|
+
|
|
55
|
+
### 2. Rebuild auth first
|
|
56
|
+
|
|
57
|
+
- V1 auth code using `GET /v1/api/siwe` + `POST /v1/api/siwe` should become:
|
|
58
|
+
- `new RiseApiClient({ environment, riseIdAuth: { riseId, privateKey } })` for SDK-managed auth, or
|
|
59
|
+
- `client.auth.getSiwe({ wallet, riseid })` + `client.auth.verifySiwe({ message, sig, nonce })` for manual SIWE.
|
|
60
|
+
- If the application already has a valid JWT, initialize with `new RiseApiClient({ environment, jwtToken })`.
|
|
61
|
+
|
|
62
|
+
### 3. Replace identifiers
|
|
63
|
+
|
|
64
|
+
- `teamId` -> `team_nanoid`
|
|
65
|
+
- `talentId` / legacy user references -> `user_nanoid`
|
|
66
|
+
- riseId-based entity lookup often becomes a B2B discovery step followed by a nanoid-based SDK call
|
|
67
|
+
|
|
68
|
+
### 4. Swap endpoint logic for SDK flows
|
|
69
|
+
|
|
70
|
+
### Teams and members
|
|
71
|
+
|
|
72
|
+
- `GET /v1/teams` -> `client.user.getTeams()`
|
|
73
|
+
- `GET /v1/teams/{teamId}/talent` -> `client.teams.getUsers({ team_nanoid })`
|
|
74
|
+
- `GET /v1/teams/{teamId}/talent/{talentId}` -> `client.teams.getMemberSummary({ team_nanoid, user_nanoid })`
|
|
75
|
+
- `DELETE /v1/teams/{teamId}/talent/{talentId}` -> `client.teams.removeMember({ team_nanoid, user_nanoid })`
|
|
76
|
+
|
|
77
|
+
### Payments
|
|
78
|
+
|
|
79
|
+
- `POST /v1/payments/pay`
|
|
80
|
+
- `POST /v1/payments/batch-pay`
|
|
81
|
+
- `PUT /v1/payments/pay`
|
|
82
|
+
- `PUT /v1/payments/batch-pay`
|
|
83
|
+
-> automatic: `client.payments.sendPayment({ from, to, pay_now, network })`
|
|
84
|
+
-> manual: `client.payments.getPaymentTypedData()` + sign + `client.payments.executePaymentWithSignedData()`
|
|
85
|
+
|
|
86
|
+
- `GET /v1/payments/` -> `client.payments.get({ team_nanoid, state, start_date, end_date, query_type })`
|
|
87
|
+
|
|
88
|
+
### Balances
|
|
89
|
+
|
|
90
|
+
- `GET /v1/riseid/{rise_id}/balance` -> `client.entityBalance.get({ nanoid })`
|
|
91
|
+
|
|
92
|
+
### Invites
|
|
93
|
+
|
|
94
|
+
- `GET /v1/invites/` -> `client.invites.get({ company_nanoid })`
|
|
95
|
+
- `POST /v1/invites/` for employees/contractors -> `client.invites.send({ nanoid, invites })`
|
|
96
|
+
- `POST /v1/invites/` for managers -> automatic: `client.invites.sendManagerInvite({ nanoid, emails, role })`
|
|
97
|
+
- Manager invite manual flow -> `client.invites.getManagerInviteTypedData()` + sign + `client.invites.executeManagerInviteWithSignedData()`
|
|
98
|
+
|
|
99
|
+
### Webhooks
|
|
100
|
+
|
|
101
|
+
- Old webhook migrations belong partly here and partly in `rise-webhooks`.
|
|
102
|
+
- For receiver code, use `WebhookValidator` and `RiseWebhookEvent`.
|
|
103
|
+
- For payload/event-name changes, see `references/ENDPOINT_MAPPINGS.md` and the webhook migration docs.
|
|
104
|
+
|
|
105
|
+
### 5. Update response and error handling
|
|
106
|
+
|
|
107
|
+
- V1 code may have consumed raw arrays or endpoint-specific JSON.
|
|
108
|
+
- B2B SDK calls return `{ success, data }`; use `response.data`.
|
|
109
|
+
- When rewriting raw HTTP to raw `/v2` HTTP, preserve the B2B response envelope in the examples.
|
|
110
|
+
|
|
111
|
+
## New B2B-only features
|
|
112
|
+
|
|
113
|
+
- Team CRUD: `client.teams.create()`, `client.teams.update()`, `client.teams.delete()`
|
|
114
|
+
- Team and member settings
|
|
115
|
+
- Organizations via `client.user.getOrganizations()`
|
|
116
|
+
- Bill pay, payroll, webhooks, and richer typed flows
|
|
117
|
+
|
|
118
|
+
## API workflow defaults
|
|
119
|
+
|
|
120
|
+
- **Bootstrap**: `client.me.get()` then `client.user.getTeams()` / `client.user.getOrganizations()` when the migrated code needs entity context.
|
|
121
|
+
- **Teams**: discover the team first, then move to `client.teams.*`.
|
|
122
|
+
- **Payments/invites**: choose automatic methods when signing material exists, otherwise use typed-data flows.
|
|
123
|
+
- **Webhooks**: migrate event handling and validation separately from webhook registration.
|
|
124
|
+
|
|
125
|
+
For general SDK call sequences, see [references/API_WORKFLOWS.md](../references/API_WORKFLOWS.md).
|
|
126
|
+
For migration decision rules and rollout order, see [references/MIGRATION_PATTERNS.md](references/MIGRATION_PATTERNS.md).
|
|
127
|
+
For concrete V1 -> B2B mappings, see [references/ENDPOINT_MAPPINGS.md](references/ENDPOINT_MAPPINGS.md).
|
|
128
|
+
|
|
129
|
+
## Documentation
|
|
130
|
+
|
|
131
|
+
- **Rise B2B API**: [https://v2-docs.riseworks.io/](https://v2-docs.riseworks.io/) — Quickstart, Core Concepts, Authentication, SDK, API Reference.
|
|
132
|
+
- **Migration guide**: `/guides/migrating-from-v1` in the docs.
|
|
133
|
+
- **Webhook migration guide**: `/webhooks/reference/migration` when the legacy integration includes webhooks.
|
|
134
|
+
|
|
135
|
+
## Migration checklist
|
|
136
|
+
|
|
137
|
+
1. Inventory every `/v1/...` path and any numeric IDs still flowing through the code.
|
|
138
|
+
2. Rebuild auth with `jwtToken` or `riseIdAuth`.
|
|
139
|
+
3. Replace numeric IDs with nanoids and add discovery calls where needed.
|
|
140
|
+
4. Replace V1 endpoint logic with `RiseApiClient` methods or `/v2/...` HTTP.
|
|
141
|
+
5. Update response handling to `{ success, data }`.
|
|
142
|
+
6. Revisit signing flows for payments, manager invites, and other typed-data operations.
|
|
143
|
+
7. If webhooks are involved, migrate payload handling and signature verification separately.
|
|
144
|
+
8. Only after parity is achieved, adopt B2B-only features.
|
|
145
|
+
|
|
146
|
+
## Common edge cases
|
|
147
|
+
|
|
148
|
+
- **No nanoids yet**: do not fake a conversion from numeric IDs; generate discovery calls or ask how the app will map old IDs to B2B entities.
|
|
149
|
+
- **JWT-only environment**: use manual typed-data flows for operations that cannot use automatic signing.
|
|
150
|
+
- **Behavioral drift risk**: preserve the original business behavior before adopting new B2B-only features or cleaner abstractions.
|
|
151
|
+
- **Response shape mismatch**: update reads from raw arrays or direct fields to `response.data`.
|
|
152
|
+
- **Webhook confusion**: migrating webhook receivers is not the same as programmatic webhook registration.
|
|
153
|
+
- **Mixed legacy wrapper**: if one service touches teams, invites, and payments, split the migration by domain and keep shared auth/bootstrap code separate.
|
|
154
|
+
|
|
155
|
+
## When not to use this skill
|
|
156
|
+
|
|
157
|
+
- User is not migrating from Rise V1 (e.g. first-time integration or migrating from another provider). Use rise-sdk-integration instead.
|
|
158
|
+
- User only asks what B2B is with no migration intent.
|
|
159
|
+
|
|
160
|
+
## Example migration pattern
|
|
161
|
+
|
|
162
|
+
**V1 (no SDK):** `fetch(baseUrl + '/v1/teams/' + teamId + '/talent', { headers: { Authorization: 'Bearer ' + jwt } })`
|
|
163
|
+
|
|
164
|
+
**B2B (SDK):**
|
|
165
|
+
|
|
166
|
+
```ts
|
|
167
|
+
const client = new RiseApiClient({ environment: 'stg', jwtToken })
|
|
168
|
+
const teams = await client.user.getTeams()
|
|
169
|
+
const teamNanoid = teams.data?.teams?.[0]?.nanoid
|
|
170
|
+
|
|
171
|
+
if (!teamNanoid) {
|
|
172
|
+
throw new Error('No team_nanoid found for migrated member lookup')
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const members = await client.teams.getUsers({ team_nanoid: teamNanoid })
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Output quality bar
|
|
179
|
+
|
|
180
|
+
- Prefer B2B SDK code over raw fetch when the user is on Node/TS.
|
|
181
|
+
- Show the migration in terms of old behavior -> new SDK flow.
|
|
182
|
+
- Use real SDK methods and exported types that exist today in `riseworks-sdk`.
|
|
183
|
+
- When the old code is ambiguous, preserve behavior first and call out assumptions.
|
|
184
|
+
- Do not imply V1 had an SDK; frame migration as “V1 HTTP → B2B (SDK or v2 HTTP)”.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "1.1.0",
|
|
3
|
+
"domain": "migration",
|
|
4
|
+
"package": "riseworks-sdk",
|
|
5
|
+
"preferredLanguage": "TypeScript",
|
|
6
|
+
"references": [
|
|
7
|
+
"../references/TYPES.md",
|
|
8
|
+
"../references/API_WORKFLOWS.md",
|
|
9
|
+
"references/MIGRATION_PATTERNS.md",
|
|
10
|
+
"references/ENDPOINT_MAPPINGS.md",
|
|
11
|
+
"https://v2-docs.riseworks.io/"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# V1 to B2B endpoint mappings
|
|
2
|
+
|
|
3
|
+
Use this reference when the user shows legacy endpoint names or old wrapper
|
|
4
|
+
methods and needs the closest B2B replacement.
|
|
5
|
+
|
|
6
|
+
## Authentication
|
|
7
|
+
|
|
8
|
+
- `GET /v1/api/siwe` -> `client.auth.getSiwe({ wallet, riseid })` or
|
|
9
|
+
`GET /v2/auth/siwe`
|
|
10
|
+
- `POST /v1/api/siwe` -> `client.auth.verifySiwe({ message, sig, nonce })` or
|
|
11
|
+
`POST /v2/auth/verify`
|
|
12
|
+
- SDK-managed auth -> `new RiseApiClient({ environment, riseIdAuth })`
|
|
13
|
+
|
|
14
|
+
## Teams and members
|
|
15
|
+
|
|
16
|
+
- `GET /v1/teams` -> `client.user.getTeams()` or `GET /v2/user/teams`
|
|
17
|
+
- `GET /v1/teams/{teamId}/talent` -> `client.teams.getUsers({ team_nanoid })`
|
|
18
|
+
or `GET /v2/teams/{team_nanoid}/users`
|
|
19
|
+
- `GET /v1/teams/{teamId}/talent/{talentId}` ->
|
|
20
|
+
`client.teams.getMemberSummary({ team_nanoid, user_nanoid })` or
|
|
21
|
+
`GET /v2/teams/{team_nanoid}/member/{user_nanoid}/summary`
|
|
22
|
+
- `DELETE /v1/teams/{teamId}/talent/{talentId}` ->
|
|
23
|
+
`client.teams.removeMember({ team_nanoid, user_nanoid })` or
|
|
24
|
+
`DELETE /v2/teams/{team_nanoid}/member/{user_nanoid}`
|
|
25
|
+
|
|
26
|
+
## Payments
|
|
27
|
+
|
|
28
|
+
- `POST /v1/payments/pay` -> `client.payments.sendPayment()` or
|
|
29
|
+
`POST /v2/payments` + `PUT /v2/payments`
|
|
30
|
+
- `PUT /v1/payments/pay` -> `client.payments.sendPayment()` or
|
|
31
|
+
`POST /v2/payments` + `PUT /v2/payments`
|
|
32
|
+
- `POST /v1/payments/batch-pay` -> `client.payments.sendPayment()` or
|
|
33
|
+
`POST /v2/payments` + `PUT /v2/payments`
|
|
34
|
+
- `PUT /v1/payments/batch-pay` -> `client.payments.sendPayment()` or
|
|
35
|
+
`POST /v2/payments` + `PUT /v2/payments`
|
|
36
|
+
- `POST /v1/payments/batch-pay/intents` ->
|
|
37
|
+
`client.payments.getPaymentTypedData()` + sign +
|
|
38
|
+
`client.payments.executePaymentWithSignedData()`
|
|
39
|
+
- `GET /v1/payments/` -> `client.payments.get()` or `GET /v2/payments`
|
|
40
|
+
|
|
41
|
+
## Balances
|
|
42
|
+
|
|
43
|
+
- `GET /v1/riseid/{rise_id}/balance` -> `client.entityBalance.get({ nanoid })`
|
|
44
|
+
or `GET /v2/balance?nanoid={nanoid}`
|
|
45
|
+
|
|
46
|
+
## Invites
|
|
47
|
+
|
|
48
|
+
- `GET /v1/invites/` -> `client.invites.get({ company_nanoid })` or
|
|
49
|
+
`GET /v2/invites`
|
|
50
|
+
- `POST /v1/invites/` for employee/contractor invites ->
|
|
51
|
+
`client.invites.send({ nanoid, invites })` or `POST /v2/invites`
|
|
52
|
+
- `POST /v1/invites/` for manager invites ->
|
|
53
|
+
`client.invites.sendManagerInvite({ nanoid, emails, role })` or
|
|
54
|
+
`POST /v2/invites/manager` + `PUT /v2/invites/manager`
|
|
55
|
+
|
|
56
|
+
## Webhooks
|
|
57
|
+
|
|
58
|
+
- v1 event envelope -> v2 `RiseWebhookEvent` envelope
|
|
59
|
+
- v1 public-key verification -> v2 HMAC validation via `WebhookValidator`
|
|
60
|
+
- v1 event types:
|
|
61
|
+
- `deposit.deposit_received` -> `deposit.received`
|
|
62
|
+
- `payment.payment_sent` -> `payment.sent`
|
|
63
|
+
- `pay_schedules.pay_schedule_created` -> `payment.group.created`
|
|
64
|
+
- `invites.invite_accepted` -> `invite.accepted`
|
|
65
|
+
- `account_duplicated.detected` -> `withdraw_account.duplicated_detected`
|
|
66
|
+
|
|
67
|
+
## Notes
|
|
68
|
+
|
|
69
|
+
- Prefer SDK methods in migration output when the user is already in a JS/TS
|
|
70
|
+
codebase.
|
|
71
|
+
- When the user explicitly wants HTTP mappings, keep the `/v2/...` equivalents
|
|
72
|
+
beside the SDK methods.
|