@cookiemunch/sdk 0.32.0 → 0.34.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/dist/index.cjs +11 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/rights/express.cjs +86 -0
- package/dist/rights/express.cjs.map +1 -0
- package/dist/rights/express.d.ts +56 -0
- package/dist/rights/express.js +60 -0
- package/dist/rights/express.js.map +1 -0
- package/dist/rights.cjs +15 -0
- package/dist/rights.cjs.map +1 -1
- package/dist/rights.d.ts +10 -2
- package/dist/rights.js +14 -0
- package/dist/rights.js.map +1 -1
- package/package.json +6 -1
package/dist/index.cjs
CHANGED
|
@@ -36,6 +36,7 @@ __export(src_exports, {
|
|
|
36
36
|
mintConsentSyncToken: () => mintConsentSyncToken,
|
|
37
37
|
parseConsentValue: () => parseConsentValue,
|
|
38
38
|
readConsent: () => readConsent,
|
|
39
|
+
rightsLink: () => rightsLink,
|
|
39
40
|
runExecutorConformance: () => runExecutorConformance,
|
|
40
41
|
secretPaths: () => secretPaths,
|
|
41
42
|
verifyDecisionSignature: () => verifyDecisionSignature,
|
|
@@ -571,7 +572,7 @@ async function exchangeOperatorToken(input) {
|
|
|
571
572
|
}
|
|
572
573
|
|
|
573
574
|
// src/index.ts
|
|
574
|
-
var SDK_VERSION = "0.
|
|
575
|
+
var SDK_VERSION = "0.34.0";
|
|
575
576
|
var CookieMunchApiError = class extends Error {
|
|
576
577
|
constructor(status, message, code, body) {
|
|
577
578
|
super(message);
|
|
@@ -671,7 +672,8 @@ function createCookieMunch(opts) {
|
|
|
671
672
|
partnerLinks: {
|
|
672
673
|
list: (o) => get(`/partner_links${metaQs(o)}`),
|
|
673
674
|
create: (input) => request("POST", "/partner_links", input),
|
|
674
|
-
revoke: (id) => request("DELETE", `/partner_links/${enc(id)}`)
|
|
675
|
+
revoke: (id) => request("DELETE", `/partner_links/${enc(id)}`),
|
|
676
|
+
update: (id, input, o) => request("PATCH", `/partner_links/${enc(id)}${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, input)
|
|
675
677
|
},
|
|
676
678
|
provisionEnv: (ref) => get(`/provision/env${qs({ ref })}`),
|
|
677
679
|
sites: {
|
|
@@ -686,6 +688,7 @@ function createCookieMunch(opts) {
|
|
|
686
688
|
listPartners: (cbid) => get(`/sites/${enc(cbid)}/partners`),
|
|
687
689
|
linkPartner: (cbid, input, o) => request("POST", `/sites/${enc(cbid)}/partners${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, input),
|
|
688
690
|
unlinkPartner: (cbid, linkId) => request("DELETE", `/sites/${enc(cbid)}/partners/${enc(linkId)}`),
|
|
691
|
+
updatePartner: (cbid, linkId, input, o) => request("PATCH", `/sites/${enc(cbid)}/partners/${enc(linkId)}${qs({ dryRun: o?.dryRun ? "1" : void 0 })}`, input),
|
|
689
692
|
getConfig: (cbid) => get(`/sites/${enc(cbid)}/config`),
|
|
690
693
|
putConfig: (cbid, config, opts2) => request("PUT", `/sites/${enc(cbid)}/config${qs({ keep: opts2?.keep })}`, config),
|
|
691
694
|
patchConfig: (cbid, config) => request("PATCH", `/sites/${enc(cbid)}/config`, config),
|
|
@@ -1113,6 +1116,11 @@ function createCookieMunch(opts) {
|
|
|
1113
1116
|
}
|
|
1114
1117
|
};
|
|
1115
1118
|
}
|
|
1119
|
+
async function rightsLink(clientOrOptions, input) {
|
|
1120
|
+
const client = "rightsLinks" in clientOrOptions ? clientOrOptions : createCookieMunch(clientOrOptions);
|
|
1121
|
+
const { cbid, ...body } = input;
|
|
1122
|
+
return (await client.rightsLinks.create(cbid, body)).url;
|
|
1123
|
+
}
|
|
1116
1124
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1117
1125
|
0 && (module.exports = {
|
|
1118
1126
|
CANARY_ISSUER,
|
|
@@ -1131,6 +1139,7 @@ function createCookieMunch(opts) {
|
|
|
1131
1139
|
mintConsentSyncToken,
|
|
1132
1140
|
parseConsentValue,
|
|
1133
1141
|
readConsent,
|
|
1142
|
+
rightsLink,
|
|
1134
1143
|
runExecutorConformance,
|
|
1135
1144
|
secretPaths,
|
|
1136
1145
|
verifyDecisionSignature,
|