@sylphx/management 0.4.2 → 0.5.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.
Files changed (49) hide show
  1. package/CHANGELOG.md +31 -2
  2. package/README.md +6 -6
  3. package/dist/auth.d.ts +7 -18
  4. package/dist/auth.d.ts.map +1 -1
  5. package/dist/auth.js +1 -2
  6. package/dist/authSettings.d.ts +7 -60
  7. package/dist/authSettings.d.ts.map +1 -1
  8. package/dist/authSettings.js +11 -19
  9. package/dist/backups.d.ts +7 -24
  10. package/dist/backups.d.ts.map +1 -1
  11. package/dist/backups.js +21 -7
  12. package/dist/client.d.ts +5 -2
  13. package/dist/client.d.ts.map +1 -1
  14. package/dist/client.js +3 -2
  15. package/dist/domains.d.ts +1 -1
  16. package/dist/domains.d.ts.map +1 -1
  17. package/dist/domains.js +1 -1
  18. package/dist/email.d.ts +22 -29
  19. package/dist/email.d.ts.map +1 -1
  20. package/dist/email.js +52 -12
  21. package/dist/environments.d.ts.map +1 -1
  22. package/dist/environments.js +4 -1
  23. package/dist/http.d.ts.map +1 -1
  24. package/dist/http.js +6 -3
  25. package/dist/newsletter.d.ts +32 -257
  26. package/dist/newsletter.d.ts.map +1 -1
  27. package/dist/newsletter.js +135 -95
  28. package/dist/oidc.d.ts +6 -27
  29. package/dist/oidc.d.ts.map +1 -1
  30. package/dist/oidc.js +16 -6
  31. package/dist/organizations.d.ts +3 -1
  32. package/dist/organizations.d.ts.map +1 -1
  33. package/dist/organizations.js +8 -0
  34. package/dist/privacy.d.ts +3 -98
  35. package/dist/privacy.d.ts.map +1 -1
  36. package/dist/privacy.js +57 -25
  37. package/dist/refresh.d.ts +11 -12
  38. package/dist/refresh.d.ts.map +1 -1
  39. package/dist/refresh.js +10 -2
  40. package/dist/runners.d.ts +7 -58
  41. package/dist/runners.d.ts.map +1 -1
  42. package/dist/runners.js +18 -17
  43. package/dist/search.d.ts +7 -40
  44. package/dist/search.d.ts.map +1 -1
  45. package/dist/search.js +28 -18
  46. package/dist/serviceTokens.d.ts +8 -44
  47. package/dist/serviceTokens.d.ts.map +1 -1
  48. package/dist/serviceTokens.js +24 -8
  49. package/package.json +2 -2
