@sylphx/management 0.1.0 → 0.2.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/CHANGELOG.md +88 -0
- package/LICENSE +21 -0
- package/README.md +157 -101
- package/dist/admin.d.ts +141 -0
- package/dist/admin.d.ts.map +1 -0
- package/dist/admin.js +96 -0
- package/dist/adminBootstrap.d.ts +46 -0
- package/dist/adminBootstrap.d.ts.map +1 -0
- package/dist/adminBootstrap.js +33 -0
- package/dist/adminBuilds.d.ts +72 -0
- package/dist/adminBuilds.d.ts.map +1 -0
- package/dist/adminBuilds.js +29 -0
- package/dist/adminEnvServices.d.ts +41 -0
- package/dist/adminEnvServices.d.ts.map +1 -0
- package/dist/adminEnvServices.js +22 -0
- package/dist/adminRateLimits.d.ts +61 -0
- package/dist/adminRateLimits.d.ts.map +1 -0
- package/dist/adminRateLimits.js +44 -0
- package/dist/adminReconcile.d.ts +45 -0
- package/dist/adminReconcile.d.ts.map +1 -0
- package/dist/adminReconcile.js +20 -0
- package/dist/adminResources.d.ts +97 -0
- package/dist/adminResources.d.ts.map +1 -0
- package/dist/adminResources.js +40 -0
- package/dist/adminSecrets.d.ts +60 -0
- package/dist/adminSecrets.d.ts.map +1 -0
- package/dist/adminSecrets.js +43 -0
- package/dist/adminTenants.d.ts +41 -0
- package/dist/adminTenants.d.ts.map +1 -0
- package/dist/adminTenants.js +29 -0
- package/dist/ai.d.ts +148 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/ai.js +29 -0
- package/dist/analytics.d.ts +49 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/analytics.js +23 -0
- package/dist/auth.d.ts +39 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/auth.js +27 -0
- package/dist/authSettings.d.ts +71 -0
- package/dist/authSettings.d.ts.map +1 -0
- package/dist/authSettings.js +39 -0
- package/dist/backups.d.ts +66 -0
- package/dist/backups.d.ts.map +1 -0
- package/dist/backups.js +32 -0
- package/dist/billing.d.ts +105 -0
- package/dist/billing.d.ts.map +1 -0
- package/dist/billing.js +42 -0
- package/dist/billingSettings.d.ts +78 -0
- package/dist/billingSettings.d.ts.map +1 -0
- package/dist/billingSettings.js +54 -0
- package/dist/branchDatabases.d.ts +53 -0
- package/dist/branchDatabases.d.ts.map +1 -0
- package/dist/branchDatabases.js +38 -0
- package/dist/certs.d.ts +63 -0
- package/dist/certs.d.ts.map +1 -0
- package/dist/certs.js +28 -0
- package/dist/ciSettings.d.ts +77 -0
- package/dist/ciSettings.d.ts.map +1 -0
- package/dist/ciSettings.js +41 -0
- package/dist/client.d.ts +36 -38
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +32 -90
- package/dist/consent.d.ts +111 -0
- package/dist/consent.d.ts.map +1 -0
- package/dist/consent.js +35 -0
- package/dist/databases.d.ts +17 -0
- package/dist/databases.d.ts.map +1 -0
- package/dist/databases.js +32 -0
- package/dist/deployments.d.ts +22 -0
- package/dist/deployments.d.ts.map +1 -0
- package/dist/deployments.js +39 -0
- package/dist/domains.d.ts +26 -0
- package/dist/domains.d.ts.map +1 -0
- package/dist/domains.js +39 -0
- package/dist/edgeDeployments.d.ts +43 -0
- package/dist/edgeDeployments.d.ts.map +1 -0
- package/dist/edgeDeployments.js +32 -0
- package/dist/email.d.ts +45 -0
- package/dist/email.d.ts.map +1 -0
- package/dist/email.js +21 -0
- package/dist/engagement.d.ts +100 -0
- package/dist/engagement.d.ts.map +1 -0
- package/dist/engagement.js +28 -0
- package/dist/envVars.d.ts +17 -0
- package/dist/envVars.d.ts.map +1 -0
- package/dist/envVars.js +34 -0
- package/dist/environments.d.ts +41 -0
- package/dist/environments.d.ts.map +1 -0
- package/dist/environments.js +54 -0
- package/dist/errors.d.ts +8 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +8 -2
- package/dist/experiments.d.ts +80 -0
- package/dist/experiments.d.ts.map +1 -0
- package/dist/experiments.js +23 -0
- package/dist/flags.d.ts +85 -0
- package/dist/flags.d.ts.map +1 -0
- package/dist/flags.js +25 -0
- package/dist/functions.d.ts +39 -0
- package/dist/functions.d.ts.map +1 -0
- package/dist/functions.js +40 -0
- package/dist/github.d.ts +33 -0
- package/dist/github.d.ts.map +1 -0
- package/dist/github.js +22 -0
- package/dist/http.d.ts +28 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +71 -0
- package/dist/index.d.ts +85 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +86 -20
- package/dist/kv.d.ts +66 -0
- package/dist/kv.d.ts.map +1 -0
- package/dist/kv.js +36 -0
- package/dist/logs.d.ts +14 -0
- package/dist/logs.d.ts.map +1 -0
- package/dist/logs.js +17 -0
- package/dist/management.d.ts +55 -0
- package/dist/management.d.ts.map +1 -0
- package/dist/management.js +31 -0
- package/dist/monitoring.d.ts +65 -0
- package/dist/monitoring.d.ts.map +1 -0
- package/dist/monitoring.js +29 -0
- package/dist/newsletter.d.ts +279 -0
- package/dist/newsletter.d.ts.map +1 -0
- package/dist/newsletter.js +98 -0
- package/dist/notifications.d.ts +30 -0
- package/dist/notifications.d.ts.map +1 -0
- package/dist/notifications.js +19 -0
- package/dist/oidc.d.ts +46 -0
- package/dist/oidc.d.ts.map +1 -0
- package/dist/oidc.js +25 -0
- package/dist/organizations.d.ts +24 -0
- package/dist/organizations.d.ts.map +1 -0
- package/dist/organizations.js +42 -0
- package/dist/plans.d.ts +66 -0
- package/dist/plans.d.ts.map +1 -0
- package/dist/plans.js +42 -0
- package/dist/privacy.d.ts +138 -0
- package/dist/privacy.d.ts.map +1 -0
- package/dist/privacy.js +41 -0
- package/dist/projects.d.ts +14 -0
- package/dist/projects.d.ts.map +1 -0
- package/dist/projects.js +22 -0
- package/dist/realtime.d.ts +33 -0
- package/dist/realtime.d.ts.map +1 -0
- package/dist/realtime.js +19 -0
- package/dist/referrals.d.ts +100 -0
- package/dist/referrals.d.ts.map +1 -0
- package/dist/referrals.js +33 -0
- package/dist/refresh.d.ts +44 -0
- package/dist/refresh.d.ts.map +1 -0
- package/dist/refresh.js +33 -0
- package/dist/remoteConfig.d.ts +15 -0
- package/dist/remoteConfig.d.ts.map +1 -0
- package/dist/remoteConfig.js +35 -0
- package/dist/resourceBindings.d.ts +19 -0
- package/dist/resourceBindings.d.ts.map +1 -0
- package/dist/resourceBindings.js +24 -0
- package/dist/runners.d.ts +60 -0
- package/dist/runners.d.ts.map +1 -0
- package/dist/runners.js +17 -0
- package/dist/saml.d.ts +44 -0
- package/dist/saml.d.ts.map +1 -0
- package/dist/saml.js +77 -0
- package/dist/sandboxes.d.ts +15 -0
- package/dist/sandboxes.d.ts.map +1 -0
- package/dist/sandboxes.js +18 -0
- package/dist/search.d.ts +66 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +29 -0
- package/dist/secrets.d.ts +50 -0
- package/dist/secrets.d.ts.map +1 -0
- package/dist/secrets.js +61 -0
- package/dist/security.d.ts +58 -0
- package/dist/security.d.ts.map +1 -0
- package/dist/security.js +49 -0
- package/dist/serviceTokenRequests.d.ts +71 -0
- package/dist/serviceTokenRequests.d.ts.map +1 -0
- package/dist/serviceTokenRequests.js +43 -0
- package/dist/serviceTokens.d.ts +65 -0
- package/dist/serviceTokens.d.ts.map +1 -0
- package/dist/serviceTokens.js +22 -0
- package/dist/services.d.ts +10 -0
- package/dist/services.d.ts.map +1 -0
- package/dist/services.js +15 -0
- package/dist/sessionReplay.d.ts +116 -0
- package/dist/sessionReplay.d.ts.map +1 -0
- package/dist/sessionReplay.js +29 -0
- package/dist/storage.d.ts +12 -0
- package/dist/storage.d.ts.map +1 -0
- package/dist/storage.js +10 -0
- package/dist/tasks.d.ts +29 -0
- package/dist/tasks.d.ts.map +1 -0
- package/dist/tasks.js +29 -0
- package/dist/types.d.ts +59 -155
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +17 -3
- package/dist/user.d.ts +99 -0
- package/dist/user.d.ts.map +1 -0
- package/dist/user.js +58 -0
- package/dist/users.d.ts +9 -0
- package/dist/users.d.ts.map +1 -0
- package/dist/users.js +11 -0
- package/dist/volumes.d.ts +16 -0
- package/dist/volumes.d.ts.map +1 -0
- package/dist/volumes.js +9 -0
- package/dist/webhooks.d.ts +77 -0
- package/dist/webhooks.d.ts.map +1 -0
- package/dist/webhooks.js +27 -0
- package/package.json +194 -5
- package/dist/request.d.ts +0 -5
- package/dist/request.d.ts.map +0 -1
- package/dist/request.js +0 -1
- package/dist/resources/config.d.ts +0 -30
- package/dist/resources/config.d.ts.map +0 -1
- package/dist/resources/config.js +0 -62
- package/dist/resources/databases.d.ts +0 -26
- package/dist/resources/databases.d.ts.map +0 -1
- package/dist/resources/databases.js +0 -29
- package/dist/resources/deployments.d.ts +0 -24
- package/dist/resources/deployments.d.ts.map +0 -1
- package/dist/resources/deployments.js +0 -30
- package/dist/resources/domains.d.ts +0 -30
- package/dist/resources/domains.d.ts.map +0 -1
- package/dist/resources/domains.js +0 -46
- package/dist/resources/env-vars.d.ts +0 -19
- package/dist/resources/env-vars.d.ts.map +0 -1
- package/dist/resources/env-vars.js +0 -30
- package/dist/resources/environments.d.ts +0 -16
- package/dist/resources/environments.d.ts.map +0 -1
- package/dist/resources/environments.js +0 -24
- package/dist/resources/logs.d.ts +0 -13
- package/dist/resources/logs.d.ts.map +0 -1
- package/dist/resources/logs.js +0 -20
- package/dist/resources/org.d.ts +0 -15
- package/dist/resources/org.d.ts.map +0 -1
- package/dist/resources/org.js +0 -25
- package/dist/resources/projects.d.ts +0 -19
- package/dist/resources/projects.d.ts.map +0 -1
- package/dist/resources/projects.js +0 -19
- package/dist/resources/resources.d.ts +0 -26
- package/dist/resources/resources.d.ts.map +0 -1
- package/dist/resources/resources.js +0 -32
- package/dist/resources/services.d.ts +0 -21
- package/dist/resources/services.d.ts.map +0 -1
- package/dist/resources/services.js +0 -30
- package/dist/resources/storage.d.ts +0 -21
- package/dist/resources/storage.d.ts.map +0 -1
- package/dist/resources/storage.js +0 -25
- package/dist/resources/tasks.d.ts +0 -42
- package/dist/resources/tasks.d.ts.map +0 -1
- package/dist/resources/tasks.js +0 -49
- package/dist/resources/user.d.ts +0 -9
- package/dist/resources/user.d.ts.map +0 -1
- package/dist/resources/user.js +0 -10
- package/dist/resources/volumes.d.ts +0 -20
- package/dist/resources/volumes.d.ts.map +0 -1
- package/dist/resources/volumes.js +0 -19
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Newsletter — subscribers, automation sequences, steps, enrollments.
|
|
3
|
+
*
|
|
4
|
+
* All routes mount under `/newsletter` in the Platform API.
|
|
5
|
+
*
|
|
6
|
+
* Subscribers
|
|
7
|
+
* GET /newsletter/subscribers — list
|
|
8
|
+
* GET /newsletter/subscribers/by-email — by email
|
|
9
|
+
* GET /newsletter/subscribers/preferences — preferences by email
|
|
10
|
+
* GET /newsletter/subscribers/export — CSV export
|
|
11
|
+
* GET /newsletter/subscribers/stats — aggregate stats
|
|
12
|
+
* DELETE /newsletter/subscribers — GDPR delete
|
|
13
|
+
* POST /newsletter/subscribers/bulk-delete
|
|
14
|
+
* POST /newsletter/subscribers/resend-verification
|
|
15
|
+
*
|
|
16
|
+
* Sequences (automation workflows)
|
|
17
|
+
* GET /newsletter/sequences
|
|
18
|
+
* GET /newsletter/sequences/:sequenceId
|
|
19
|
+
* POST /newsletter/sequences
|
|
20
|
+
* PATCH /newsletter/sequences/:sequenceId
|
|
21
|
+
* DELETE /newsletter/sequences/:sequenceId
|
|
22
|
+
* GET /newsletter/sequences/:sequenceId/analytics
|
|
23
|
+
*
|
|
24
|
+
* Steps (inside sequences)
|
|
25
|
+
* POST /newsletter/steps
|
|
26
|
+
* PATCH /newsletter/steps/:stepId
|
|
27
|
+
* DELETE /newsletter/steps/:stepId
|
|
28
|
+
* POST /newsletter/steps/reorder
|
|
29
|
+
*
|
|
30
|
+
* Enrollments (subscribers inside sequences)
|
|
31
|
+
* GET /newsletter/enrollments
|
|
32
|
+
* GET /newsletter/enrollments/:enrollmentId
|
|
33
|
+
* POST /newsletter/enrollments
|
|
34
|
+
* POST /newsletter/enrollments/:enrollmentId/cancel
|
|
35
|
+
* POST /newsletter/enrollments/:enrollmentId/pause
|
|
36
|
+
* POST /newsletter/enrollments/:enrollmentId/resume
|
|
37
|
+
*
|
|
38
|
+
* `SubscriberPreferences` is returned as an object keyed on preference ID;
|
|
39
|
+
* the service stores the underlying rows as an array but flattens for wire.
|
|
40
|
+
*/
|
|
41
|
+
import { request } from './http.js';
|
|
42
|
+
export const listSubscribers = (client, options) => request(client, 'GET', '/newsletter/subscribers', {
|
|
43
|
+
query: {
|
|
44
|
+
projectId: options?.projectId,
|
|
45
|
+
verified: options?.verified !== undefined ? String(options.verified) : undefined,
|
|
46
|
+
source: options?.source,
|
|
47
|
+
search: options?.search,
|
|
48
|
+
includeUnsubscribed: options?.includeUnsubscribed !== undefined
|
|
49
|
+
? String(options.includeUnsubscribed)
|
|
50
|
+
: undefined,
|
|
51
|
+
limit: options?.limit !== undefined ? String(options.limit) : undefined,
|
|
52
|
+
offset: options?.offset !== undefined ? String(options.offset) : undefined,
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
export const getSubscriber = (client, email) => request(client, 'GET', '/newsletter/subscribers/by-email', { query: { email } });
|
|
56
|
+
export const getPreferences = (client, email) => request(client, 'GET', '/newsletter/subscribers/preferences', { query: { email } });
|
|
57
|
+
export const exportSubscribers = (client, options) => request(client, 'GET', '/newsletter/subscribers/export', {
|
|
58
|
+
query: {
|
|
59
|
+
verified: options?.verified !== undefined ? String(options.verified) : undefined,
|
|
60
|
+
includeUnsubscribed: options?.includeUnsubscribed !== undefined
|
|
61
|
+
? String(options.includeUnsubscribed)
|
|
62
|
+
: undefined,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
export const subscriberStats = (client) => request(client, 'GET', '/newsletter/subscribers/stats');
|
|
66
|
+
export const deleteSubscriber = (client, email) => request(client, 'DELETE', '/newsletter/subscribers', { body: { email } });
|
|
67
|
+
export const bulkDeleteSubscribers = (client, input) => request(client, 'POST', '/newsletter/subscribers/bulk-delete', { body: input });
|
|
68
|
+
export const resendVerification = (client, email) => request(client, 'POST', '/newsletter/subscribers/resend-verification', { body: { email } });
|
|
69
|
+
export const listSequences = (client, projectId, options) => request(client, 'GET', '/newsletter/sequences', {
|
|
70
|
+
query: {
|
|
71
|
+
projectId,
|
|
72
|
+
includeInactive: options?.includeInactive !== undefined ? String(options.includeInactive) : undefined,
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
export const getSequence = (client, sequenceId) => request(client, 'GET', `/newsletter/sequences/${encodeURIComponent(sequenceId)}`);
|
|
76
|
+
export const createSequence = (client, input) => request(client, 'POST', '/newsletter/sequences', { body: input });
|
|
77
|
+
export const updateSequence = (client, sequenceId, input) => request(client, 'PATCH', `/newsletter/sequences/${encodeURIComponent(sequenceId)}`, {
|
|
78
|
+
body: input,
|
|
79
|
+
});
|
|
80
|
+
export const deleteSequence = (client, sequenceId) => request(client, 'DELETE', `/newsletter/sequences/${encodeURIComponent(sequenceId)}`);
|
|
81
|
+
export const sequenceAnalytics = (client, sequenceId) => request(client, 'GET', `/newsletter/sequences/${encodeURIComponent(sequenceId)}/analytics`);
|
|
82
|
+
export const addStep = (client, input) => request(client, 'POST', '/newsletter/steps', { body: input });
|
|
83
|
+
export const updateStep = (client, stepId, input) => request(client, 'PATCH', `/newsletter/steps/${encodeURIComponent(stepId)}`, { body: input });
|
|
84
|
+
export const deleteStep = (client, stepId) => request(client, 'DELETE', `/newsletter/steps/${encodeURIComponent(stepId)}`);
|
|
85
|
+
export const reorderSteps = (client, sequenceId, stepOrder) => request(client, 'POST', '/newsletter/steps/reorder', { body: { sequenceId, stepOrder } });
|
|
86
|
+
export const listEnrollments = (client, sequenceId, options) => request(client, 'GET', '/newsletter/enrollments', {
|
|
87
|
+
query: {
|
|
88
|
+
sequenceId,
|
|
89
|
+
status: options?.status,
|
|
90
|
+
limit: options?.limit !== undefined ? String(options.limit) : undefined,
|
|
91
|
+
offset: options?.offset !== undefined ? String(options.offset) : undefined,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
export const getEnrollment = (client, enrollmentId) => request(client, 'GET', `/newsletter/enrollments/${encodeURIComponent(enrollmentId)}`);
|
|
95
|
+
export const enrollSubscriber = (client, input) => request(client, 'POST', '/newsletter/enrollments', { body: input });
|
|
96
|
+
export const cancelEnrollment = (client, enrollmentId) => request(client, 'POST', `/newsletter/enrollments/${encodeURIComponent(enrollmentId)}/cancel`);
|
|
97
|
+
export const pauseEnrollment = (client, enrollmentId) => request(client, 'POST', `/newsletter/enrollments/${encodeURIComponent(enrollmentId)}/pause`);
|
|
98
|
+
export const resumeEnrollment = (client, enrollmentId) => request(client, 'POST', `/newsletter/enrollments/${encodeURIComponent(enrollmentId)}/resume`);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End-user notifications — admin surface (in-app inbox reader).
|
|
3
|
+
*
|
|
4
|
+
* GET /notifications/in-app/messages?appId=&userId=&channel=&limit=
|
|
5
|
+
*
|
|
6
|
+
* The runtime `send` verb (push / in-app / mobile dispatch) lives in
|
|
7
|
+
* `@sylphx/sdk` per ADR-083 (BaaS data plane). Push / mobile deliveries
|
|
8
|
+
* land on the device and are not mirrored in the platform store; this
|
|
9
|
+
* endpoint returns in-app inbox entries only.
|
|
10
|
+
*/
|
|
11
|
+
import type { Client } from './client.js';
|
|
12
|
+
export interface InboxEntry {
|
|
13
|
+
readonly id: string;
|
|
14
|
+
readonly userId: string | null;
|
|
15
|
+
readonly title: string | null;
|
|
16
|
+
readonly body: string | null;
|
|
17
|
+
readonly channel: string;
|
|
18
|
+
readonly status: string;
|
|
19
|
+
readonly createdAt: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ListInboxOptions {
|
|
22
|
+
readonly appId: string;
|
|
23
|
+
readonly userId?: string;
|
|
24
|
+
readonly channel?: string;
|
|
25
|
+
readonly limit?: number;
|
|
26
|
+
}
|
|
27
|
+
export declare const listInbox: (client: Client, options: ListInboxOptions) => Promise<{
|
|
28
|
+
notifications: readonly InboxEntry[];
|
|
29
|
+
}>;
|
|
30
|
+
//# sourceMappingURL=notifications.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../src/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,eAAO,MAAM,SAAS,GACrB,QAAQ,MAAM,EACd,SAAS,gBAAgB,KACvB,OAAO,CAAC;IAAE,aAAa,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,CAQhD,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* End-user notifications — admin surface (in-app inbox reader).
|
|
3
|
+
*
|
|
4
|
+
* GET /notifications/in-app/messages?appId=&userId=&channel=&limit=
|
|
5
|
+
*
|
|
6
|
+
* The runtime `send` verb (push / in-app / mobile dispatch) lives in
|
|
7
|
+
* `@sylphx/sdk` per ADR-083 (BaaS data plane). Push / mobile deliveries
|
|
8
|
+
* land on the device and are not mirrored in the platform store; this
|
|
9
|
+
* endpoint returns in-app inbox entries only.
|
|
10
|
+
*/
|
|
11
|
+
import { request } from './http.js';
|
|
12
|
+
export const listInbox = (client, options) => request(client, 'GET', '/notifications/in-app/messages', {
|
|
13
|
+
query: {
|
|
14
|
+
appId: options.appId,
|
|
15
|
+
userId: options.userId,
|
|
16
|
+
channel: options.channel,
|
|
17
|
+
limit: options.limit !== undefined ? String(options.limit) : undefined,
|
|
18
|
+
},
|
|
19
|
+
});
|
package/dist/oidc.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OIDC trust policies (ADR-059 §4) — federate CI providers into Sylphx
|
|
3
|
+
* service-token minting without long-lived shared secrets.
|
|
4
|
+
*
|
|
5
|
+
* GET /projects/:id/oidc-policies
|
|
6
|
+
* POST /projects/:id/oidc-policies
|
|
7
|
+
* DELETE /projects/:id/oidc-policies/:policyId
|
|
8
|
+
*
|
|
9
|
+
* Supported providers: github-actions, gitlab-ci, bitbucket-pipelines,
|
|
10
|
+
* custom. Each policy pins an issuer + subject pattern + allowed scope
|
|
11
|
+
* set; tokens exchanged through the policy inherit exactly those scopes.
|
|
12
|
+
*/
|
|
13
|
+
import type { Client } from './client.js';
|
|
14
|
+
export type OidcProvider = 'github-actions' | 'gitlab-ci' | 'bitbucket-pipelines' | 'custom';
|
|
15
|
+
export declare const SUPPORTED_PROVIDERS: readonly OidcProvider[];
|
|
16
|
+
export interface OidcPolicy {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly projectId: string;
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly provider: string;
|
|
21
|
+
readonly issuer: string;
|
|
22
|
+
readonly audience: string | null;
|
|
23
|
+
readonly subjectPattern: string;
|
|
24
|
+
readonly allowedScopes: readonly string[];
|
|
25
|
+
readonly isActive: boolean;
|
|
26
|
+
readonly createdBy: string | null;
|
|
27
|
+
readonly createdAt: string;
|
|
28
|
+
readonly updatedAt: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const list: (client: Client, projectId: string) => Promise<{
|
|
31
|
+
policies: readonly OidcPolicy[];
|
|
32
|
+
}>;
|
|
33
|
+
export interface CreateInput {
|
|
34
|
+
readonly name: string;
|
|
35
|
+
readonly provider: OidcProvider;
|
|
36
|
+
readonly issuer: string;
|
|
37
|
+
readonly subjectPattern: string;
|
|
38
|
+
readonly allowedScopes: readonly string[];
|
|
39
|
+
readonly audience?: string | null;
|
|
40
|
+
}
|
|
41
|
+
export declare const create: (client: Client, projectId: string, input: CreateInput) => Promise<OidcPolicy>;
|
|
42
|
+
declare const _delete: (client: Client, projectId: string, policyId: string) => Promise<{
|
|
43
|
+
deleted: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
export { _delete as delete };
|
|
46
|
+
//# sourceMappingURL=oidc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oidc.d.ts","sourceRoot":"","sources":["../src/oidc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,MAAM,MAAM,YAAY,GAAG,gBAAgB,GAAG,WAAW,GAAG,qBAAqB,GAAG,QAAQ,CAAA;AAE5F,eAAO,MAAM,mBAAmB,EAAE,SAAS,YAAY,EAK7C,CAAA;AAEV,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAChC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|
+
* GET /projects/:id/oidc-policies
|
|
6
|
+
* POST /projects/:id/oidc-policies
|
|
7
|
+
* DELETE /projects/:id/oidc-policies/:policyId
|
|
8
|
+
*
|
|
9
|
+
* Supported providers: github-actions, gitlab-ci, bitbucket-pipelines,
|
|
10
|
+
* custom. Each policy pins an issuer + subject pattern + allowed scope
|
|
11
|
+
* set; tokens exchanged through the policy inherit exactly those scopes.
|
|
12
|
+
*/
|
|
13
|
+
import { request } from './http.js';
|
|
14
|
+
export const SUPPORTED_PROVIDERS = [
|
|
15
|
+
'github-actions',
|
|
16
|
+
'gitlab-ci',
|
|
17
|
+
'bitbucket-pipelines',
|
|
18
|
+
'custom',
|
|
19
|
+
];
|
|
20
|
+
export const list = (client, projectId) => request(client, 'GET', `/projects/${encodeURIComponent(projectId)}/oidc-policies`);
|
|
21
|
+
export const create = (client, projectId, input) => request(client, 'POST', `/projects/${encodeURIComponent(projectId)}/oidc-policies`, {
|
|
22
|
+
body: { audience: null, ...input },
|
|
23
|
+
});
|
|
24
|
+
const _delete = (client, projectId, policyId) => request(client, 'DELETE', `/projects/${encodeURIComponent(projectId)}/oidc-policies/${encodeURIComponent(policyId)}`);
|
|
25
|
+
export { _delete as delete };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organizations — current org + members management.
|
|
3
|
+
*
|
|
4
|
+
* Wire shape sourced from `@sylphx/contract` (ADR-084).
|
|
5
|
+
*/
|
|
6
|
+
import type { Organization as Org, OrgMember, OrgMemberRole, UpdateMemberRoleResult } from '@sylphx/contract';
|
|
7
|
+
import type { Client } from './client.js';
|
|
8
|
+
export type { OrgMemberRole, UpdateMemberRoleResult };
|
|
9
|
+
export declare const current: (client: Client) => Promise<Org>;
|
|
10
|
+
export declare const listMembers: (client: Client, orgId: string) => Promise<OrgMember[]>;
|
|
11
|
+
export declare const inviteMember: (client: Client, orgId: string, email: string, role: "admin" | "member") => Promise<void>;
|
|
12
|
+
export declare const removeMember: (client: Client, orgId: string, userId: string) => Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Update an organization member's role. Caller must be `admin` or `super_admin`.
|
|
15
|
+
*
|
|
16
|
+
* Server enforces:
|
|
17
|
+
* - Cannot change your own role (use another admin) — 403
|
|
18
|
+
* - Only super_admins can promote to / change a super_admin — 403
|
|
19
|
+
* - Cannot demote the last admin (org must retain ≥1 admin/super_admin) — 403
|
|
20
|
+
*
|
|
21
|
+
* Idempotent: setting a member's current role returns success without an audit row.
|
|
22
|
+
*/
|
|
23
|
+
export declare const updateMemberRole: (client: Client, orgId: string, userId: string, role: OrgMemberRole) => Promise<UpdateMemberRoleResult>;
|
|
24
|
+
//# sourceMappingURL=organizations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../src/organizations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACX,YAAY,IAAI,GAAG,EACnB,SAAS,EACT,aAAa,EACb,sBAAsB,EACtB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,YAAY,EAAE,aAAa,EAAE,sBAAsB,EAAE,CAAA;AAErD,eAAO,MAAM,OAAO,GAAI,QAAQ,MAAM,KAAG,OAAO,CAAC,GAAG,CAGnD,CAAA;AAED,eAAO,MAAM,WAAW,GAAU,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,SAAS,EAAE,CAQpF,CAAA;AAED,eAAO,MAAM,YAAY,GACxB,QAAQ,MAAM,EACd,OAAO,MAAM,EACb,OAAO,MAAM,EACb,MAAM,OAAO,GAAG,QAAQ,KACtB,OAAO,CAAC,IAAI,CAKd,CAAA;AAED,eAAO,MAAM,YAAY,GAAI,QAAQ,MAAM,EAAE,OAAO,MAAM,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC,IAAI,CAGxF,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,gBAAgB,GAC5B,QAAQ,MAAM,EACd,OAAO,MAAM,EACb,QAAQ,MAAM,EACd,MAAM,aAAa,KACjB,OAAO,CAAC,sBAAsB,CAKhC,CAAA"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Organizations — current org + members management.
|
|
3
|
+
*
|
|
4
|
+
* Wire shape sourced from `@sylphx/contract` (ADR-084).
|
|
5
|
+
*/
|
|
6
|
+
import { organizationsEndpoints } from '@sylphx/contract';
|
|
7
|
+
import { interpolatePath, request } from './http.js';
|
|
8
|
+
export const current = (client) => {
|
|
9
|
+
const { method, path } = organizationsEndpoints.current;
|
|
10
|
+
return request(client, method, path);
|
|
11
|
+
};
|
|
12
|
+
export const listMembers = async (client, orgId) => {
|
|
13
|
+
const { method, path } = organizationsEndpoints.listMembers;
|
|
14
|
+
const res = await request(client, method, interpolatePath(path, { orgId }));
|
|
15
|
+
return Array.isArray(res) ? res : (res.members ?? []);
|
|
16
|
+
};
|
|
17
|
+
export const inviteMember = async (client, orgId, email, role) => {
|
|
18
|
+
const { method, path } = organizationsEndpoints.inviteMember;
|
|
19
|
+
await request(client, method, interpolatePath(path, { orgId }), {
|
|
20
|
+
body: { email, role },
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
export const removeMember = (client, orgId, userId) => {
|
|
24
|
+
const { method, path } = organizationsEndpoints.removeMember;
|
|
25
|
+
return request(client, method, interpolatePath(path, { orgId, userId }));
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Update an organization member's role. Caller must be `admin` or `super_admin`.
|
|
29
|
+
*
|
|
30
|
+
* Server enforces:
|
|
31
|
+
* - Cannot change your own role (use another admin) — 403
|
|
32
|
+
* - Only super_admins can promote to / change a super_admin — 403
|
|
33
|
+
* - Cannot demote the last admin (org must retain ≥1 admin/super_admin) — 403
|
|
34
|
+
*
|
|
35
|
+
* Idempotent: setting a member's current role returns success without an audit row.
|
|
36
|
+
*/
|
|
37
|
+
export const updateMemberRole = (client, orgId, userId, role) => {
|
|
38
|
+
const { method, path } = organizationsEndpoints.updateMemberRole;
|
|
39
|
+
return request(client, method, interpolatePath(path, { orgId, userId }), {
|
|
40
|
+
body: { role },
|
|
41
|
+
});
|
|
42
|
+
};
|
package/dist/plans.d.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plans — per-project subscription plan CRUD + Stripe sync.
|
|
3
|
+
*
|
|
4
|
+
* GET /plans/projects/:id/plans — list plans for project
|
|
5
|
+
* GET /plans/projects/:id/plans/:planId — get plan
|
|
6
|
+
* POST /plans/plans — create
|
|
7
|
+
* PATCH /plans/plans/:planId — update
|
|
8
|
+
* DELETE /plans/plans/:planId — delete
|
|
9
|
+
* POST /plans/plans/:planId/sync-stripe — push to Stripe
|
|
10
|
+
* POST /plans/plans/reorder — reorder display
|
|
11
|
+
*/
|
|
12
|
+
import type { Client } from './client.js';
|
|
13
|
+
export interface Plan {
|
|
14
|
+
readonly id: string;
|
|
15
|
+
readonly projectId: string;
|
|
16
|
+
readonly name: string;
|
|
17
|
+
readonly slug: string;
|
|
18
|
+
readonly priceUsdCents: number;
|
|
19
|
+
readonly intervalDays: number;
|
|
20
|
+
readonly stripePriceId: string | null;
|
|
21
|
+
readonly features: readonly string[];
|
|
22
|
+
readonly displayOrder: number;
|
|
23
|
+
readonly archivedAt: string | null;
|
|
24
|
+
readonly createdAt: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const list: (client: Client, projectId: string) => Promise<{
|
|
27
|
+
plans: readonly Plan[];
|
|
28
|
+
}>;
|
|
29
|
+
export declare const get: (client: Client, projectId: string, planId: string) => Promise<{
|
|
30
|
+
plan: Plan;
|
|
31
|
+
}>;
|
|
32
|
+
export interface CreatePlanInput {
|
|
33
|
+
readonly projectId: string;
|
|
34
|
+
readonly name: string;
|
|
35
|
+
readonly slug: string;
|
|
36
|
+
readonly priceUsdCents: number;
|
|
37
|
+
readonly intervalDays?: number;
|
|
38
|
+
readonly features?: readonly string[];
|
|
39
|
+
}
|
|
40
|
+
export declare const create: (client: Client, body: CreatePlanInput) => Promise<{
|
|
41
|
+
plan: Plan;
|
|
42
|
+
}>;
|
|
43
|
+
export interface UpdatePlanInput {
|
|
44
|
+
readonly name?: string;
|
|
45
|
+
readonly priceUsdCents?: number;
|
|
46
|
+
readonly intervalDays?: number;
|
|
47
|
+
readonly features?: readonly string[];
|
|
48
|
+
readonly archived?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare const update: (client: Client, planId: string, body: UpdatePlanInput) => Promise<{
|
|
51
|
+
plan: Plan;
|
|
52
|
+
}>;
|
|
53
|
+
declare const _delete: (client: Client, planId: string) => Promise<{
|
|
54
|
+
success: boolean;
|
|
55
|
+
}>;
|
|
56
|
+
export { _delete as delete };
|
|
57
|
+
export declare const syncStripe: (client: Client, planId: string) => Promise<{
|
|
58
|
+
plan: Plan;
|
|
59
|
+
stripePriceId: string;
|
|
60
|
+
}>;
|
|
61
|
+
export declare const reorder: (client: Client, body: {
|
|
62
|
+
readonly order: readonly string[];
|
|
63
|
+
}) => Promise<{
|
|
64
|
+
success: boolean;
|
|
65
|
+
}>;
|
|
66
|
+
//# sourceMappingURL=plans.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plans.d.ts","sourceRoot":"","sources":["../src/plans.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,MAAM,WAAW,IAAI;IACpB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,YAAY,EAAE,M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EAAE,CAAA;IACrC,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAC3B;AAED,eAAO,MAAM,MAAM,GAClB,QAAQ,MAAM,EACd,QAAQ,MAAM,EACd,MAAM,eAAe,KACnB,OAAO,CAAC;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAGxB,CAAA;AAED,QAAA,MAAM,OAAO,GAAI,QAAQ,MAAM,EAAE,QAAQ,MAAM,KAAG,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAG7E,CAAA;AACD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAA;AAE5B,eAAO,MAAM,UAAU,GACtB,QAAQ,MAAM,EACd,QAAQ,MAAM,KACZ,OAAO,CAAC;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,CAG/C,CAAA;AAED,eAAO,MAAM,OAAO,GACnB,QAAQ,MAAM,EACd,MAAM;IAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,KACzC,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,CAG9B,CAAA"}
|
package/dist/plans.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Plans — per-project subscription plan CRUD + Stripe sync.
|
|
3
|
+
*
|
|
4
|
+
* GET /plans/projects/:id/plans — list plans for project
|
|
5
|
+
* GET /plans/projects/:id/plans/:planId — get plan
|
|
6
|
+
* POST /plans/plans — create
|
|
7
|
+
* PATCH /plans/plans/:planId — update
|
|
8
|
+
* DELETE /plans/plans/:planId — delete
|
|
9
|
+
* POST /plans/plans/:planId/sync-stripe — push to Stripe
|
|
10
|
+
* POST /plans/plans/reorder — reorder display
|
|
11
|
+
*/
|
|
12
|
+
import { plansEndpoints } from '@sylphx/contract';
|
|
13
|
+
import { interpolatePath, request } from './http.js';
|
|
14
|
+
export const list = (client, projectId) => {
|
|
15
|
+
const { method, path } = plansEndpoints.list;
|
|
16
|
+
return request(client, method, interpolatePath(path, { id: projectId }));
|
|
17
|
+
};
|
|
18
|
+
export const get = (client, projectId, planId) => {
|
|
19
|
+
const { method, path } = plansEndpoints.get;
|
|
20
|
+
return request(client, method, interpolatePath(path, { id: projectId, planId }));
|
|
21
|
+
};
|
|
22
|
+
export const create = (client, body) => {
|
|
23
|
+
const { method, path } = plansEndpoints.create;
|
|
24
|
+
return request(client, method, path, { body });
|
|
25
|
+
};
|
|
26
|
+
export const update = (client, planId, body) => {
|
|
27
|
+
const { method, path } = plansEndpoints.update;
|
|
28
|
+
return request(client, method, interpolatePath(path, { planId }), { body });
|
|
29
|
+
};
|
|
30
|
+
const _delete = (client, planId) => {
|
|
31
|
+
const { method, path } = plansEndpoints.delete;
|
|
32
|
+
return request(client, method, interpolatePath(path, { planId }));
|
|
33
|
+
};
|
|
34
|
+
export { _delete as delete };
|
|
35
|
+
export const syncStripe = (client, planId) => {
|
|
36
|
+
const { method, path } = plansEndpoints.syncStripe;
|
|
37
|
+
return request(client, method, interpolatePath(path, { planId }));
|
|
38
|
+
};
|
|
39
|
+
export const reorder = (client, body) => {
|
|
40
|
+
const { method, path } = plansEndpoints.reorder;
|
|
41
|
+
return request(client, method, path, { body });
|
|
42
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Privacy — automated cookie discovery + consent mapping for GDPR / CCPA.
|
|
3
|
+
*
|
|
4
|
+
* POST /privacy/scans — start scan
|
|
5
|
+
* GET /privacy/projects/:id/scans — list scans
|
|
6
|
+
* GET /privacy/projects/:id/scans/:scanId — get report
|
|
7
|
+
* GET /privacy/projects/:id/cookies — list detected cookies
|
|
8
|
+
* GET /privacy/projects/:id/summary — aggregate summary
|
|
9
|
+
* PATCH /privacy/projects/:id/cookies/:cookieId/category — recategorize
|
|
10
|
+
* PATCH /privacy/projects/:id/cookies/:cookieId/consent-type — (un)link consent type
|
|
11
|
+
* POST /privacy/cookies/bulk-link — bulk category → consent
|
|
12
|
+
* POST /privacy/known-cookies/seed — admin: seed reference DB
|
|
13
|
+
*
|
|
14
|
+
* Project path parameters accept TypeID OR slug (handled server-side via
|
|
15
|
+
* `getProjectByIdOrSlugWithAccess`); the SDK intentionally does not narrow.
|
|
16
|
+
*/
|
|
17
|
+
import type { Client } from './client.js';
|
|
18
|
+
export type CookieCategory = 'necessary' | 'analytics' | 'marketing' | 'preferences' | 'functional' | 'unknown';
|
|
19
|
+
export type CookieParty = 'first_party' | 'third_party';
|
|
20
|
+
export type ScanStatus = 'pending' | 'running' | 'completed' | 'failed';
|
|
21
|
+
export interface StartScanInput {
|
|
22
|
+
readonly projectId: string;
|
|
23
|
+
readonly url: string;
|
|
24
|
+
readonly maxPages?: number;
|
|
25
|
+
readonly includeSubdomains?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface StartScanResult {
|
|
28
|
+
readonly scanId: string;
|
|
29
|
+
readonly status: ScanStatus;
|
|
30
|
+
readonly message: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const startScan: (client: Client, input: StartScanInput) => Promise<StartScanResult>;
|
|
33
|
+
export interface ScanReport {
|
|
34
|
+
readonly id: string;
|
|
35
|
+
readonly url: string;
|
|
36
|
+
readonly status: ScanStatus;
|
|
37
|
+
readonly pagesCrawled: number | null;
|
|
38
|
+
readonly totalCookies: number | null;
|
|
39
|
+
readonly firstPartyCookies: number | null;
|
|
40
|
+
readonly thirdPartyCookies: number | null;
|
|
41
|
+
readonly categoryCounts: Readonly<Record<string, number>> | null;
|
|
42
|
+
readonly error: string | null;
|
|
43
|
+
readonly startedAt: string | null;
|
|
44
|
+
readonly completedAt: string | null;
|
|
45
|
+
readonly durationMs: number | null;
|
|
46
|
+
readonly createdAt: string;
|
|
47
|
+
}
|
|
48
|
+
export declare const getScan: (client: Client, projectIdOrSlug: string, scanId: string) => Promise<ScanReport>;
|
|
49
|
+
export interface ScanSummary {
|
|
50
|
+
readonly id: string;
|
|
51
|
+
readonly url: string;
|
|
52
|
+
readonly status: ScanStatus;
|
|
53
|
+
readonly totalCookies: number | null;
|
|
54
|
+
readonly completedAt: string | null;
|
|
55
|
+
readonly createdAt: string;
|
|
56
|
+
}
|
|
57
|
+
export interface ListScansOptions {
|
|
58
|
+
readonly status?: ScanStatus;
|
|
59
|
+
readonly limit?: number;
|
|
60
|
+
readonly offset?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface ListScansResult {
|
|
63
|
+
readonly scans: readonly ScanSummary[];
|
|
64
|
+
readonly total: number;
|
|
65
|
+
readonly limit: number;
|
|
66
|
+
readonly offset: number;
|
|
67
|
+
}
|
|
68
|
+
export declare const listScans: (client: Client, projectIdOrSlug: string, options?: ListScansOptions) => Promise<ListScansResult>;
|
|
69
|
+
export interface DetectedCookie {
|
|
70
|
+
readonly id: string;
|
|
71
|
+
readonly name: string;
|
|
72
|
+
readonly domain: string;
|
|
73
|
+
readonly path: string | null;
|
|
74
|
+
readonly party: CookieParty;
|
|
75
|
+
readonly category: CookieCategory;
|
|
76
|
+
readonly expirationSeconds: number | null;
|
|
77
|
+
readonly isSession: boolean;
|
|
78
|
+
readonly isSecure: boolean;
|
|
79
|
+
readonly isHttpOnly: boolean;
|
|
80
|
+
readonly sameSite: string | null;
|
|
81
|
+
readonly provider: string | null;
|
|
82
|
+
readonly description: string | null;
|
|
83
|
+
readonly consentTypeId: string | null;
|
|
84
|
+
readonly createdAt: string;
|
|
85
|
+
}
|
|
86
|
+
export interface ListCookiesOptions {
|
|
87
|
+
readonly scanId?: string;
|
|
88
|
+
readonly category?: CookieCategory;
|
|
89
|
+
readonly party?: CookieParty;
|
|
90
|
+
readonly search?: string;
|
|
91
|
+
readonly limit?: number;
|
|
92
|
+
readonly offset?: number;
|
|
93
|
+
}
|
|
94
|
+
export interface ListCookiesResult {
|
|
95
|
+
readonly cookies: readonly DetectedCookie[];
|
|
96
|
+
readonly total: number;
|
|
97
|
+
readonly limit: number;
|
|
98
|
+
readonly offset: number;
|
|
99
|
+
}
|
|
100
|
+
export declare const listCookies: (client: Client, projectIdOrSlug: string, options?: ListCookiesOptions) => Promise<ListCookiesResult>;
|
|
101
|
+
export interface CookieScanSummary {
|
|
102
|
+
readonly totalScans: number;
|
|
103
|
+
readonly lastScanAt: string | null;
|
|
104
|
+
readonly totalCookiesDetected: number;
|
|
105
|
+
readonly byCategoryCount: Readonly<Record<string, number>>;
|
|
106
|
+
readonly byPartyCount: Readonly<Record<string, number>>;
|
|
107
|
+
readonly unmappedCookies: number;
|
|
108
|
+
}
|
|
109
|
+
export declare const summary: (client: Client, projectIdOrSlug: string) => Promise<CookieScanSummary>;
|
|
110
|
+
export interface UpdateCookieCategoryResult {
|
|
111
|
+
readonly id: string;
|
|
112
|
+
readonly name: string;
|
|
113
|
+
readonly category: CookieCategory;
|
|
114
|
+
}
|
|
115
|
+
export declare const updateCookieCategory: (client: Client, projectIdOrSlug: string, cookieId: string, category: CookieCategory) => Promise<UpdateCookieCategoryResult>;
|
|
116
|
+
export interface LinkCookieResult {
|
|
117
|
+
readonly id: string;
|
|
118
|
+
readonly name: string;
|
|
119
|
+
readonly consentTypeId: string | null;
|
|
120
|
+
}
|
|
121
|
+
export declare const linkCookieToConsentType: (client: Client, projectIdOrSlug: string, cookieId: string, consentTypeId: string | null) => Promise<LinkCookieResult>;
|
|
122
|
+
export interface BulkLinkCookiesInput {
|
|
123
|
+
readonly projectId: string;
|
|
124
|
+
readonly category: CookieCategory;
|
|
125
|
+
readonly consentTypeId: string;
|
|
126
|
+
}
|
|
127
|
+
export interface BulkLinkCookiesResult {
|
|
128
|
+
readonly linkedCount: number;
|
|
129
|
+
readonly category: CookieCategory;
|
|
130
|
+
readonly consentTypeId: string;
|
|
131
|
+
}
|
|
132
|
+
export declare const bulkLinkCookies: (client: Client, input: BulkLinkCookiesInput) => Promise<BulkLinkCookiesResult>;
|
|
133
|
+
export interface SeedKnownCookiesResult {
|
|
134
|
+
readonly seededCount: number;
|
|
135
|
+
readonly message: string;
|
|
136
|
+
}
|
|
137
|
+
export declare const seedKnownCookies: (client: Client) => Promise<SeedKnownCookiesResult>;
|
|
138
|
+
//# sourceMappingURL=privacy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../src/privacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,MAAM,MAAM,cAAc,GACvB,WAAW,GACX,WAAW,GACX,WAAW,GACX,aAAa,GACb,YAAY,GACZ,SAAS,CAAA;AACZ,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,aAAa,CAAA;AACvD,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,QAAQ,CAAA;AAEvE,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;CACpC;AAED,MAAM,WAAW,eAAe;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACxB;AAED,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,EAAE,OAAO,cAAc,KAAG,OAAO,CAAC,eAAe,CAC9B,CAAA;AAE3D,MAAM,WAAW,UAAU;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAA;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,QA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cAAc,KACtB,OAAO,CAAC,0BAA0B,CAMnC,CAAA;AAEF,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;CACrC;AAED,eAAO,MAAM,uBAAuB,GACnC,QAAQ,MAAM,EACd,iBAAiB,MAAM,EACvB,UAAU,MAAM,EAChB,eAAe,MAAM,GAAG,IAAI,KAC1B,OAAO,CAAC,gBAAgB,CAMzB,CAAA;AAEF,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAA;IACjC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;CAC9B;AAED,eAAO,MAAM,eAAe,GAC3B,QAAQ,MAAM,EACd,OAAO,oBAAoB,KACzB,OAAO,CAAC,qBAAqB,CACuC,CAAA;AAEvE,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACxB;AAED,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,KAAG,OAAO,CAAC,sBAAsB,CACzB,CAAA"}
|
package/dist/privacy.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Privacy — automated cookie discovery + consent mapping for GDPR / CCPA.
|
|
3
|
+
*
|
|
4
|
+
* POST /privacy/scans — start scan
|
|
5
|
+
* GET /privacy/projects/:id/scans — list scans
|
|
6
|
+
* GET /privacy/projects/:id/scans/:scanId — get report
|
|
7
|
+
* GET /privacy/projects/:id/cookies — list detected cookies
|
|
8
|
+
* GET /privacy/projects/:id/summary — aggregate summary
|
|
9
|
+
* PATCH /privacy/projects/:id/cookies/:cookieId/category — recategorize
|
|
10
|
+
* PATCH /privacy/projects/:id/cookies/:cookieId/consent-type — (un)link consent type
|
|
11
|
+
* POST /privacy/cookies/bulk-link — bulk category → consent
|
|
12
|
+
* POST /privacy/known-cookies/seed — admin: seed reference DB
|
|
13
|
+
*
|
|
14
|
+
* Project path parameters accept TypeID OR slug (handled server-side via
|
|
15
|
+
* `getProjectByIdOrSlugWithAccess`); the SDK intentionally does not narrow.
|
|
16
|
+
*/
|
|
17
|
+
import { request } from './http.js';
|
|
18
|
+
export const startScan = (client, input) => request(client, 'POST', '/privacy/scans', { body: input });
|
|
19
|
+
export const getScan = (client, projectIdOrSlug, scanId) => request(client, 'GET', `/privacy/projects/${encodeURIComponent(projectIdOrSlug)}/scans/${encodeURIComponent(scanId)}`);
|
|
20
|
+
export const listScans = (client, projectIdOrSlug, options) => request(client, 'GET', `/privacy/projects/${encodeURIComponent(projectIdOrSlug)}/scans`, {
|
|
21
|
+
query: {
|
|
22
|
+
status: options?.status,
|
|
23
|
+
limit: options?.limit !== undefined ? String(options.limit) : undefined,
|
|
24
|
+
offset: options?.offset !== undefined ? String(options.offset) : undefined,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
export const listCookies = (client, projectIdOrSlug, options) => request(client, 'GET', `/privacy/projects/${encodeURIComponent(projectIdOrSlug)}/cookies`, {
|
|
28
|
+
query: {
|
|
29
|
+
scanId: options?.scanId,
|
|
30
|
+
category: options?.category,
|
|
31
|
+
party: options?.party,
|
|
32
|
+
search: options?.search,
|
|
33
|
+
limit: options?.limit !== undefined ? String(options.limit) : undefined,
|
|
34
|
+
offset: options?.offset !== undefined ? String(options.offset) : undefined,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
export const summary = (client, projectIdOrSlug) => request(client, 'GET', `/privacy/projects/${encodeURIComponent(projectIdOrSlug)}/summary`);
|
|
38
|
+
export const updateCookieCategory = (client, projectIdOrSlug, cookieId, category) => request(client, 'PATCH', `/privacy/projects/${encodeURIComponent(projectIdOrSlug)}/cookies/${encodeURIComponent(cookieId)}/category`, { body: { category } });
|
|
39
|
+
export const linkCookieToConsentType = (client, projectIdOrSlug, cookieId, consentTypeId) => request(client, 'PATCH', `/privacy/projects/${encodeURIComponent(projectIdOrSlug)}/cookies/${encodeURIComponent(cookieId)}/consent-type`, { body: { consentTypeId } });
|
|
40
|
+
export const bulkLinkCookies = (client, input) => request(client, 'POST', '/privacy/cookies/bulk-link', { body: input });
|
|
41
|
+
export const seedKnownCookies = (client) => request(client, 'POST', '/privacy/known-cookies/seed');
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projects — create / list / delete.
|
|
3
|
+
*
|
|
4
|
+
* Wire shape sourced from `@sylphx/contract` (ADR-084). Paths + methods
|
|
5
|
+
* come from `projectsEndpoints`; hand-written types are forbidden here.
|
|
6
|
+
*/
|
|
7
|
+
import type { CreateProjectInput, Project } from '@sylphx/contract';
|
|
8
|
+
import type { Client } from './client.js';
|
|
9
|
+
export declare const list: (client: Client) => Promise<Project[]>;
|
|
10
|
+
export type CreateInput = CreateProjectInput;
|
|
11
|
+
export declare const create: (client: Client, input: CreateInput) => Promise<Project>;
|
|
12
|
+
declare const _delete: (client: Client, id: string) => Promise<void>;
|
|
13
|
+
export { _delete as delete };
|
|
14
|
+
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../src/projects.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAEnE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,eAAO,MAAM,IAAI,GAAU,QAAQ,MAAM,KAAG,OAAO,CAAC,OAAO,EAAE,CAI5D,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,kBAAkB,CAAA;AAE5C,eAAO,MAAM,MAAM,GAAI,QAAQ,MAAM,EAAE,OAAO,WAAW,KAAG,OAAO,CAAC,OAAO,CAG1E,CAAA;AAED,QAAA,MAAM,OAAO,GAAI,QAAQ,MAAM,EAAE,IAAI,MAAM,KAAG,OAAO,CAAC,IAAI,CAGzD,CAAA;AACD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAA"}
|