@stackfactor/client-api 1.2.6 → 1.2.8

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 (33) hide show
  1. package/dist/cjs/lib/channelProgrammes.d.ts +134 -0
  2. package/dist/cjs/lib/channelProgrammes.d.ts.map +1 -0
  3. package/dist/cjs/lib/channelProgrammes.js +205 -0
  4. package/dist/cjs/lib/channelProgrammes.js.map +1 -0
  5. package/dist/cjs/lib/constants.d.ts +19 -0
  6. package/dist/cjs/lib/constants.d.ts.map +1 -1
  7. package/dist/cjs/lib/constants.js +40 -0
  8. package/dist/cjs/lib/constants.js.map +1 -1
  9. package/dist/cjs/lib/index.d.ts +2 -0
  10. package/dist/cjs/lib/index.d.ts.map +1 -1
  11. package/dist/cjs/lib/index.js +4 -2
  12. package/dist/cjs/lib/index.js.map +1 -1
  13. package/dist/cjs/lib/partnerships.d.ts +141 -0
  14. package/dist/cjs/lib/partnerships.d.ts.map +1 -0
  15. package/dist/cjs/lib/partnerships.js +247 -0
  16. package/dist/cjs/lib/partnerships.js.map +1 -0
  17. package/dist/esm/lib/channelProgrammes.d.ts +134 -0
  18. package/dist/esm/lib/channelProgrammes.d.ts.map +1 -0
  19. package/dist/esm/lib/channelProgrammes.js +193 -0
  20. package/dist/esm/lib/channelProgrammes.js.map +1 -0
  21. package/dist/esm/lib/constants.d.ts +19 -0
  22. package/dist/esm/lib/constants.d.ts.map +1 -1
  23. package/dist/esm/lib/constants.js +40 -0
  24. package/dist/esm/lib/constants.js.map +1 -1
  25. package/dist/esm/lib/index.d.ts +2 -0
  26. package/dist/esm/lib/index.d.ts.map +1 -1
  27. package/dist/esm/lib/index.js +2 -0
  28. package/dist/esm/lib/index.js.map +1 -1
  29. package/dist/esm/lib/partnerships.d.ts +141 -0
  30. package/dist/esm/lib/partnerships.d.ts.map +1 -0
  31. package/dist/esm/lib/partnerships.js +234 -0
  32. package/dist/esm/lib/partnerships.js.map +1 -0
  33. package/package.json +1 -1