@@ -1,98 +1,138 @@
1
1
  /**
2
- * Newsletter subscribers, automation sequences, steps, enrollments.
2
+ * Newsletter management SDK.
3
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.
4
+ * Wire paths, methods, and public response/body shapes are sourced from
5
+ * `@sylphx/contract`. This module only adapts the ergonomic SDK call shape
6
+ * where callers pass booleans/numbers and the HTTP query contract carries
7
+ * strings.
40
8
  */
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`);
9
+ import { newsletterEndpoints, } from '@sylphx/contract';
10
+ import { interpolatePath, request } from './http.js';
11
+ const asBooleanQuery = (value) => value === undefined ? undefined : String(value);
12
+ const asNumberQuery = (value) => value === undefined ? undefined : String(value);
13
+ export const listSubscribers = (client, options) => {
14
+ const { method, path } = newsletterEndpoints.listSubscribers;
15
+ return request(client, method, path, {
16
+ query: {
17
+ projectId: options?.projectId,
18
+ verified: asBooleanQuery(options?.verified),
19
+ source: options?.source,
20
+ search: options?.search,
21
+ includeUnsubscribed: asBooleanQuery(options?.includeUnsubscribed),
22
+ limit: asNumberQuery(options?.limit),
23
+ offset: asNumberQuery(options?.offset),
24
+ },
25
+ });
26
+ };
27
+ export const getSubscriber = (client, email) => {
28
+ const { method, path } = newsletterEndpoints.getSubscriber;
29
+ return request(client, method, path, { query: { email } });
30
+ };
31
+ export const getPreferences = (client, email) => {
32
+ const { method, path } = newsletterEndpoints.getPreferences;
33
+ return request(client, method, path, { query: { email } });
34
+ };
35
+ export const exportSubscribers = (client, options) => {
36
+ const { method, path } = newsletterEndpoints.exportSubscribers;
37
+ return request(client, method, path, {
38
+ query: {
39
+ verified: asBooleanQuery(options?.verified),
40
+ includeUnsubscribed: asBooleanQuery(options?.includeUnsubscribed),
41
+ },
42
+ });
43
+ };
44
+ export const subscriberStats = (client) => {
45
+ const { method, path } = newsletterEndpoints.subscriberStats;
46
+ return request(client, method, path);
47
+ };
48
+ export const deleteSubscriber = (client, email) => {
49
+ const { method, path } = newsletterEndpoints.deleteSubscriber;
50
+ const body = { email };
51
+ return request(client, method, path, { body });
52
+ };
53
+ export const bulkDeleteSubscribers = (client, input) => {
54
+ const { method, path } = newsletterEndpoints.bulkDeleteSubscribers;
55
+ return request(client, method, path, { body: input });
56
+ };
57
+ export const resendVerification = (client, email) => {
58
+ const { method, path } = newsletterEndpoints.resendVerification;
59
+ const body = { email };
60
+ return request(client, method, path, { body });
61
+ };
62
+ export const listSequences = (client, projectId, options) => {
63
+ const { method, path } = newsletterEndpoints.listSequences;
64
+ return request(client, method, path, {
65
+ query: {
66
+ projectId,
67
+ includeInactive: asBooleanQuery(options?.includeInactive),
68
+ },
69
+ });
70
+ };
71
+ export const getSequence = (client, sequenceId) => {
72
+ const { method, path } = newsletterEndpoints.getSequence;
73
+ return request(client, method, interpolatePath(path, { sequenceId }));
74
+ };
75
+ export const createSequence = (client, input) => {
76
+ const { method, path } = newsletterEndpoints.createSequence;
77
+ return request(client, method, path, { body: input });
78
+ };
79
+ export const updateSequence = (client, sequenceId, input) => {
80
+ const { method, path } = newsletterEndpoints.updateSequence;
81
+ return request(client, method, interpolatePath(path, { sequenceId }), { body: input });
82
+ };
83
+ export const deleteSequence = (client, sequenceId) => {
84
+ const { method, path } = newsletterEndpoints.deleteSequence;
85
+ return request(client, method, interpolatePath(path, { sequenceId }));
86
+ };
87
+ export const sequenceAnalytics = (client, sequenceId) => {
88
+ const { method, path } = newsletterEndpoints.getSequenceAnalytics;
89
+ return request(client, method, interpolatePath(path, { sequenceId }));
90
+ };
91
+ export const addStep = (client, input) => {
92
+ const { method, path } = newsletterEndpoints.addStep;
93
+ return request(client, method, path, { body: input });
94
+ };
95
+ export const updateStep = (client, stepId, input) => {
96
+ const { method, path } = newsletterEndpoints.updateStep;
97
+ return request(client, method, interpolatePath(path, { stepId }), { body: input });
98
+ };
99
+ export const deleteStep = (client, stepId) => {
100
+ const { method, path } = newsletterEndpoints.deleteStep;
101
+ return request(client, method, interpolatePath(path, { stepId }));
102
+ };
103
+ export const reorderSteps = (client, sequenceId, stepOrder) => {
104
+ const { method, path } = newsletterEndpoints.reorderSteps;
105
+ const body = { sequenceId, stepOrder };
106
+ return request(client, method, path, { body });
107
+ };
108
+ export const listEnrollments = (client, sequenceId, options) => {
109
+ const { method, path } = newsletterEndpoints.listEnrollments;
110
+ return request(client, method, path, {
111
+ query: {
112
+ sequenceId,
113
+ status: options?.status,
114
+ limit: asNumberQuery(options?.limit),
115
+ offset: asNumberQuery(options?.offset),
116
+ },
117
+ });
118
+ };
119
+ export const getEnrollment = (client, enrollmentId) => {
120
+ const { method, path } = newsletterEndpoints.getEnrollment;
121
+ return request(client, method, interpolatePath(path, { enrollmentId }));
122
+ };
123
+ export const enrollSubscriber = (client, input) => {
124
+ const { method, path } = newsletterEndpoints.enrollSubscriber;
125
+ return request(client, method, path, { body: input });
126
+ };
127
+ export const cancelEnrollment = (client, enrollmentId) => {
128
+ const { method, path } = newsletterEndpoints.cancelEnrollment;
129
+ return request(client, method, interpolatePath(path, { enrollmentId }));
130
+ };
131
+ export const pauseEnrollment = (client, enrollmentId) => {
132
+ const { method, path } = newsletterEndpoints.pauseEnrollment;
133
+ return request(client, method, interpolatePath(path, { enrollmentId }));
134
+ };
135
+ export const resumeEnrollment = (client, enrollmentId) => {
136
+ const { method, path } = newsletterEndpoints.resumeEnrollment;
137
+ return request(client, method, interpolatePath(path, { enrollmentId }));
138
+ };
package/dist/oidc.d.ts CHANGED
@@ -10,37 +10,16 @@
10
10
  * custom. Each policy pins an issuer + subject pattern + allowed scope
11
11
  * set; tokens exchanged through the policy inherit exactly those scopes.
12
12
  */
13
+ import type { CreateOidcPolicyInput, DeleteOidcPolicyResult, ListOidcPoliciesResult, OidcPolicyView } from '@sylphx/contract';
13
14
  import type { Client } from './client.js';
14
15
  export type OidcProvider = 'github-actions' | 'gitlab-ci' | 'bitbucket-pipelines' | 'custom';
15
16
  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;
17
+ export type OidcPolicy = OidcPolicyView;
18
+ export declare const list: (client: Client, projectId: string) => Promise<ListOidcPoliciesResult>;
19
+ export type CreateInput = Omit<CreateOidcPolicyInput, 'provider'> & {
35
20
  readonly provider: OidcProvider;
36
- readonly issuer: string;
37
- readonly subjectPattern: string;
38
- readonly allowedScopes: readonly string[];
39
- readonly audience?: string | null;
40
- }
21
+ };
41
22
  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
- }>;
23
+ declare const _delete: (client: Client, projectId: string, policyId: string) => Promise<DeleteOidcPolicyResult>;
45
24
  export { _delete as delete };
46
25
  //# sourceMappingURL=oidc.d.ts.map
@@ -1 +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,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAA;IACzC,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC1B;AAED,eAAO,MAAM,IAAI,GAChB,QAAQ,MAAM,EACd,WAAW,MAAM,KACf,OAAO,CAAC;IAAE,QAAQ,EAAE,SAAS,UAAU,EAAE,CAAA;CAAE,CACqC,CAAA;AAEnF,MAAM,WAA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,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAA;CAC/B,CAAA;AAED,eAAO,MAAM,MAAM,GAClB,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,OAAO,WAAW,KAChB,OAAO,CAAC,UAAU,CAKpB,CAAA;AAED,QAAA,MAAM,OAAO,GACZ,QAAQ,MAAM,EACd,WAAW,MAAM,EACjB,UAAU,MAAM,KACd,OAAO,CAAC,sBAAsB,CAGhC,CAAA;AACD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,CAAA"}
package/dist/oidc.js CHANGED
@@ -10,16 +10,26 @@
10
10
  * custom. Each policy pins an issuer + subject pattern + allowed scope
11
11
  * set; tokens exchanged through the policy inherit exactly those scopes.
12
12
  */
13
- import { request } from './http.js';
13
+ import { oidcEndpoints } from '@sylphx/contract';
14
+ import { interpolatePath, request } from './http.js';
14
15
  export const SUPPORTED_PROVIDERS = [
15
16
  'github-actions',
16
17
  'gitlab-ci',
17
18
  'bitbucket-pipelines',
18
19
  'custom',
19
20
  ];
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)}`);
21
+ export const list = (client, projectId) => {
22
+ const { method, path } = oidcEndpoints.listPolicies;
23
+ return request(client, method, interpolatePath(path, { projectId }));
24
+ };
25
+ export const create = (client, projectId, input) => {
26
+ const { method, path } = oidcEndpoints.createPolicy;
27
+ return request(client, method, interpolatePath(path, { projectId }), {
28
+ body: { audience: null, ...input },
29
+ });
30
+ };
31
+ const _delete = (client, projectId, policyId) => {
32
+ const { method, path } = oidcEndpoints.deletePolicy;
33
+ return request(client, method, interpolatePath(path, { projectId, id: policyId }));
34
+ };
25
35
  export { _delete as delete };
