graze-client 0.2.3 → 0.3.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/build/cjs/GrazeClient.js +71 -0
- package/build/cjs/GrazeClient.js.map +1 -0
- package/build/cjs/builder.js +91 -0
- package/build/cjs/builder.js.map +1 -0
- package/build/cjs/index.js +48 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/schema/UpdateAlgorithmPayload.js +117 -0
- package/build/cjs/schema/UpdateAlgorithmPayload.js.map +1 -0
- package/build/cjs/schema/index.js +28 -0
- package/build/cjs/schema/index.js.map +1 -0
- package/build/cjs/schema/shared.js +69 -0
- package/build/cjs/schema/shared.js.map +1 -0
- package/build/dts/GrazeClient.d.ts +22 -22
- package/build/dts/builder.d.ts +42 -0
- package/build/dts/builder.d.ts.map +1 -0
- package/build/dts/schema/UpdateAlgorithmPayload.d.ts +27 -3
- package/build/dts/schema/UpdateAlgorithmPayload.d.ts.map +1 -1
- package/build/esm/GrazeClient.js +52 -58
- package/build/esm/GrazeClient.js.map +1 -1
- package/build/esm/builder.js +85 -0
- package/build/esm/builder.js.map +1 -0
- package/build/esm/index.js +35 -35
- package/build/esm/index.js.map +1 -1
- package/build/esm/schema/UpdateAlgorithmPayload.js +78 -68
- package/build/esm/schema/UpdateAlgorithmPayload.js.map +1 -1
- package/build/esm/schema/index.js.map +1 -1
- package/build/esm/schema/shared.js +51 -51
- package/build/esm/schema/shared.js.map +1 -1
- package/package.json +6 -14
- package/src/builder.ts +119 -0
- package/src/schema/UpdateAlgorithmPayload.ts +14 -2
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GrazeError = exports.GrazeClient = void 0;
|
|
7
|
+
var _shared = require("./schema/shared.js");
|
|
8
|
+
var _platform = require("@effect/platform");
|
|
9
|
+
var _effect = require("effect");
|
|
10
|
+
var Form = _interopRequireWildcard(require("./schema/UpdateAlgorithmPayload.js"));
|
|
11
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
function isStringOrBlob(val) {
|
|
14
|
+
return typeof val === "string" || val instanceof Blob;
|
|
15
|
+
}
|
|
16
|
+
const encodeForm = obj => _effect.Effect.gen(function* () {
|
|
17
|
+
const encoded = yield* _effect.Schema.encode(Form.FullForm)(obj);
|
|
18
|
+
const formData = new FormData();
|
|
19
|
+
for (const key in encoded) {
|
|
20
|
+
if (encoded.hasOwnProperty(key)) {
|
|
21
|
+
const val = encoded[key];
|
|
22
|
+
if (isStringOrBlob(val)) {
|
|
23
|
+
formData.append(key, val);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return formData;
|
|
28
|
+
});
|
|
29
|
+
const UserIdParam = /*#__PURE__*/_platform.HttpApiSchema.param("userId", _effect.Schema.NumberFromString);
|
|
30
|
+
const FeedIdParam = /*#__PURE__*/_platform.HttpApiSchema.param("feedId", _effect.Schema.NumberFromString);
|
|
31
|
+
const GrazeApiGroup = /*#__PURE__*/_platform.HttpApiGroup.make("graze", {
|
|
32
|
+
topLevel: true
|
|
33
|
+
}).add(_platform.HttpApiEndpoint.get("getFeeds")`/app/my_feeds`.addSuccess(_shared.GetAlgorithmsResponse).setPayload(_effect.Schema.Struct({
|
|
34
|
+
user_id: UserIdParam
|
|
35
|
+
}))).add(_platform.HttpApiEndpoint.get("getFeed")`/app/my_feeds/${FeedIdParam}`.addSuccess(_shared.GetAlgoResponse)).add(_platform.HttpApiEndpoint.post("updateAlgorithm")`/app/edit_algo_image`.setPayload(_platform.HttpApiSchema.Multipart(Form.FullForm)).addSuccess(_shared.AlgoUpdateResponse)).add(_platform.HttpApiEndpoint.get("publishAlgorithm")`/app/publish_algo/${FeedIdParam}`.addSuccess(_effect.Schema.Unknown)).add(/*#__PURE__*/_platform.HttpApiEndpoint.post("hidePost")`/app/hide_post`.setPayload(_shared.HidePostBody).addSuccess(_effect.Schema.Unknown));
|
|
36
|
+
class GrazeApiDef extends /*#__PURE__*/_platform.HttpApi.make("grazeApi").add(GrazeApiGroup) {}
|
|
37
|
+
const grazeLive = /*#__PURE__*/_effect.Effect.gen(function* () {
|
|
38
|
+
const baseUrl = yield* _effect.Config.url("GRAZE_API_URL");
|
|
39
|
+
const cookie = yield* _effect.Config.redacted("GRAZE_COOKIE");
|
|
40
|
+
const client = yield* _platform.HttpApiClient.make(GrazeApiDef, {
|
|
41
|
+
baseUrl: baseUrl.toString(),
|
|
42
|
+
transformClient: client => client.pipe(_platform.HttpClient.filterStatusOk, _platform.HttpClient.mapRequest(_platform.HttpClientRequest.setHeaders({
|
|
43
|
+
cookie: _effect.Redacted.value(cookie)
|
|
44
|
+
})))
|
|
45
|
+
});
|
|
46
|
+
const updateAlgorithm = data => _effect.Effect.gen(function* () {
|
|
47
|
+
const formData = yield* encodeForm(data);
|
|
48
|
+
return yield* client.updateAlgorithm({
|
|
49
|
+
payload: formData
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
const userId = yield* _effect.Config.integer("GRAZE_USER_ID");
|
|
53
|
+
const getFeeds = () => client.getFeeds({
|
|
54
|
+
payload: {
|
|
55
|
+
user_id: userId
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return {
|
|
59
|
+
...client,
|
|
60
|
+
updateAlgorithm,
|
|
61
|
+
getFeeds
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
class GrazeClient extends /*#__PURE__*/_effect.Effect.Service()("GrazeClient", {
|
|
65
|
+
effect: grazeLive,
|
|
66
|
+
dependencies: [_platform.FetchHttpClient.layer]
|
|
67
|
+
}) {}
|
|
68
|
+
exports.GrazeClient = GrazeClient;
|
|
69
|
+
class GrazeError extends /*#__PURE__*/_effect.Data.TaggedError("GrazeError") {}
|
|
70
|
+
exports.GrazeError = GrazeError;
|
|
71
|
+
//# sourceMappingURL=GrazeClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GrazeClient.js","names":["_shared","require","_platform","_effect","Form","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","isStringOrBlob","val","Blob","encodeForm","obj","Effect","gen","encoded","Schema","encode","FullForm","formData","FormData","key","append","UserIdParam","HttpApiSchema","param","NumberFromString","FeedIdParam","GrazeApiGroup","HttpApiGroup","make","topLevel","add","HttpApiEndpoint","addSuccess","GetAlgorithmsResponse","setPayload","Struct","user_id","GetAlgoResponse","post","Multipart","AlgoUpdateResponse","Unknown","HidePostBody","GrazeApiDef","HttpApi","grazeLive","baseUrl","Config","url","cookie","redacted","client","HttpApiClient","toString","transformClient","pipe","HttpClient","filterStatusOk","mapRequest","HttpClientRequest","setHeaders","Redacted","value","updateAlgorithm","data","payload","userId","integer","getFeeds","GrazeClient","Service","effect","dependencies","FetchHttpClient","layer","exports","GrazeError","Data","TaggedError"],"sources":["../../src/GrazeClient.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AAUA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,IAA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,MAAMiD,MAAM,GAAG,OAAOnB,cAAM,CAACoB,OAAO,CAAC,eAAe,CAAC;EACrD,MAAMC,QAAQ,GAAGA,CAAA,KAAMjB,MAAM,CAACiB,QAAQ,CAAC;IAAEH,OAAO,EAAE;MAAE7B,OAAO,EAAE8B;IAAM;EAAE,CAAE,CAAC;EAExE,OAAO;IACL,GAAGf,MAAM;IACTY,eAAe;IACfK;GACD;AACH,CAAC,CAAC;AAEI,MAAOC,WAAY,sBAAQ1D,cAAM,CAAC2D,OAAO,EAAe,CAAC,aAAa,EAAE;EAC5EC,MAAM,EAAE1B,SAAS;EACjB2B,YAAY,EAAE,CAACC,yBAAe,CAACC,KAAK;CACrC,CAAC;AAAAC,OAAA,CAAAN,WAAA,GAAAA,WAAA;AAII,MAAOO,UAAW,sBAAQC,YAAI,CAACC,WAAW,CAAC,YAAY,CAK3D;AAAAH,OAAA,CAAAC,UAAA,GAAAA,UAAA","ignoreList":[]}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.F = exports.Algo = void 0;
|
|
7
|
+
const and = (...filters) => {
|
|
8
|
+
const flatFilters = [];
|
|
9
|
+
filters.forEach(f => {
|
|
10
|
+
if ("and" in f) {
|
|
11
|
+
// Automatically flatten nested ands.
|
|
12
|
+
flatFilters.push(...f.and);
|
|
13
|
+
} else {
|
|
14
|
+
flatFilters.push(f);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
return {
|
|
18
|
+
and: flatFilters
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const or = (...filters) => {
|
|
22
|
+
const flatFilters = [];
|
|
23
|
+
filters.forEach(f => {
|
|
24
|
+
if ("or" in f) {
|
|
25
|
+
flatFilters.push(...f.or);
|
|
26
|
+
} else {
|
|
27
|
+
flatFilters.push(f);
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
or: flatFilters
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const regexMatches = (attribute, regex) => ({
|
|
35
|
+
regex_matches: [attribute, regex, true]
|
|
36
|
+
});
|
|
37
|
+
const regexNegationMatches = (attribute, regex) => ({
|
|
38
|
+
regex_negation_matches: [attribute, regex, true]
|
|
39
|
+
});
|
|
40
|
+
const isListMember = uri => ({
|
|
41
|
+
list_member: [uri, "in"]
|
|
42
|
+
});
|
|
43
|
+
const isNotListMember = uri => ({
|
|
44
|
+
list_member: [uri, "not_in"]
|
|
45
|
+
});
|
|
46
|
+
const socialGraph = (identifier, op, relation) => ({
|
|
47
|
+
social_graph: [identifier, op, relation]
|
|
48
|
+
});
|
|
49
|
+
const posterIsFollowedBy = identifier => socialGraph(identifier, "in", "followers");
|
|
50
|
+
const posterFollows = identifier => socialGraph(identifier, "in", "follows");
|
|
51
|
+
const posterIsNotFollowedBy = identifier => socialGraph(identifier, "not_in", "followers");
|
|
52
|
+
const posterDoesNotFollow = identifier => socialGraph(identifier, "not_in", "follows");
|
|
53
|
+
const hasVideo = {
|
|
54
|
+
embed_type: ["==", "video"]
|
|
55
|
+
};
|
|
56
|
+
const hasNoNSFWLabels = {
|
|
57
|
+
entity_excludes: ["labels", ["porn", "sexual", "nudity"]]
|
|
58
|
+
};
|
|
59
|
+
const attributeCompare = (attr, op, value) => ({
|
|
60
|
+
attribute_compare: [attr, op, value]
|
|
61
|
+
});
|
|
62
|
+
const isPost = /*#__PURE__*/attributeCompare("reply", "==", null);
|
|
63
|
+
const isReply = /*#__PURE__*/attributeCompare("reply", "!=", null);
|
|
64
|
+
const isContentOk = (threshold = 0.9) => ({
|
|
65
|
+
content_moderation: ["OK", ">=", threshold]
|
|
66
|
+
});
|
|
67
|
+
const Algo = exports.Algo = {
|
|
68
|
+
filter: (...filters) => ({
|
|
69
|
+
filter: and(...filters)
|
|
70
|
+
})
|
|
71
|
+
};
|
|
72
|
+
const F = exports.F = {
|
|
73
|
+
and,
|
|
74
|
+
or,
|
|
75
|
+
regexMatches,
|
|
76
|
+
regexNegationMatches,
|
|
77
|
+
attributeCompare,
|
|
78
|
+
isListMember,
|
|
79
|
+
isNotListMember,
|
|
80
|
+
socialGraph,
|
|
81
|
+
posterIsFollowedBy,
|
|
82
|
+
posterFollows,
|
|
83
|
+
posterIsNotFollowedBy,
|
|
84
|
+
posterDoesNotFollow,
|
|
85
|
+
hasVideo,
|
|
86
|
+
hasNoNSFWLabels,
|
|
87
|
+
isPost,
|
|
88
|
+
isReply,
|
|
89
|
+
isContentOk
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.js","names":["and","filters","flatFilters","forEach","f","push","or","regexMatches","attribute","regex","regex_matches","regexNegationMatches","regex_negation_matches","isListMember","uri","list_member","isNotListMember","socialGraph","identifier","op","relation","social_graph","posterIsFollowedBy","posterFollows","posterIsNotFollowedBy","posterDoesNotFollow","hasVideo","embed_type","hasNoNSFWLabels","entity_excludes","attributeCompare","attr","value","attribute_compare","isPost","isReply","isContentOk","threshold","content_moderation","Algo","exports","filter","F"],"sources":["../../src/builder.ts"],"sourcesContent":[null],"mappings":";;;;;;AAYA,MAAMA,GAAG,GAAGA,CAAC,GAAGC,OAAiB,KAAI;EACnC,MAAMC,WAAW,GAAa,EAAE;EAChCD,OAAO,CAACE,OAAO,CAAEC,CAAC,IAAI;IACpB,IAAI,KAAK,IAAIA,CAAC,EAAE;MACd;MACAF,WAAW,CAACG,IAAI,CAAC,GAAGD,CAAC,CAACJ,GAAG,CAAC;IAC5B,CAAC,MAAM;MACLE,WAAW,CAACG,IAAI,CAACD,CAAC,CAAC;IACrB;EACF,CAAC,CAAC;EACF,OAAO;IAAEJ,GAAG,EAAEE;EAAW,CAAE;AAC7B,CAAC;AACD,MAAMI,EAAE,GAAGA,CAAC,GAAGL,OAAiB,KAAI;EAClC,MA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
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.GrazeService = void 0;
|
|
7
|
+
var _effect = require("effect");
|
|
8
|
+
var _GrazeClient = require("src/GrazeClient.js");
|
|
9
|
+
class GrazeService {
|
|
10
|
+
getFeed;
|
|
11
|
+
getFeeds;
|
|
12
|
+
hidePost;
|
|
13
|
+
updateAlgorithm;
|
|
14
|
+
publishAlgorithm;
|
|
15
|
+
constructor({
|
|
16
|
+
apiUrl,
|
|
17
|
+
cookie,
|
|
18
|
+
userId
|
|
19
|
+
}) {
|
|
20
|
+
const envMap = new Map([["GRAZE_API_URL", apiUrl], ["GRAZE_COOKIE", cookie], ["GRAZE_USER_ID", userId.toString()]]);
|
|
21
|
+
const provider = _effect.ConfigProvider.fromMap(envMap);
|
|
22
|
+
const layer = _effect.Layer.setConfigProvider(provider);
|
|
23
|
+
const make = setup.pipe(_effect.Effect.provide(layer), _effect.Effect.provide(_GrazeClient.GrazeClient.Default));
|
|
24
|
+
const api = _effect.Effect.runSync(make);
|
|
25
|
+
this.getFeed = api.getFeed;
|
|
26
|
+
this.getFeeds = api.getFeeds;
|
|
27
|
+
this.hidePost = api.hidePost;
|
|
28
|
+
this.updateAlgorithm = api.updateAlgorithm;
|
|
29
|
+
this.publishAlgorithm = api.publishAlgorithm;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.GrazeService = GrazeService;
|
|
33
|
+
const setup = /*#__PURE__*/_effect.Effect.gen(function* () {
|
|
34
|
+
const client = yield* _GrazeClient.GrazeClient;
|
|
35
|
+
const getFeed = (...args) => client.getFeed(...args).pipe(_effect.Effect.runPromise);
|
|
36
|
+
const getFeeds = (...args) => client.getFeeds(...args).pipe(_effect.Effect.runPromise);
|
|
37
|
+
const hidePost = (...args) => client.hidePost(...args).pipe(_effect.Effect.runPromise);
|
|
38
|
+
const updateAlgorithm = (...args) => client.updateAlgorithm(...args).pipe(_effect.Effect.runPromise);
|
|
39
|
+
const publishAlgorithm = (...args) => client.publishAlgorithm(...args).pipe(_effect.Effect.runPromise);
|
|
40
|
+
return {
|
|
41
|
+
getFeed,
|
|
42
|
+
getFeeds,
|
|
43
|
+
hidePost,
|
|
44
|
+
updateAlgorithm,
|
|
45
|
+
publishAlgorithm
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_effect","require","_GrazeClient","GrazeService","getFeed","getFeeds","hidePost","updateAlgorithm","publishAlgorithm","constructor","apiUrl","cookie","userId","envMap","Map","toString","provider","ConfigProvider","fromMap","layer","Layer","setConfigProvider","make","setup","pipe","Effect","provide","GrazeClient","Default","api","runSync","gen","client","args","runPromise"],"sources":["../../src/index.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAQM,MAAOE,YAAY;EACvBC,OAAO;EACPC,QAAQ;EACRC,QAAQ;EACRC,eAAe;EACfC,gBAAgB;EAEhBC,YAAY;IACVC,MAAM;IACNC,MAAM;IACNC;EAAM,CAKP;IACC,MAAMC,MAAM,GAAG,IAAIC,GAAG,CAAC,CACrB,CAAC,eAAe,EAAEJ,MAAM,CAAC,EACzB,CAAC,cAAc,EAAEC,MAAM,CAAC,EACxB,CAAC,eAAe,EAAEC,MAAM,CAACG,QAAQ,EAAE,CAAC,CACrC,CAAC;IACF,MAAMC,QAAQ,GAAGC,sBAAc,CAACC,OAAO,CAACL,MAAM,CAAC;IAC/C,MAAMM,KAAK,GAAGC,aAAK,CAACC,iBAAiB,CAACL,QAAQ,CAAC;IAC/C,MAAMM,IAAI,GAAGC,KAAK,CAACC,IAAI,CACrBC,cAAM,CAACC,OAAO,CAACP,KAAK,CAAC,EACrBM,cAAM,CAACC,OAAO,CAACC,wBAAW,CAACC,OAAO,CAAC,CACpC;IACD,MAAMC,GAAG,GAAGJ,cAAM,CAACK,OAAO,CAACR,IAAI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
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.UserId = exports.SortSettings = exports.SocialGraph = exports.RegexNegationMatches = exports.RegexMatches = exports.RecordName = exports.Order = exports.Or = exports.Metadata = exports.ListUri = exports.ListMemberFilter = exports.FullForm = exports.Filter = exports.FeedId = exports.EntityExcludesLabels = exports.EmbedType = exports.DisplayName = exports.Description = exports.ContentModerationBlock = exports.AttributeValue = exports.AttributeName = exports.AttributeComparison = exports.AttributeCompare = exports.And = exports.AlgorithmManifest = void 0;
|
|
7
|
+
var _effect = require("effect");
|
|
8
|
+
// ------------------- Primitives ---------------------------------
|
|
9
|
+
const ListUri = exports.ListUri = _effect.Schema.String;
|
|
10
|
+
const AttributeName = exports.AttributeName = /*#__PURE__*/_effect.Schema.Union(/*#__PURE__*/_effect.Schema.Literal("text"), /*#__PURE__*/_effect.Schema.Literal("reply"), /*#__PURE__*/_effect.Schema.Literal("embed.images[*].alt"), /*#__PURE__*/_effect.Schema.Literal("embed.alt"), /*#__PURE__*/_effect.Schema.Literal("embed"), /*#__PURE__*/_effect.Schema.Literal("embed.external.uri"), /*#__PURE__*/_effect.Schema.Literal("embed.external.title"), /*#__PURE__*/_effect.Schema.Literal("embed.external.description"));
|
|
11
|
+
const AttributeComparison = exports.AttributeComparison = /*#__PURE__*/_effect.Schema.Literal("==", "!=", ">", "<", ">=", "<=");
|
|
12
|
+
const AttributeValue = exports.AttributeValue = _effect.Schema.Null;
|
|
13
|
+
const Filter = exports.Filter = /*#__PURE__*/_effect.Schema.Union(/*#__PURE__*/_effect.Schema.suspend(() => And), /*#__PURE__*/_effect.Schema.suspend(() => Or), /*#__PURE__*/_effect.Schema.suspend(() => ListMemberFilter), /*#__PURE__*/_effect.Schema.suspend(() => AttributeCompare), /*#__PURE__*/_effect.Schema.suspend(() => RegexMatches), /*#__PURE__*/_effect.Schema.suspend(() => RegexNegationMatches), /*#__PURE__*/_effect.Schema.suspend(() => ContentModerationBlock), /*#__PURE__*/_effect.Schema.suspend(() => EntityExcludesLabels), /*#__PURE__*/_effect.Schema.suspend(() => EmbedType), /*#__PURE__*/_effect.Schema.suspend(() => SocialGraph));
|
|
14
|
+
const Or = exports.Or = /*#__PURE__*/_effect.Schema.Struct({
|
|
15
|
+
or: /*#__PURE__*/_effect.Schema.Array(Filter)
|
|
16
|
+
});
|
|
17
|
+
const And = exports.And = /*#__PURE__*/_effect.Schema.Struct({
|
|
18
|
+
and: /*#__PURE__*/_effect.Schema.Array(Filter)
|
|
19
|
+
});
|
|
20
|
+
const ListMemberFilter = exports.ListMemberFilter = /*#__PURE__*/_effect.Schema.Struct({
|
|
21
|
+
list_member: /*#__PURE__*/_effect.Schema.Tuple(ListUri, /*#__PURE__*/_effect.Schema.Literal("in", "not_in"))
|
|
22
|
+
});
|
|
23
|
+
const AttributeCompare = exports.AttributeCompare = /*#__PURE__*/_effect.Schema.Struct({
|
|
24
|
+
attribute_compare: /*#__PURE__*/_effect.Schema.Tuple(AttributeName, AttributeComparison, AttributeValue)
|
|
25
|
+
});
|
|
26
|
+
const RegexMatchBase = /*#__PURE__*/_effect.Schema.Tuple(AttributeName, /*#__PURE__*/_effect.Schema.String.annotations({
|
|
27
|
+
title: "Regex Pattern",
|
|
28
|
+
description: "The source of the regex pattern to match against."
|
|
29
|
+
}), /*#__PURE__*/_effect.Schema.Boolean.annotations({
|
|
30
|
+
title: "Case Insensitive?",
|
|
31
|
+
description: "True if the regex should be case insensitive."
|
|
32
|
+
}));
|
|
33
|
+
const RegexMatches = exports.RegexMatches = /*#__PURE__*/_effect.Schema.Struct({
|
|
34
|
+
regex_matches: RegexMatchBase
|
|
35
|
+
});
|
|
36
|
+
const RegexNegationMatches = exports.RegexNegationMatches = /*#__PURE__*/_effect.Schema.Struct({
|
|
37
|
+
regex_negation_matches: RegexMatchBase
|
|
38
|
+
});
|
|
39
|
+
const ContentModerationBlock = exports.ContentModerationBlock = /*#__PURE__*/_effect.Schema.Struct({
|
|
40
|
+
content_moderation: /*#__PURE__*/_effect.Schema.Tuple(/*#__PURE__*/_effect.Schema.Literal("OK"), /*#__PURE__*/_effect.Schema.Literal(">="), /*#__PURE__*/_effect.Schema.Number.annotations({
|
|
41
|
+
title: "Threshold",
|
|
42
|
+
description: "The threshold for content moderation."
|
|
43
|
+
}))
|
|
44
|
+
});
|
|
45
|
+
const EntityExcludesLabels = exports.EntityExcludesLabels = /*#__PURE__*/_effect.Schema.Struct({
|
|
46
|
+
entity_excludes: /*#__PURE__*/_effect.Schema.Tuple(/*#__PURE__*/_effect.Schema.Literal("labels"), /*#__PURE__*/_effect.Schema.Tuple(/*#__PURE__*/_effect.Schema.Literal("porn"), /*#__PURE__*/_effect.Schema.Literal("sexual"), /*#__PURE__*/_effect.Schema.Literal("nudity")))
|
|
47
|
+
});
|
|
48
|
+
const EmbedType = exports.EmbedType = /*#__PURE__*/_effect.Schema.Struct({
|
|
49
|
+
embed_type: /*#__PURE__*/_effect.Schema.Tuple(/*#__PURE__*/_effect.Schema.Literal("==", "!="), /*#__PURE__*/_effect.Schema.Literal("video", "image", "link", "post", "gif", "image_group"))
|
|
50
|
+
});
|
|
51
|
+
const SocialGraph = exports.SocialGraph = /*#__PURE__*/_effect.Schema.Struct({
|
|
52
|
+
social_graph: /*#__PURE__*/_effect.Schema.Tuple(_effect.Schema.String, /*#__PURE__*/_effect.Schema.Literal("in", "not_in"), /*#__PURE__*/_effect.Schema.Literal("follows", "followers"))
|
|
53
|
+
});
|
|
54
|
+
// ---------------------- Sort Settings -----------------------------
|
|
55
|
+
const SortSettings = exports.SortSettings = /*#__PURE__*/_effect.Schema.Struct({
|
|
56
|
+
time_window: _effect.Schema.Number,
|
|
57
|
+
decay_penalty: _effect.Schema.Number,
|
|
58
|
+
like_count_multiplier: _effect.Schema.Number,
|
|
59
|
+
reply_count_multiplier: _effect.Schema.Number,
|
|
60
|
+
repost_count_multiplier: _effect.Schema.Number,
|
|
61
|
+
reader_like_count_multiplier: _effect.Schema.Number,
|
|
62
|
+
reader_reply_count_multiplier: _effect.Schema.Number,
|
|
63
|
+
reader_repost_count_multiplier: _effect.Schema.Number
|
|
64
|
+
});
|
|
65
|
+
// ---------------------- Form Data ---------------------------------
|
|
66
|
+
const DisplayName = exports.DisplayName = /*#__PURE__*/_effect.Schema.String.annotations({
|
|
67
|
+
description: "The public name of the feed."
|
|
68
|
+
});
|
|
69
|
+
const RecordName = exports.RecordName = /*#__PURE__*/_effect.Schema.String.annotations({
|
|
70
|
+
description: "The slug of the feed url."
|
|
71
|
+
});
|
|
72
|
+
const Description = exports.Description = /*#__PURE__*/_effect.Schema.String.annotations({
|
|
73
|
+
description: "The description to be shown to users of the feed."
|
|
74
|
+
});
|
|
75
|
+
const Order = exports.Order = /*#__PURE__*/_effect.Schema.Union(/*#__PURE__*/_effect.Schema.Literal("new"), /*#__PURE__*/_effect.Schema.Literal("trending"), /*#__PURE__*/_effect.Schema.Literal("blend"));
|
|
76
|
+
const FeedId = exports.FeedId = _effect.Schema.NumberFromString;
|
|
77
|
+
const UserId = exports.UserId = _effect.Schema.NumberFromString;
|
|
78
|
+
const AlgorithmManifest = exports.AlgorithmManifest = /*#__PURE__*/_effect.Schema.Struct({
|
|
79
|
+
filter: Filter,
|
|
80
|
+
sort_settings: /*#__PURE__*/_effect.Schema.optional(SortSettings)
|
|
81
|
+
});
|
|
82
|
+
const Metadata = exports.Metadata = /*#__PURE__*/_effect.Schema.Struct({
|
|
83
|
+
document: /*#__PURE__*/_effect.Schema.optional(_effect.Schema.Unknown),
|
|
84
|
+
schema: /*#__PURE__*/_effect.Schema.optional(/*#__PURE__*/_effect.Schema.Struct({
|
|
85
|
+
schemaVersion: /*#__PURE__*/_effect.Schema.Literal(2),
|
|
86
|
+
sequences: /*#__PURE__*/_effect.Schema.Record({
|
|
87
|
+
key: _effect.Schema.String,
|
|
88
|
+
value: _effect.Schema.Number
|
|
89
|
+
})
|
|
90
|
+
})),
|
|
91
|
+
session: /*#__PURE__*/_effect.Schema.optional(_effect.Schema.Unknown)
|
|
92
|
+
});
|
|
93
|
+
const FullForm = exports.FullForm = /*#__PURE__*/_effect.Schema.Struct({
|
|
94
|
+
id: FeedId,
|
|
95
|
+
user_id: UserId,
|
|
96
|
+
file: /*#__PURE__*/_effect.Schema.optional(_effect.Schema.Unknown),
|
|
97
|
+
display_name: DisplayName,
|
|
98
|
+
record_name: RecordName,
|
|
99
|
+
description: /*#__PURE__*/_effect.Schema.optional(Description),
|
|
100
|
+
order: Order,
|
|
101
|
+
algorithm_manifest: /*#__PURE__*/_effect.Schema.parseJson(AlgorithmManifest),
|
|
102
|
+
metadata: /*#__PURE__*/_effect.Schema.optional(/*#__PURE__*/_effect.Schema.parseJson(Metadata))
|
|
103
|
+
});
|
|
104
|
+
/**
|
|
105
|
+
* Actual structure of FormData
|
|
106
|
+
*
|
|
107
|
+
* display_name
|
|
108
|
+
* record_name
|
|
109
|
+
* description
|
|
110
|
+
* order
|
|
111
|
+
* algorithm_manifest
|
|
112
|
+
* metadata
|
|
113
|
+
* id
|
|
114
|
+
* user_id
|
|
115
|
+
* session_cookie
|
|
116
|
+
*/
|
|
117
|
+
//# sourceMappingURL=UpdateAlgorithmPayload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UpdateAlgorithmPayload.js","names":["_effect","require","ListUri","exports","S","String","AttributeName","Union","Literal","AttributeComparison","AttributeValue","Null","Filter","suspend","And","Or","ListMemberFilter","AttributeCompare","RegexMatches","RegexNegationMatches","ContentModerationBlock","EntityExcludesLabels","EmbedType","SocialGraph","Struct","or","Array","and","list_member","Tuple","attribute_compare","RegexMatchBase","annotations","title","description","Boolean","regex_matches","regex_negation_matches","content_moderation","Number","entity_excludes","embed_type","social_graph","SortSettings","time_window","decay_penalty","like_count_multiplier","reply_count_multiplier","repost_count_multiplier","reader_like_count_multiplier","reader_reply_count_multiplier","reader_repost_count_multiplier","DisplayName","RecordName","Description","Order","FeedId","NumberFromString","UserId","AlgorithmManifest","filter","sort_settings","optional","Metadata","document","Unknown","schema","schemaVersion","sequences","Record","key","value","session","FullForm","id","user_id","file","display_name","record_name","order","algorithm_manifest","parseJson","metadata"],"sources":["../../../src/schema/UpdateAlgorithmPayload.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA;AAEO,MAAMC,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAGE,cAAC,CAACC,MAAM;AAGxB,MAAMC,aAAa,GAAAH,OAAA,CAAAG,aAAA,gBAAGF,cAAC,CAACG,KAAK,cAClCH,cAAC,CAACI,OAAO,CAAC,MAAM,CAAC,eACjBJ,cAAC,CAACI,OAAO,CAAC,OAAO,CAAC,eAClBJ,cAAC,CAACI,OAAO,CAAC,qBAAqB,CAAC,eAChCJ,cAAC,CAACI,OAAO,CAAC,WAAW,CAAC,eACtBJ,cAAC,CAACI,OAAO,CAAC,OAAO,CAAC,eAClBJ,cAAC,CAACI,OAAO,CAAC,oBAAoB,CAAC,eAC/BJ,cAAC,CAACI,OAAO,CAAC,sBAAsB,CAAC,eACjCJ,cAAC,CAACI,OAAO,CAAC,4BAA4B,CAAC,CACxC;AAEM,MAAMC,mBAAmB,GAAAN,OAAA,CAAAM,mBAAA,gBAAGL,cAAC,CAACI,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC;AAEvE,MAAME,cAAc,GAAAP,OAAA,CAAAO,cAAA,GAAGN,cAAC,CAACO,IAAI;AAmD7B,MAAMC,MAAM,GAAAT,OAAA,CAAAS,MAAA,gBAAGR,cAAC,CAACG,KAAK,cAC3BH,cAAC,CAACS,OAAO,CAAC,MAAqBC,GAAG,CAAC,eACnCV,cAAC,CAACS,OAAO,CAAC,MAAoBE,EAAE,CAAC,eACjCX,cAAC,CAACS,OAAO,CAAC,MAA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AAM;EACfkB,IAAI,eAAExE,cAAC,CAAC0D,QAAQ,CAAC1D,cAAC,CAAC6D,OAAO,CAAC;EAC3BY,YAAY,EAAEzB,WAAW;EACzB0B,WAAW,EAAEzB,UAAU;EACvBnB,WAAW,eAAE9B,cAAC,CAAC0D,QAAQ,CAACR,WAAW,CAAC;EACpCyB,KAAK,EAAExB,KAAK;EACZyB,kBAAkB,eAAE5E,cAAC,CAAC6E,SAAS,CAACtB,iBAAiB,CAAC;EAClDuB,QAAQ,eAAE9E,cAAC,CAAC0D,QAAQ,cAAC1D,cAAC,CAAC6E,SAAS,CAAClB,QAAQ,CAAC;CAC3C,CAAC;AAIF","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _shared = require("./shared.js");
|
|
7
|
+
Object.keys(_shared).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _shared[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () {
|
|
13
|
+
return _shared[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _UpdateAlgorithmPayload = require("./UpdateAlgorithmPayload.js");
|
|
18
|
+
Object.keys(_UpdateAlgorithmPayload).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _UpdateAlgorithmPayload[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _UpdateAlgorithmPayload[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_shared","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_UpdateAlgorithmPayload"],"sources":["../../../src/schema/index.ts"],"sourcesContent":[null],"mappings":";;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,OAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,OAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,OAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,uBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,uBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,uBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,uBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.PartialAlgorithm = exports.HidePostBody = exports.GetAlgorithmsResponse = exports.GetAlgoResponse = exports.AlgorithWithStats = exports.AlgoUpdateResponse = void 0;
|
|
7
|
+
var _effect = require("effect");
|
|
8
|
+
const PartialAlgorithm = exports.PartialAlgorithm = /*#__PURE__*/_effect.Schema.Struct({
|
|
9
|
+
algorithm_uri: _effect.Schema.String,
|
|
10
|
+
algorithm_manifest_id: /*#__PURE__*/_effect.Schema.Union(_effect.Schema.Null, _effect.Schema.Number),
|
|
11
|
+
draft_algorithm_manifest_id: _effect.Schema.Number,
|
|
12
|
+
record_name: _effect.Schema.String,
|
|
13
|
+
display_name: _effect.Schema.String,
|
|
14
|
+
description: _effect.Schema.String,
|
|
15
|
+
feed_did: _effect.Schema.String,
|
|
16
|
+
avatar_url: /*#__PURE__*/_effect.Schema.Union(_effect.Schema.String, _effect.Schema.Null),
|
|
17
|
+
cpm_cents: /*#__PURE__*/_effect.Schema.Union(_effect.Schema.Number, _effect.Schema.Null),
|
|
18
|
+
deleted: _effect.Schema.Boolean,
|
|
19
|
+
active: _effect.Schema.Boolean,
|
|
20
|
+
public: _effect.Schema.Boolean,
|
|
21
|
+
monetization_available: _effect.Schema.Boolean,
|
|
22
|
+
status: /*#__PURE__*/_effect.Schema.Union(_effect.Schema.String, _effect.Schema.Null),
|
|
23
|
+
unique_operator_ids: /*#__PURE__*/_effect.Schema.Array(_effect.Schema.Number),
|
|
24
|
+
user_id: _effect.Schema.Number,
|
|
25
|
+
id: _effect.Schema.Number,
|
|
26
|
+
created_at: _effect.Schema.DateFromString,
|
|
27
|
+
updated_at: _effect.Schema.DateFromString,
|
|
28
|
+
deleted_at: /*#__PURE__*/_effect.Schema.Union(_effect.Schema.DateFromString, _effect.Schema.Null)
|
|
29
|
+
});
|
|
30
|
+
const Stats = _effect.Schema.Unknown;
|
|
31
|
+
const LatestError = _effect.Schema.Unknown;
|
|
32
|
+
const FullAlgorithm = /*#__PURE__*/_effect.Schema.Struct({
|
|
33
|
+
...PartialAlgorithm.fields,
|
|
34
|
+
stats: Stats,
|
|
35
|
+
latest_error: LatestError,
|
|
36
|
+
latest_compute_cycle: _effect.Schema.Unknown,
|
|
37
|
+
subscriber_lists: _effect.Schema.Unknown
|
|
38
|
+
});
|
|
39
|
+
const FullAlgorithmWithManifest = /*#__PURE__*/_effect.Schema.Struct({
|
|
40
|
+
...FullAlgorithm.fields,
|
|
41
|
+
draft_algorithm_manifest: _effect.Schema.Unknown,
|
|
42
|
+
algorithm_manifest: _effect.Schema.Unknown
|
|
43
|
+
});
|
|
44
|
+
const AlgoUpdateResponse = exports.AlgoUpdateResponse = /*#__PURE__*/_effect.Schema.Struct({
|
|
45
|
+
message: _effect.Schema.String,
|
|
46
|
+
algorithm: PartialAlgorithm
|
|
47
|
+
});
|
|
48
|
+
const GetAlgoResponse = exports.GetAlgoResponse = /*#__PURE__*/_effect.Schema.parseJson(FullAlgorithmWithManifest);
|
|
49
|
+
const HidePostBody = exports.HidePostBody = /*#__PURE__*/_effect.Schema.Struct({
|
|
50
|
+
algo_id: _effect.Schema.Number,
|
|
51
|
+
at_uri: _effect.Schema.String
|
|
52
|
+
});
|
|
53
|
+
// ----------------------- Get Algorithms Response -----------------------
|
|
54
|
+
const AlgorithWithStats = exports.AlgorithWithStats = /*#__PURE__*/_effect.Schema.Struct({
|
|
55
|
+
...PartialAlgorithm.fields,
|
|
56
|
+
stats: /*#__PURE__*/_effect.Schema.Struct({
|
|
57
|
+
page_renders: _effect.Schema.Number,
|
|
58
|
+
unique_users: _effect.Schema.Number,
|
|
59
|
+
post_renders: _effect.Schema.Number
|
|
60
|
+
})
|
|
61
|
+
});
|
|
62
|
+
const GetAlgorithmsResponse = exports.GetAlgorithmsResponse = /*#__PURE__*/_effect.Schema.Struct({
|
|
63
|
+
page: _effect.Schema.Number,
|
|
64
|
+
page_size: _effect.Schema.Number,
|
|
65
|
+
total_items: _effect.Schema.Number,
|
|
66
|
+
total_pages: _effect.Schema.Number,
|
|
67
|
+
user_algos: /*#__PURE__*/_effect.Schema.Array(AlgorithWithStats)
|
|
68
|
+
});
|
|
69
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","names":["_effect","require","PartialAlgorithm","exports","S","Struct","algorithm_uri","String","algorithm_manifest_id","Union","Null","Number","draft_algorithm_manifest_id","record_name","display_name","description","feed_did","avatar_url","cpm_cents","deleted","Boolean","active","public","monetization_available","status","unique_operator_ids","Array","user_id","id","created_at","DateFromString","updated_at","deleted_at","Stats","Unknown","LatestError","FullAlgorithm","fields","stats","latest_error","latest_compute_cycle","subscriber_lists","FullAlgorithmWithManifest","draft_algorithm_manifest","algorithm_manifest","AlgoUpdateResponse","message","algorithm","GetAlgoResponse","parseJson","HidePostBody","algo_id","at_uri","AlgorithWithStats","page_renders","unique_users","post_renders","GetAlgorithmsResponse","page","page_size","total_items","total_pages","user_algos"],"sources":["../../../src/schema/shared.ts"],"sourcesContent":[null],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEO,MAAMC,gBAAgB,GAAAC,OAAA,CAAAD,gBAAA,gBAAGE,cAAC,CAACC,MAAM,CAAC;EACvCC,aAAa,EAAEF,cAAC,CAACG,MAAM;EACvBC,qBAAqB,eAAEJ,cAAC,CAACK,KAAK,CAACL,cAAC,CAACM,IAAI,EAAEN,cAAC,CAACO,MAAM,CAAC;EAChDC,2BAA2B,EAAER,cAAC,CAACO,MAAM;EACrCE,WAAW,EAAET,cAAC,CAACG,MAAM;EACrBO,YAAY,EAAEV,cAAC,CAACG,MAAM;EACtBQ,WAAW,EAAEX,cAAC,CAACG,MAAM;EACrBS,QAAQ,EAAEZ,cAAC,CAACG,MAAM;EAClBU,UAAU,eAAEb,cAAC,CAACK,KAAK,CAACL,cAAC,CAACG,MAAM,EAAEH,cAAC,CAACM,IAAI,CAAC;EACrCQ,SAAS,eAAEd,cAAC,CAACK,KAAK,CAACL,cAAC,CAACO,MAAM,EAAEP,cAAC,CAACM,IAAI,CAAC;EACpCS,OAAO,EAAEf,cAAC,CAACgB,OAAO;EAClBC,MAAM,EAAEjB,cAAC,CAACgB,OAAO;EACjBE,MAAM,EAAElB,cAAC,CAACgB,OAAO;EACjBG,sBAAsB,EAAEnB,cAAC,CAACgB,OAAO;EACjCI,MAAM,eAAEpB,cAAC,CAACK,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AAA,gBAAG9C,cAAC,CAACC,MAAM,CAAC;EACnC8C,OAAO,EAAE/C,cAAC,CAACO,MAAM;EACjByC,MAAM,EAAEhD,cAAC,CAACG;CACX,CAAC;AAGF;AAEO,MAAM8C,iBAAiB,GAAAlD,OAAA,CAAAkD,iBAAA,gBAAGjD,cAAC,CAACC,MAAM,CAAC;EACxC,GAAGH,gBAAgB,CAACmC,MAAM;EAC1BC,KAAK,eAAElC,cAAC,CAACC,MAAM,CAAC;IACdiD,YAAY,EAAElD,cAAC,CAACO,MAAM;IACtB4C,YAAY,EAAEnD,cAAC,CAACO,MAAM;IACtB6C,YAAY,EAAEpD,cAAC,CAACO;GACjB;CACF,CAAC;AAEK,MAAM8C,qBAAqB,GAAAtD,OAAA,CAAAsD,qBAAA,gBAAGrD,cAAC,CAACC,MAAM,CAAC;EAC5CqD,IAAI,EAAEtD,cAAC,CAACO,MAAM;EACdgD,SAAS,EAAEvD,cAAC,CAACO,MAAM;EACnBiD,WAAW,EAAExD,cAAC,CAACO,MAAM;EACrBkD,WAAW,EAAEzD,cAAC,CAACO,MAAM;EACrBmD,UAAU,eAAE1D,cAAC,CAACsB,KAAK,CAAC2B,iBAAiB;CACtC,CAAC","ignoreList":[]}
|
|
@@ -6,12 +6,14 @@ declare const GrazeClient_base: Effect.Service.Class<GrazeClient, "GrazeClient",
|
|
|
6
6
|
updateAlgorithm: (data: Form.FullForm) => Effect.Effect<{
|
|
7
7
|
readonly message: string;
|
|
8
8
|
readonly algorithm: {
|
|
9
|
+
readonly description: string;
|
|
10
|
+
readonly id: number;
|
|
11
|
+
readonly user_id: number;
|
|
12
|
+
readonly display_name: string;
|
|
13
|
+
readonly record_name: string;
|
|
9
14
|
readonly algorithm_uri: string;
|
|
10
15
|
readonly algorithm_manifest_id: number | null;
|
|
11
16
|
readonly draft_algorithm_manifest_id: number;
|
|
12
|
-
readonly record_name: string;
|
|
13
|
-
readonly display_name: string;
|
|
14
|
-
readonly description: string;
|
|
15
17
|
readonly feed_did: string;
|
|
16
18
|
readonly avatar_url: string | null;
|
|
17
19
|
readonly cpm_cents: number | null;
|
|
@@ -21,8 +23,6 @@ declare const GrazeClient_base: Effect.Service.Class<GrazeClient, "GrazeClient",
|
|
|
21
23
|
readonly monetization_available: boolean;
|
|
22
24
|
readonly status: string | null;
|
|
23
25
|
readonly unique_operator_ids: readonly number[];
|
|
24
|
-
readonly user_id: number;
|
|
25
|
-
readonly id: number;
|
|
26
26
|
readonly created_at: Date;
|
|
27
27
|
readonly updated_at: Date;
|
|
28
28
|
readonly deleted_at: Date | null;
|
|
@@ -34,12 +34,14 @@ declare const GrazeClient_base: Effect.Service.Class<GrazeClient, "GrazeClient",
|
|
|
34
34
|
readonly total_items: number;
|
|
35
35
|
readonly total_pages: number;
|
|
36
36
|
readonly user_algos: readonly {
|
|
37
|
+
readonly description: string;
|
|
38
|
+
readonly id: number;
|
|
39
|
+
readonly user_id: number;
|
|
40
|
+
readonly display_name: string;
|
|
41
|
+
readonly record_name: string;
|
|
37
42
|
readonly algorithm_uri: string;
|
|
38
43
|
readonly algorithm_manifest_id: number | null;
|
|
39
44
|
readonly draft_algorithm_manifest_id: number;
|
|
40
|
-
readonly record_name: string;
|
|
41
|
-
readonly display_name: string;
|
|
42
|
-
readonly description: string;
|
|
43
45
|
readonly feed_did: string;
|
|
44
46
|
readonly avatar_url: string | null;
|
|
45
47
|
readonly cpm_cents: number | null;
|
|
@@ -49,8 +51,6 @@ declare const GrazeClient_base: Effect.Service.Class<GrazeClient, "GrazeClient",
|
|
|
49
51
|
readonly monetization_available: boolean;
|
|
50
52
|
readonly status: string | null;
|
|
51
53
|
readonly unique_operator_ids: readonly number[];
|
|
52
|
-
readonly user_id: number;
|
|
53
|
-
readonly id: number;
|
|
54
54
|
readonly created_at: Date;
|
|
55
55
|
readonly updated_at: Date;
|
|
56
56
|
readonly deleted_at: Date | null;
|
|
@@ -67,12 +67,15 @@ declare const GrazeClient_base: Effect.Service.Class<GrazeClient, "GrazeClient",
|
|
|
67
67
|
};
|
|
68
68
|
readonly withResponse?: WithResponse;
|
|
69
69
|
}) => Effect.Effect<WithResponse extends true ? [{
|
|
70
|
+
readonly description: string;
|
|
71
|
+
readonly id: number;
|
|
72
|
+
readonly user_id: number;
|
|
73
|
+
readonly display_name: string;
|
|
74
|
+
readonly record_name: string;
|
|
75
|
+
readonly algorithm_manifest: unknown;
|
|
70
76
|
readonly algorithm_uri: string;
|
|
71
77
|
readonly algorithm_manifest_id: number | null;
|
|
72
78
|
readonly draft_algorithm_manifest_id: number;
|
|
73
|
-
readonly record_name: string;
|
|
74
|
-
readonly display_name: string;
|
|
75
|
-
readonly description: string;
|
|
76
79
|
readonly feed_did: string;
|
|
77
80
|
readonly avatar_url: string | null;
|
|
78
81
|
readonly cpm_cents: number | null;
|
|
@@ -82,8 +85,6 @@ declare const GrazeClient_base: Effect.Service.Class<GrazeClient, "GrazeClient",
|
|
|
82
85
|
readonly monetization_available: boolean;
|
|
83
86
|
readonly status: string | null;
|
|
84
87
|
readonly unique_operator_ids: readonly number[];
|
|
85
|
-
readonly user_id: number;
|
|
86
|
-
readonly id: number;
|
|
87
88
|
readonly created_at: Date;
|
|
88
89
|
readonly updated_at: Date;
|
|
89
90
|
readonly deleted_at: Date | null;
|
|
@@ -92,14 +93,16 @@ declare const GrazeClient_base: Effect.Service.Class<GrazeClient, "GrazeClient",
|
|
|
92
93
|
readonly latest_compute_cycle: unknown;
|
|
93
94
|
readonly subscriber_lists: unknown;
|
|
94
95
|
readonly draft_algorithm_manifest: unknown;
|
|
95
|
-
readonly algorithm_manifest: unknown;
|
|
96
96
|
}, import("@effect/platform/HttpClientResponse").HttpClientResponse] : {
|
|
97
|
+
readonly description: string;
|
|
98
|
+
readonly id: number;
|
|
99
|
+
readonly user_id: number;
|
|
100
|
+
readonly display_name: string;
|
|
101
|
+
readonly record_name: string;
|
|
102
|
+
readonly algorithm_manifest: unknown;
|
|
97
103
|
readonly algorithm_uri: string;
|
|
98
104
|
readonly algorithm_manifest_id: number | null;
|
|
99
105
|
readonly draft_algorithm_manifest_id: number;
|
|
100
|
-
readonly record_name: string;
|
|
101
|
-
readonly display_name: string;
|
|
102
|
-
readonly description: string;
|
|
103
106
|
readonly feed_did: string;
|
|
104
107
|
readonly avatar_url: string | null;
|
|
105
108
|
readonly cpm_cents: number | null;
|
|
@@ -109,8 +112,6 @@ declare const GrazeClient_base: Effect.Service.Class<GrazeClient, "GrazeClient",
|
|
|
109
112
|
readonly monetization_available: boolean;
|
|
110
113
|
readonly status: string | null;
|
|
111
114
|
readonly unique_operator_ids: readonly number[];
|
|
112
|
-
readonly user_id: number;
|
|
113
|
-
readonly id: number;
|
|
114
115
|
readonly created_at: Date;
|
|
115
116
|
readonly updated_at: Date;
|
|
116
117
|
readonly deleted_at: Date | null;
|
|
@@ -119,7 +120,6 @@ declare const GrazeClient_base: Effect.Service.Class<GrazeClient, "GrazeClient",
|
|
|
119
120
|
readonly latest_compute_cycle: unknown;
|
|
120
121
|
readonly subscriber_lists: unknown;
|
|
121
122
|
readonly draft_algorithm_manifest: unknown;
|
|
122
|
-
readonly algorithm_manifest: unknown;
|
|
123
123
|
}, import("@effect/platform/HttpApiError").HttpApiDecodeError | import("@effect/platform/HttpClientError").HttpClientError, never>;
|
|
124
124
|
publishAlgorithm: <WithResponse extends boolean = false>(request: {
|
|
125
125
|
readonly path: {
|