@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.
- package/CHANGELOG.md +31 -2
- package/README.md +6 -6
- package/dist/auth.d.ts +7 -18
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +1 -2
- package/dist/authSettings.d.ts +7 -60
- package/dist/authSettings.d.ts.map +1 -1
- package/dist/authSettings.js +11 -19
- package/dist/backups.d.ts +7 -24
- package/dist/backups.d.ts.map +1 -1
- package/dist/backups.js +21 -7
- package/dist/client.d.ts +5 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +3 -2
- package/dist/domains.d.ts +1 -1
- package/dist/domains.d.ts.map +1 -1
- package/dist/domains.js +1 -1
- package/dist/email.d.ts +22 -29
- package/dist/email.d.ts.map +1 -1
- package/dist/email.js +52 -12
- package/dist/environments.d.ts.map +1 -1
- package/dist/environments.js +4 -1
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +6 -3
- package/dist/newsletter.d.ts +32 -257
- package/dist/newsletter.d.ts.map +1 -1
- package/dist/newsletter.js +135 -95
- package/dist/oidc.d.ts +6 -27
- package/dist/oidc.d.ts.map +1 -1
- package/dist/oidc.js +16 -6
- package/dist/organizations.d.ts +3 -1
- package/dist/organizations.d.ts.map +1 -1
- package/dist/organizations.js +8 -0
- package/dist/privacy.d.ts +3 -98
- package/dist/privacy.d.ts.map +1 -1
- package/dist/privacy.js +57 -25
- package/dist/refresh.d.ts +11 -12
- package/dist/refresh.d.ts.map +1 -1
- package/dist/refresh.js +10 -2
- package/dist/runners.d.ts +7 -58
- package/dist/runners.d.ts.map +1 -1
- package/dist/runners.js +18 -17
- package/dist/search.d.ts +7 -40
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +28 -18
- package/dist/serviceTokens.d.ts +8 -44
- package/dist/serviceTokens.d.ts.map +1 -1
- package/dist/serviceTokens.js +24 -8
- package/package.json +2 -2
package/dist/newsletter.js
CHANGED
|
@@ -1,98 +1,138 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Newsletter
|
|
2
|
+
* Newsletter management SDK.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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 {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
export const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
export const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
export const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
export const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
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
|
package/dist/oidc.d.ts.map
CHANGED
|
@@ -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,
|
|
1
|
+
{"version":3,"file":"oidc.d.ts","sourceRoot":"","sources":["../src/oidc.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EACX,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,cAAc,EACd,MAAM,kBAAkB,CAAA;AAEzB,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,MAAM,UAAU,GAAG,cAAc,CAAA;AAEvC,eAAO,MAAM,IAAI,GAAI,QAAQ,MAAM,EAAE,WAAW,MAAM,KAAG,OAAO,CAAC,sBAAsB,CAGtF,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,qBAAqB,EAAE,UAAU,CAAC,GAAG;IACnE,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 {
|
|
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) =>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
const
|
|
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 };
|
package/dist/organizations.d.ts
CHANGED
|
@@ -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,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pF,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"}
|
package/dist/organizations.js
CHANGED
|
@@ -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
|
|
19
|
-
export type
|
|
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
|
package/dist/privacy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../src/privacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"privacy.d.ts","sourceRoot":"","sources":["../src/privacy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EACX,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,UAAU,EACV,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,0BAA0B,EAC1B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAGzC,YAAY,EACX,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,EACd,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,UAAU,EACV,sBAAsB,EACtB,cAAc,EACd,eAAe,EACf,0BAA0B,GAC1B,CAAA;AAED,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAA;AAE3C,eAAO,MAAM,SAAS,GAAI,QAAQ,MAAM,EAAE,OAAO,cAAc,KAAG,OAAO,CAAC,eAAe,CAGxF,CAAA;AAED,eAAO,MAAM,OAAO,GACnB,QAAQ,MAAM,EACd,iBAAiB,MAAM,EACvB,QAAQ,MAAM,KACZ,OAAO,CAAC,UAAU,CAGpB,CAAA;AAED,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAA;IA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,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 {
|
|
18
|
-
|
|
19
|
-
export const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
+
};
|