@@ -3,11 +3,13 @@
3
3
  *
4
4
  * Wire shape sourced from `@sylphx/contract` (ADR-084).
5
5
  */
6
- import type { MyOrgResponse, OrgMember, OrgMemberRole, UpdateMemberRoleResult, UserOrganizationsResponse } from '@sylphx/contract';
6
+ import type { CreateOrgInput, MyOrgResponse, Organization, OrgMember, OrgMemberRole, OrgSettings, UpdateMemberRoleResult, UserOrganizationsResponse } from '@sylphx/contract';
7
7
  import type { Client } from './client.js';
8
8
  export type { OrgMemberRole, UpdateMemberRoleResult };
9
9
  export declare const current: (client: Client) => Promise<MyOrgResponse>;
10
10
  export declare const listMemberships: (client: Client) => Promise<UserOrganizationsResponse>;
11
+ export declare const create: (client: Client, input: CreateOrgInput) => Promise<Organization>;
12
+ export declare const getSettings: (client: Client, id: string) => Promise<OrgSettings>;
11
13
  export declare const listMembers: (client: Client, orgId: string) => Promise<OrgMember[]>;
12
14
  export declare const inviteMember: (client: Client, orgId: string, email: string, role: "admin" | "member") => Promise<void>;
13
15
  export declare const removeMember: (client: Client, orgId: string, userId: string) => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../src/organizations.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACX,aAAa,EACb,SAAS,EACT,aAAa,EACb,sBAAsB,EACtB,yBAAyB,EACzB,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,aAAa,CAG7D,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,KAAG,OAAO,CAAC,yBAAyB,CAGjF,CAAA;AAED,eAAO,MAAM,WAAW,GAAU,QAAQ,MAAM,EAAE,OAAO,MAAM,KAAG,OAAO,CAAC,SAAS,EAAE,CAQpF,CAA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Y,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"}