@@ -0,0 +1,141 @@
1
+ /** Who to invite, and on what terms. */
2
+ export interface PartnerInvitationInput {
3
+ /** The programme being offered. */
4
+ programmeId: string;
5
+ /**
6
+ * The invitee's email address. Whether it belongs to an existing StackFactor
7
+ * account is resolved server-side and NEVER reflected in the response.
8
+ */
9
+ invitedEmail: string;
10
+ invitedOrganizationName?: string | null;
11
+ /** Matches a tier `key` on the programme. */
12
+ tier?: string | null;
13
+ seatAllocation?: number | null;
14
+ }
15
+ /** Optional status filters for either listing. */
16
+ export interface PartnershipListParams {
17
+ /**
18
+ * One or more of "invited" | "active" | "declined" | "revoked" |
19
+ * "terminated" | "expired".
20
+ */
21
+ statuses?: string[];
22
+ }
23
+ /** Vendor-side listing filters. */
24
+ export interface VendorPartnershipListParams extends PartnershipListParams {
25
+ /** Restrict to a single one of the vendor's programmes. */
26
+ programmeId?: string | null;
27
+ }
28
+ /**
29
+ * Invite an organization to one of the calling vendor's programmes, by email.
30
+ *
31
+ * Returns success whether or not the address belongs to a StackFactor account —
32
+ * an address that matches nobody still produces a record that simply expires, so
33
+ * "they ignored me" and "no such account" are indistinguishable. This is
34
+ * deliberate: it stops the endpoint being used to discover who has an account.
35
+ * The invitation code is emailed to the invitee and is not part of the response.
36
+ * POST /api/v1/partnerships/invite
37
+ * @param {PartnerInvitationInput} data Programme, email and optional tier / seats
38
+ * @param {String} authToken Authentication token
39
+ * @returns {Promise<object>}
40
+ */
41
+ export declare const invitePartner: (data: PartnerInvitationInput, authToken: string) => Promise<object>;
42
+ /**
43
+ * Re-issue an open invitation's code and extend its window. The previously
44
+ * emailed code stops working.
45
+ * POST /api/v1/partnerships/resend/:id
46
+ * @param {String} id Partnership id
47
+ * @param {String} authToken Authentication token
48
+ * @returns {Promise<object>}
49
+ */
50
+ export declare const resendInvitation: (id: string, authToken: string) => Promise<object>;
51
+ /**
52
+ * Withdraw an invitation that has not been answered.
53
+ * POST /api/v1/partnerships/revoke/:id
54
+ * @param {String} id Partnership id
55
+ * @param {String} authToken Authentication token
56
+ * @returns {Promise<object>}
57
+ */
58
+ export declare const revokeInvitation: (id: string, authToken: string) => Promise<object>;
59
+ /**
60
+ * The partnerships of the calling vendor's own programmes.
61
+ *
62
+ * Scoped to the vendor server-side: one vendor can never see a partnership
63
+ * belonging to another vendor's programme, so a competitor's partner list is not
64
+ * discoverable.
65
+ * POST /api/v1/partnerships/vendor
66
+ * @param {VendorPartnershipListParams} params Optional programme / status filters
67
+ * @param {String} authToken Authentication token
68
+ * @returns {Promise<object>}
69
+ */
70
+ export declare const listVendorPartnerships: (params: VendorPartnershipListParams, authToken: string) => Promise<object>;
71
+ /**
72
+ * The calling tenant's own standing, across every vendor it partners with.
73
+ *
74
+ * Each row carries `termsVersionCurrent` and `termsReacceptanceRequired`. Drift
75
+ * is surfaced, not enforced — a partner whose vendor revised its terms keeps its
76
+ * catalog, and clears the flag with `reacceptTerms`.
77
+ * POST /api/v1/partnerships
78
+ * @param {PartnershipListParams} params Optional status filter
79
+ * @param {String} authToken Authentication token
80
+ * @returns {Promise<object>}
81
+ */
82
+ export declare const listTenantPartnerships: (params: PartnershipListParams, authToken: string) => Promise<object>;
83
+ /**
84
+ * Preview the invitation a code names, so the invitee can read the programme and
85
+ * its terms before deciding. Reads only; nothing changes.
86
+ *
87
+ * An unknown code, a code addressed to another organization, and an expired one
88
+ * all fail identically, so this cannot be used to probe which codes are real.
89
+ * POST /api/v1/partnerships/invitation
90
+ * @param {String} code The invitation code the user typed
91
+ * @param {String} authToken Authentication token
92
+ * @returns {Promise<object>}
93
+ */
94
+ export declare const readInvitation: (code: string, authToken: string) => Promise<object>;
95
+ /**
96
+ * Accept an invitation on the organization's behalf.
97
+ *
98
+ * `termsVersion` must match the programme's current published terms — accepting
99
+ * a version that has since been revised returns 409 rather than succeeding
100
+ * against terms nobody agreed to.
101
+ * POST /api/v1/partnerships/accept
102
+ * @param {String} code The invitation code the user typed
103
+ * @param {Number} termsVersion The terms version being accepted
104
+ * @param {String} authToken Authentication token
105
+ * @returns {Promise<object>}
106
+ */
107
+ export declare const acceptInvitation: (code: string, termsVersion: number, authToken: string) => Promise<object>;
108
+ /**
109
+ * Decline an invitation. Terminal — a change of mind is a new invitation.
110
+ * POST /api/v1/partnerships/decline
111
+ * @param {String} code The invitation code the user typed
112
+ * @param {String} authToken Authentication token
113
+ * @returns {Promise<object>}
114
+ */
115
+ export declare const declineInvitation: (code: string, authToken: string) => Promise<object>;
116
+ /**
117
+ * Accept a revised set of terms on an already-active partnership, clearing the
118
+ * `termsReacceptanceRequired` flag the listing raises.
119
+ * POST /api/v1/partnerships/reaccept/:id
120
+ * @param {String} id Partnership id
121
+ * @param {Number} termsVersion The terms version being accepted
122
+ * @param {String} authToken Authentication token
123
+ * @returns {Promise<object>}
124
+ */
125
+ export declare const reacceptTerms: (id: string, termsVersion: number, authToken: string) => Promise<object>;
126
+ /**
127
+ * End an active partnership — the vendor removing a partner, or the partner
128
+ * leaving. The caller must be on one end of the edge.
129
+ *
130
+ * Granted content stops resolving on the next read. The record is kept rather
131
+ * than deleted: roll-up reporting freezes at the final state, and credentials
132
+ * already earned stay valid to their normal expiry. The partner's own billing
133
+ * plan, content and people are untouched.
134
+ * POST /api/v1/partnerships/terminate/:id
135
+ * @param {String} id Partnership id
136
+ * @param {String} reason Free-text reason, retained on the record
137
+ * @param {String} authToken Authentication token
138
+ * @returns {Promise<object>}
139
+ */
140
+ export declare const terminatePartnership: (id: string, reason: string | null, authToken: string) => Promise<object>;
141
+ //# sourceMappingURL=partnerships.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partnerships.d.ts","sourceRoot":"","sources":["../../../src/lib/partnerships.ts"],"names":[],"mappings":"AAoCA,wCAAwC;AACxC,MAAM,WAAW,sBAAsB;IACrC,mCAAmC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC,6CAA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,iBAAiB,GAC5B,MAAM,MAAM,EACZ,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,aAAa,GACxB,IAAI,MAAM,EACV,cAAc,MAAM,EACpB,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC;AAIF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,GAC/B,IAAI,MAAM,EACV,QAAQ,MAAM,GAAG,IAAI,EACrB,WAAW,MAAM,KAChB,OAAO,CAAC,MAAM,CAehB,CAAC"}
@@ -0,0 +1,247 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.terminatePartnership = exports.reacceptTerms = exports.declineInvitation = exports.acceptInvitation = exports.readInvitation = exports.listTenantPartnerships = exports.listVendorPartnerships = exports.revokeInvitation = exports.resendInvitation = exports.invitePartner = void 0;
4
+ const axiosClient_js_1 = require("./axiosClient.js");
5
+ // ── Vendor side ───────────────────────────────────────────────────────────────
6
+ /**
7
+ * Invite an organization to one of the calling vendor's programmes, by email.
8
+ *
9
+ * Returns success whether or not the address belongs to a StackFactor account —
10
+ * an address that matches nobody still produces a record that simply expires, so
11
+ * "they ignored me" and "no such account" are indistinguishable. This is
12
+ * deliberate: it stops the endpoint being used to discover who has an account.
13
+ * The invitation code is emailed to the invitee and is not part of the response.
14
+ * POST /api/v1/partnerships/invite
15
+ * @param {PartnerInvitationInput} data Programme, email and optional tier / seats
16
+ * @param {String} authToken Authentication token
17
+ * @returns {Promise<object>}
18
+ */
19
+ const invitePartner = (data, authToken) => {
20
+ return new Promise((resolve, reject) => {
21
+ const request = axiosClient_js_1.client.post(`/api/v1/partnerships/invite`, data, {
22
+ headers: { authorization: authToken },
23
+ });
24
+ request
25
+ .then((response) => {
26
+ resolve(response.data);
27
+ })
28
+ .catch((error) => {
29
+ reject(error);
30
+ });
31
+ });
32
+ };
33
+ exports.invitePartner = invitePartner;
34
+ /**
35
+ * Re-issue an open invitation's code and extend its window. The previously
36
+ * emailed code stops working.
37
+ * POST /api/v1/partnerships/resend/:id
38
+ * @param {String} id Partnership id
39
+ * @param {String} authToken Authentication token
40
+ * @returns {Promise<object>}
41
+ */
42
+ const resendInvitation = (id, authToken) => {
43
+ return new Promise((resolve, reject) => {
44
+ const request = axiosClient_js_1.client.post(`/api/v1/partnerships/resend/${id}`, {}, { headers: { authorization: authToken } });
45
+ request
46
+ .then((response) => {
47
+ resolve(response.data);
48
+ })
49
+ .catch((error) => {
50
+ reject(error);
51
+ });
52
+ });
53
+ };
54
+ exports.resendInvitation = resendInvitation;
55
+ /**
56
+ * Withdraw an invitation that has not been answered.
57
+ * POST /api/v1/partnerships/revoke/:id
58
+ * @param {String} id Partnership id
59
+ * @param {String} authToken Authentication token
60
+ * @returns {Promise<object>}
61
+ */
62
+ const revokeInvitation = (id, authToken) => {
63
+ return new Promise((resolve, reject) => {
64
+ const request = axiosClient_js_1.client.post(`/api/v1/partnerships/revoke/${id}`, {}, { headers: { authorization: authToken } });
65
+ request
66
+ .then((response) => {
67
+ resolve(response.data);
68
+ })
69
+ .catch((error) => {
70
+ reject(error);
71
+ });
72
+ });
73
+ };
74
+ exports.revokeInvitation = revokeInvitation;
75
+ /**
76
+ * The partnerships of the calling vendor's own programmes.
77
+ *
78
+ * Scoped to the vendor server-side: one vendor can never see a partnership
79
+ * belonging to another vendor's programme, so a competitor's partner list is not
80
+ * discoverable.
81
+ * POST /api/v1/partnerships/vendor
82
+ * @param {VendorPartnershipListParams} params Optional programme / status filters
83
+ * @param {String} authToken Authentication token
84
+ * @returns {Promise<object>}
85
+ */
86
+ const listVendorPartnerships = (params, authToken) => {
87
+ return new Promise((resolve, reject) => {
88
+ const request = axiosClient_js_1.client.post(`/api/v1/partnerships/vendor`, params, {
89
+ headers: { authorization: authToken },
90
+ });
91
+ request
92
+ .then((response) => {
93
+ resolve(response.data);
94
+ })
95
+ .catch((error) => {
96
+ reject(error);
97
+ });
98
+ });
99
+ };
100
+ exports.listVendorPartnerships = listVendorPartnerships;
101
+ // ── Partner side ──────────────────────────────────────────────────────────────
102
+ /**
103
+ * The calling tenant's own standing, across every vendor it partners with.
104
+ *
105
+ * Each row carries `termsVersionCurrent` and `termsReacceptanceRequired`. Drift
106
+ * is surfaced, not enforced — a partner whose vendor revised its terms keeps its
107
+ * catalog, and clears the flag with `reacceptTerms`.
108
+ * POST /api/v1/partnerships
109
+ * @param {PartnershipListParams} params Optional status filter
110
+ * @param {String} authToken Authentication token
111
+ * @returns {Promise<object>}
112
+ */
113
+ const listTenantPartnerships = (params, authToken) => {
114
+ return new Promise((resolve, reject) => {
115
+ const request = axiosClient_js_1.client.post(`/api/v1/partnerships`, params, {
116
+ headers: { authorization: authToken },
117
+ });
118
+ request
119
+ .then((response) => {
120
+ resolve(response.data);
121
+ })
122
+ .catch((error) => {
123
+ reject(error);
124
+ });
125
+ });
126
+ };
127
+ exports.listTenantPartnerships = listTenantPartnerships;
128
+ /**
129
+ * Preview the invitation a code names, so the invitee can read the programme and
130
+ * its terms before deciding. Reads only; nothing changes.
131
+ *
132
+ * An unknown code, a code addressed to another organization, and an expired one
133
+ * all fail identically, so this cannot be used to probe which codes are real.
134
+ * POST /api/v1/partnerships/invitation
135
+ * @param {String} code The invitation code the user typed
136
+ * @param {String} authToken Authentication token
137
+ * @returns {Promise<object>}
138
+ */
139
+ const readInvitation = (code, authToken) => {
140
+ return new Promise((resolve, reject) => {
141
+ const request = axiosClient_js_1.client.post(`/api/v1/partnerships/invitation`, { code }, { headers: { authorization: authToken } });
142
+ request
143
+ .then((response) => {
144
+ resolve(response.data);
145
+ })
146
+ .catch((error) => {
147
+ reject(error);
148
+ });
149
+ });
150
+ };
151
+ exports.readInvitation = readInvitation;
152
+ /**
153
+ * Accept an invitation on the organization's behalf.
154
+ *
155
+ * `termsVersion` must match the programme's current published terms — accepting
156
+ * a version that has since been revised returns 409 rather than succeeding
157
+ * against terms nobody agreed to.
158
+ * POST /api/v1/partnerships/accept
159
+ * @param {String} code The invitation code the user typed
160
+ * @param {Number} termsVersion The terms version being accepted
161
+ * @param {String} authToken Authentication token
162
+ * @returns {Promise<object>}
163
+ */
164
+ const acceptInvitation = (code, termsVersion, authToken) => {
165
+ return new Promise((resolve, reject) => {
166
+ const request = axiosClient_js_1.client.post(`/api/v1/partnerships/accept`, { code, termsVersion }, { headers: { authorization: authToken } });
167
+ request
168
+ .then((response) => {
169
+ resolve(response.data);
170
+ })
171
+ .catch((error) => {
172
+ reject(error);
173
+ });
174
+ });
175
+ };
176
+ exports.acceptInvitation = acceptInvitation;
177
+ /**
178
+ * Decline an invitation. Terminal — a change of mind is a new invitation.
179
+ * POST /api/v1/partnerships/decline
180
+ * @param {String} code The invitation code the user typed
181
+ * @param {String} authToken Authentication token
182
+ * @returns {Promise<object>}
183
+ */
184
+ const declineInvitation = (code, authToken) => {
185
+ return new Promise((resolve, reject) => {
186
+ const request = axiosClient_js_1.client.post(`/api/v1/partnerships/decline`, { code }, { headers: { authorization: authToken } });
187
+ request
188
+ .then((response) => {
189
+ resolve(response.data);
190
+ })
191
+ .catch((error) => {
192
+ reject(error);
193
+ });
194
+ });
195
+ };
196
+ exports.declineInvitation = declineInvitation;
197
+ /**
198
+ * Accept a revised set of terms on an already-active partnership, clearing the
199
+ * `termsReacceptanceRequired` flag the listing raises.
200
+ * POST /api/v1/partnerships/reaccept/:id
201
+ * @param {String} id Partnership id
202
+ * @param {Number} termsVersion The terms version being accepted
203
+ * @param {String} authToken Authentication token
204
+ * @returns {Promise<object>}
205
+ */
206
+ const reacceptTerms = (id, termsVersion, authToken) => {
207
+ return new Promise((resolve, reject) => {
208
+ const request = axiosClient_js_1.client.post(`/api/v1/partnerships/reaccept/${id}`, { termsVersion }, { headers: { authorization: authToken } });
209
+ request
210
+ .then((response) => {
211
+ resolve(response.data);
212
+ })
213
+ .catch((error) => {
214
+ reject(error);
215
+ });
216
+ });
217
+ };
218
+ exports.reacceptTerms = reacceptTerms;
219
+ // ── Either side ───────────────────────────────────────────────────────────────
220
+ /**
221
+ * End an active partnership — the vendor removing a partner, or the partner
222
+ * leaving. The caller must be on one end of the edge.
223
+ *
224
+ * Granted content stops resolving on the next read. The record is kept rather
225
+ * than deleted: roll-up reporting freezes at the final state, and credentials
226
+ * already earned stay valid to their normal expiry. The partner's own billing
227
+ * plan, content and people are untouched.
228
+ * POST /api/v1/partnerships/terminate/:id
229
+ * @param {String} id Partnership id
230
+ * @param {String} reason Free-text reason, retained on the record
231
+ * @param {String} authToken Authentication token
232
+ * @returns {Promise<object>}
233
+ */
234
+ const terminatePartnership = (id, reason, authToken) => {
235
+ return new Promise((resolve, reject) => {
236
+ const request = axiosClient_js_1.client.post(`/api/v1/partnerships/terminate/${id}`, { reason }, { headers: { authorization: authToken } });
237
+ request
238
+ .then((response) => {
239
+ resolve(response.data);
240
+ })
241
+ .catch((error) => {
242
+ reject(error);
243
+ });
244
+ });
245
+ };
246
+ exports.terminatePartnership = terminatePartnership;
247
+ //# sourceMappingURL=partnerships.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partnerships.js","sourceRoot":"","sources":["../../../src/lib/partnerships.ts"],"names":[],"mappings":";;;AACA,qDAA0C;AAiE1C,iFAAiF;AAEjF;;;;;;;;;;;;GAYG;AACI,MAAM,aAAa,GAAG,CAC3B,IAA4B,EAC5B,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,uBAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE,IAAI,EAAE;YAC/D,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE;SACtC,CAAC,CAAC;QACH,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YA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AAC;AAnBW,QAAA,aAAa,iBAmBxB;AAEF,iFAAiF;AAEjF;;;;;;;;;;;;;GAaG;AACI,MAAM,oBAAoB,GAAG,CAClC,EAAU,EACV,MAAqB,EACrB,SAAiB,EACA,EAAE;IACnB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,uBAAM,CAAC,IAAI,CACzB,kCAAkC,EAAE,EAAE,EACtC,EAAE,MAAM,EAAE,EACV,EAAE,OAAO,EAAE,EAAE,aAAa,EAAE,SAAS,EAAE,EAAE,CAC1C,CAAC;QACF,OAAO;aACJ,IAAI,CAAC,CAAC,QAAuB,EAAE,EAAE;YAChC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACzB,CAAC,CAAC;aACD,KAAK,CAAC,CAAC,KAAiB,EAAE,EAAE;YAC3B,MAAM,CAAC,KAAK,CAAC,CAAC;QAChB,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAnBW,QAAA,oBAAoB,wBAmB/B"}
@@ -0,0 +1,134 @@
1
+ /** Create / update payload for a programme's draft. */
2
+ export interface ChannelProgrammeInput {
3
+ name?: string;
4
+ description?: string | null;
5
+ /** What the programme exists to serve, shown to an invitee before accepting. */
6
+ objectives?: string[];
7
+ tiers?: ChannelProgrammeTier[];
8
+ terms?: ChannelProgrammeTerms;
9
+ /** This programme's slice of the vendor's PARTNER_SEATS pool. */
10
+ seatPool?: number;
11
+ /** How long an invitation to this programme stays open, in days. */
12
+ invitationValidityDays?: number;
13
+ }
14
+ /**
15
+ * A tier gates seat allocation and certification requirements — and nothing
16
+ * else. It deliberately does NOT scope content: the programme grants content and
17
+ * every partner in it sees all of it.
18
+ */
19
+ export interface ChannelProgrammeTier {
20
+ /** Stable machine key, referenced by a partnership's `tier`. */
21
+ key: string;
22
+ name: string;
23
+ description?: string | null;
24
+ defaultSeatAllocation?: number;
25
+ requiredCredentialIds?: string[];
26
+ }
27
+ /**
28
+ * Structured rather than prose, because the partner-facing scorecard has to read
29
+ * it.
30
+ *
31
+ * `version` is managed server-side and moves ONLY when the terms themselves
32
+ * change — adding content to a programme does not invalidate existing
33
+ * acceptances. A partnership's acceptance points at this number.
34
+ */
35
+ export interface ChannelProgrammeTerms {
36
+ version?: number;
37
+ body?: string;
38
+ completionWindowDays?: number | null;
39
+ minimumCertifiedUsers?: number | null;
40
+ }
41
+ /** Optional filters for the programme listing. */
42
+ export interface ChannelProgrammeListParams {
43
+ /** "draft" | "published" — which version to project display fields from. */
44
+ version?: string;
45
+ includeDeleted?: boolean;
46
+ }
47
+ /**
48
+ * List the calling vendor's own channel programmes.
49
+ * POST /api/v1/exceed/channelprogrammes
50
+ * @param {ChannelProgrammeListParams} params Optional version / deleted filters
51
+ * @param {String} authToken Authentication token
52
+ * @returns {Promise<object>}
53
+ */
54
+ export declare const listChannelProgrammes: (params: ChannelProgrammeListParams, authToken: string) => Promise<object>;
55
+ /**
56
+ * Create a programme, in draft. Nothing is visible to any partner until it is
57
+ * published and a partnership becomes active.
58
+ * PUT /api/v1/exceed/channelprogrammes
59
+ * @param {ChannelProgrammeInput} data Programme data (at minimum `name`)
60
+ * @param {String} authToken Authentication token
61
+ * @returns {Promise<object>}
62
+ */
63
+ export declare const createChannelProgramme: (data: ChannelProgrammeInput, authToken: string) => Promise<object>;
64
+ /**
65
+ * Read one of the calling vendor's programmes.
66
+ * GET /api/v1/exceed/channelprogrammes/programme/:id/:version
67
+ * @param {String} id Programme id
68
+ * @param {String} version "draft" | "published"
69
+ * @param {String} authToken Authentication token
70
+ * @returns {Promise<object>}
71
+ */
72
+ export declare const getChannelProgramme: (id: string, version: string, authToken: string) => Promise<object>;
73
+ /**
74
+ * Update a programme's draft.
75
+ * POST /api/v1/exceed/channelprogrammes/update
76
+ * @param {String} id Programme id
77
+ * @param {ChannelProgrammeInput} data Fields to merge into the draft
78
+ * @param {String} authToken Authentication token
79
+ * @returns {Promise<object>}
80
+ */
81
+ export declare const updateChannelProgramme: (id: string, data: ChannelProgrammeInput, authToken: string) => Promise<object>;
82
+ /**
83
+ * Publish a programme's draft. The only operation that changes what partners can
84
+ * see — content granted or revoked since the last publish takes effect here.
85
+ * POST /api/v1/exceed/channelprogrammes/publish/:id
86
+ * @param {String} id Programme id
87
+ * @param {String} authToken Authentication token
88
+ * @returns {Promise<object>}
89
+ */
90
+ export declare const publishChannelProgramme: (id: string, authToken: string) => Promise<object>;
91
+ /**
92
+ * Discard draft changes, restoring the draft from the published version.
93
+ * GET /api/v1/exceed/channelprogrammes/discard/:id
94
+ * @param {String} id Programme id
95
+ * @param {String} authToken Authentication token
96
+ * @returns {Promise<object>}
97
+ */
98
+ export declare const discardChannelProgrammeChanges: (id: string, authToken: string) => Promise<object>;
99
+ /**
100
+ * Soft-delete a programme.
101
+ *
102
+ * Does NOT cascade to partnerships: a partnership records that an organization
103
+ * accepted terms on a date, which stays true whether or not the programme still
104
+ * exists. Terminate active partnerships first if that is the intent.
105
+ * DELETE /api/v1/exceed/channelprogrammes
106
+ * @param {String} id Programme id
107
+ * @param {String} authToken Authentication token
108
+ * @returns {Promise<object>}
109
+ */
110
+ export declare const deleteChannelProgramme: (id: string, authToken: string) => Promise<object>;
111
+ /**
112
+ * Add learning content to a programme's grant.
113
+ *
114
+ * Additive and idempotent — pass what you want added, not the whole list, so two
115
+ * channel managers granting concurrently do not overwrite each other. Takes
116
+ * effect for partners only once the programme is published.
117
+ * POST /api/v1/exceed/channelprogrammes/content/grant
118
+ * @param {String} id Programme id
119
+ * @param {String[]} learningContentIds Content ids to add to the grant
120
+ * @param {String} authToken Authentication token
121
+ * @returns {Promise<object>}
122
+ */
123
+ export declare const grantLearningContent: (id: string, learningContentIds: string[], authToken: string) => Promise<object>;
124
+ /**
125
+ * Remove learning content from a programme's grant. Takes effect for partners
126
+ * only once the programme is published.
127
+ * POST /api/v1/exceed/channelprogrammes/content/revoke
128
+ * @param {String} id Programme id
129
+ * @param {String[]} learningContentIds Content ids to remove from the grant
130
+ * @param {String} authToken Authentication token
131
+ * @returns {Promise<object>}
132
+ */
133
+ export declare const revokeLearningContent: (id: string, learningContentIds: string[], authToken: string) => Promise<object>;
134
+ //# sourceMappingURL=channelProgrammes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channelProgrammes.d.ts","sourceRoot":"","sources":["../../../src/lib/channelProgrammes.ts"],"names":[],"mappings":"AAuBA,uDAAuD;AACvD,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gFAAgF;IAChF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAC/B,KAAK,CAAC,EAAE,qBAAqB,CAAC;IAC9B,iEAAiE;IACjE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,gEAAgE;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrC,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACvC;AAED,kDAAkD;AAClD,MAAM,WAAW,0BAA0B;IACzC,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,E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