@@ -13,6 +13,14 @@ export const listMemberships = (client) => {
13
13
  const { method, path } = organizationsEndpoints.memberships;
14
14
  return request(client, method, path);
15
15
  };
16
+ export const create = (client, input) => {
17
+ const { method, path } = organizationsEndpoints.create;
18
+ return request(client, method, path, { body: input });
19
+ };
20
+ export const getSettings = (client, id) => {
21
+ const { method, path } = organizationsEndpoints.getSettings;
22
+ return request(client, method, interpolatePath(path, { id }));
23
+ };
16
24
  export const listMembers = async (client, orgId) => {
17
25
  const { method, path } = organizationsEndpoints.listMembers;
18
26
  const res = await request(client, method, interpolatePath(path, { orgId }));
package/dist/privacy.d.ts CHANGED
@@ -14,75 +14,18 @@
14
14
  * Project path parameters accept TypeID OR slug (handled server-side via
15
15
  * `getProjectByIdOrSlugWithAccess`); the SDK intentionally does not narrow.
16
16
  */
17
+ import type { BulkLinkCookiesInput, BulkLinkCookiesResult, CookieCategory, CookieParty, CookieScanSummary, DetectedCookie, LinkCookieResult, ListCookiesResult, ListScansResult, ScanReport, ScanReportSummary, ScanStatus, SeedKnownCookiesResult, StartScanInput, StartScanResult, UpdateCookieCategoryResult } from '@sylphx/contract';
17
18
  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
- }
19
+ export type { BulkLinkCookiesInput, BulkLinkCookiesResult, CookieCategory, CookieParty, CookieScanSummary, DetectedCookie, LinkCookieResult, ListCookiesResult, ListScansResult, ScanReport, ScanStatus, SeedKnownCookiesResult, StartScanInput, StartScanResult, UpdateCookieCategoryResult, };
20
+ export type ScanSummary = ScanReportSummary;
32
21
  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
22
  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
23
  export interface ListScansOptions {
58
24
  readonly status?: ScanStatus;
59
25
  readonly limit?: number;
60
26
  readonly offset?: number;
61
27
  }
62
- export interface ListScansResult {
63
- readonly scans: readonly ScanSummary[];
64
- readonly total: number;
65
- readonly limit: number;
66
- readonly offset: number;
67
- }
68
28
  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
29
  export interface ListCookiesOptions {
87
30
  readonly scanId?: string;
88
31
  readonly category?: CookieCategory;
@@ -91,48 +34,10 @@ export interface ListCookiesOptions {
91
34
  readonly limit?: number;
92
35
  readonly offset?: number;
93
36
  }
94
- export interface ListCookiesResult {
95
- readonly cookies: readonly DetectedCookie[];
96
- readonly total: number;
97
- readonly limit: number;
98
- readonly offset: number;
99
- }
100
37
  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
38
  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
39
  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
40
  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
41
  export declare const bulkLinkCookies: (client: Client, input: BulkLinkCookiesInput) => Promise<BulkLinkCookiesResult>;
133
- export interface SeedKnownCookiesResult {
134
- readonly seededCount: number;
135
- readonly message: string;
136
- }
137
42
  export declare const seedKnownCookies: (client: Client) => Promise<SeedKnownCookiesResult>;
138
43
  //# sourceMappingURL=privacy.d.ts.map
@@ -1 +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;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AA;IAC5B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACxB;AAED,eAAO,MAAM,WAAW,GACvB,QAAQ,MAAM,EACd,iBAAiB,MAAM,EACvB,UAAU,kBAAkB,KAC1B,OAAO,CAAC,iBAAiB,CAY3B,CAAA;AAED,eAAO,MAAM,OAAO,GAAI,QAAQ,MAAM,EAAE,iBAAiB,MAAM,KAAG,OAAO,CAAC,iBAAiB,CAG1F,CAAA;AAED,eAAO,MAAM,oBAAoB,GAChC,QAAQ,MAAM,EACd,iBAAiB,MAAM,EACvB,UAAU,MAAM,EAChB,UAAU,cAAc,KACtB,OAAO,CAAC,0BAA0B,CAKpC,CAAA;AAED,eAAO,MAAM,uBAAuB,GACnC,QAAQ,MAAM,EACd,iBAAiB,MAAM,EACvB,UAAU,MAAM,EAChB,eAAe,MAAM,GAAG,IAAI,KAC1B,OAAO,CAAC,gBAAgB,CAK1B,CAAA;AAED,eAAO,MAAM,eAAe,GAC3B,QAAQ,MAAM,EACd,OAAO,oBAAoB,KACzB,OAAO,CAAC,qBAAqB,CAG/B,CAAA;AAED,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,KAAG,OAAO,CAAC,sBAAsB,CAG/E,CAAA"}
package/dist/privacy.js CHANGED
@@ -14,28 +14,60 @@
14
14
  * Project path parameters accept TypeID OR slug (handled server-side via
15
15
  * `getProjectByIdOrSlugWithAccess`); the SDK intentionally does not narrow.
16
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');
17
+ import { privacyEndpoints } from '@sylphx/contract';
18
+ import { interpolatePath, request } from './http.js';
19
+ export const startScan = (client, input) => {
20
+ const { method, path } = privacyEndpoints.startScan;
21
+ return request(client, method, path, { body: input });
22
+ };
23
+ export const getScan = (client, projectIdOrSlug, scanId) => {
24
+ const { method, path } = privacyEndpoints.getScan;
25
+ return request(client, method, interpolatePath(path, { id: projectIdOrSlug, scanId }));
26
+ };
27
+ export const listScans = (client, projectIdOrSlug, options) => {
28
+ const { method, path } = privacyEndpoints.listScans;
29
+ return request(client, method, interpolatePath(path, { id: projectIdOrSlug }), {
30
+ query: {
31
+ status: options?.status,
32
+ limit: options?.limit !== undefined ? String(options.limit) : undefined,
33
+ offset: options?.offset !== undefined ? String(options.offset) : undefined,
34
+ },
35
+ });
36
+ };
37
+ export const listCookies = (client, projectIdOrSlug, options) => {
38
+ const { method, path } = privacyEndpoints.listCookies;
39
+ return request(client, method, interpolatePath(path, { id: projectIdOrSlug }), {
40
+ query: {
41
+ scanId: options?.scanId,
42
+ category: options?.category,
43
+ party: options?.party,
44
+ search: options?.search,
45
+ limit: options?.limit !== undefined ? String(options.limit) : undefined,
46
+ offset: options?.offset !== undefined ? String(options.offset) : undefined,
47
+ },
48
+ });
49
+ };
50
+ export const summary = (client, projectIdOrSlug) => {
51
+ const { method, path } = privacyEndpoints.getSummary;
52
+ return request(client, method, interpolatePath(path, { id: projectIdOrSlug }));
53
+ };
54
+ export const updateCookieCategory = (client, projectIdOrSlug, cookieId, category) => {
55
+ const { method, path } = privacyEndpoints.updateCookieCategory;
56
+ return request(client, method, interpolatePath(path, { id: projectIdOrSlug, cookieId }), {
57
+ body: { category },
58
+ });
59
+ };
60
+ export const linkCookieToConsentType = (client, projectIdOrSlug, cookieId, consentTypeId) => {
61
+ const { method, path } = privacyEndpoints.linkCookie;
62
+ return request(client, method, interpolatePath(path, { id: projectIdOrSlug, cookieId }), {
63
+ body: { consentTypeId },
64
+ });
65
+ };
66
+ export const bulkLinkCookies = (client, input) => {
67
+ const { method, path } = privacyEndpoints.bulkLinkCookies;
68
+ return request(client, method, path, { body: input });
69
+ };
70
+ export const seedKnownCookies = (client) => {
71
+ const { method, path } = privacyEndpoints.seedKnownCookies;
72
+ return request(client, method, path);
73
+ };