repo stringlengths 5 106 | file_url stringlengths 78 301 | file_path stringlengths 4 211 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:56:49 2026-01-05 02:23:25 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-filtering/block-based-on-ip/main.js | edgecompute/examples/traffic-filtering/block-based-on-ip/main.js | /*
(c) Copyright 2024 Akamai Technologies, Inc. Licensed under Apache 2 license.
Purpose: Block by IP address
*/
import { blockedIPs } from './ipList.js';
export async function onClientRequest(request) {
if (blockedIPs.includes(request.clientIp)) {
request.respondWith(
403,
{ 'Co... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-filtering/block-based-on-ip/ipList.js | edgecompute/examples/traffic-filtering/block-based-on-ip/ipList.js | export const blockedIPs = [
'1.2.3.4',
'5.6.7.8'
]; | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/ab-test (EKV)/main.js | edgecompute/examples/traffic-routing/ab-test (EKV)/main.js | import { Cookies, SetCookie } from 'cookies';
import { logger } from 'log';
import { EdgeKV } from './edgekv.js';
const default_path = "ekv_experience/default";
const edgeKv_abpath = new EdgeKV({namespace: "default", group: "abpath"});
export async function onClientRequest(request) {
let cookies = new Cookies(requ... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/ab-test (EKV)/edgekv_tokens.js | edgecompute/examples/traffic-routing/ab-test (EKV)/edgekv_tokens.js | var edgekv_access_tokens = {
"namespace-default": {
"name": "default_token",
"value": "insert_customer_token_here"
}
}
export { edgekv_access_tokens };
| javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/redirect-unauthenticated/main.js | edgecompute/examples/traffic-routing/redirect-unauthenticated/main.js | /*
(c) Copyright 2019 Akamai Technologies, Inc. Licensed under Apache 2 license.
Version: 0.1
Purpose: Redirect to login page if request unauthenticated.
*/
// import the Cookies helper module
import { Cookies } from 'cookies';
const loginPageURL = 'http://www.example.com/signin?redirect_url=';
export function on... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/redirect-liquidator/src/main.js | edgecompute/examples/traffic-routing/redirect-liquidator/src/main.js | import { httpRequest } from 'http-request';
import { createResponse } from 'create-response';
import { HtmlRewritingStream } from 'html-rewriter';
const REDIRECT_CODES=[301,302,303,307,308];
const INJECT_AFTER_TAG = 'title';
const UNSAFE_RESPONSE_HEADERS=['content-length', 'transfer-encoding', 'connection', 'vary','a... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/ab-test (EW)/main.js | edgecompute/examples/traffic-routing/ab-test (EW)/main.js | /*
(c) Copyright 2020 Akamai Technologies, Inc. Licensed under Apache 2 license.
Version: 0.1
Purpose:
Enable A/B testing.
Randomly assign new users to an A/B testing group.
Include the A/B group in a query parameter sent to the origin.
Include the A/B group in a cookie to the browser.
Allow overriding the g... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/clone-request/src/main.js | edgecompute/examples/traffic-routing/clone-request/src/main.js | import { httpRequest } from 'http-request';
import { createResponse } from 'create-response';
import { logger } from 'log';
// Add/remove unsafe headers from this list as required. This headers will be removed form origin response before sending to client.
const UNSAFE_RESPONSE_HEADERS = ['content-length', 'transfer-e... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/redirect-geo/main.js | edgecompute/examples/traffic-routing/redirect-geo/main.js | /*
(c) Copyright 2019 Akamai Technologies, Inc. Licensed under Apache 2 license.
Version: 0.1
Purpose: Using EdgeScape geo data, redirect user to country specific content
*/
// define country top level domain mapping
const tldMap = {
CA: '.ca',
GB: '.co.uk',
US: '.com'
};
export function onClientRequest (requ... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/multivariate-test/main.js | edgecompute/examples/traffic-routing/multivariate-test/main.js | /*
(c) Copyright 2020 Akamai Technologies, Inc. Licensed under Apache 2 license.
Version: 0.1
Purpose:
Enable mulitvariate testing.
Provides the capaility to simultaneously run multiple independent tests
Randomly assign new users to a variant in each group
Weights can be assigned to each variant within a test.... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/redirect-url (EKV)/main.js | edgecompute/examples/traffic-routing/redirect-url (EKV)/main.js | import { EdgeKV } from './edgekv.js';
// Initialize EdgeKV library
const edgeKv_products = new EdgeKV({namespace: "default", group: "url-redirects"});
// Regex to match URL
const URL_REGEX = /\/sku\/(?<sku>[a-zA-Z0-9]+)\/(?<suffix>.*)/;
export async function onClientRequest(request) {
let regexMatch = request.ur... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/redirect-url (EKV)/edgekv_tokens.js | edgecompute/examples/traffic-routing/redirect-url (EKV)/edgekv_tokens.js | var edgekv_access_tokens = {
"namespace-default": {
"name": "default_token",
"value": "insert_customer_token_here"
}
}
export { edgekv_access_tokens }; | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/ab-test-caching (EKV)/main.js | edgecompute/examples/traffic-routing/ab-test-caching (EKV)/main.js | import { Cookies, SetCookie } from 'cookies';
import { logger } from 'log';
import { EdgeKV } from './edgekv.js';
const edgeKv_abpath = new EdgeKV({namespace: "vpanchak", group: "ab-data"});
export async function onClientRequest(request) {
let abConfig = await edgeKv_abpath.getJson({ item: "ab-config"});
let... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/traffic-routing/ab-test-caching (EKV)/edgekv_tokens.js | edgecompute/examples/traffic-routing/ab-test-caching (EKV)/edgekv_tokens.js | var edgekv_access_tokens = {
"namespace-default": {
"name": "default_token",
"value": "insert_customer_token_here"
}
}
export { edgekv_access_tokens }; | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/product-augmentation/mpulse-currency-converter (EKV)/main.js | edgecompute/examples/product-augmentation/mpulse-currency-converter (EKV)/main.js | /*
(c) Copyright 2020 Akamai Technologies, Inc. Licensed under Apache 2 license.
Purpose: Convert multiple currencies to one to support mPulse
*/
import { ReadableStream, WritableStream } from "streams";
import { httpRequest } from "http-request";
import { createResponse } from "create-response";
import { TextEncoder... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/product-augmentation/mpulse-currency-converter (EKV)/edgekv_tokens.js | edgecompute/examples/product-augmentation/mpulse-currency-converter (EKV)/edgekv_tokens.js | var edgekv_access_tokens = {
"namespace-currencies": {
name: "my_token",
value: "my_value",
},
};
export { edgekv_access_tokens };
| javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/product-augmentation/image-manager-and-serverless (EKV)/pristine-ew/main.js | edgecompute/examples/product-augmentation/image-manager-and-serverless (EKV)/pristine-ew/main.js | import { EdgeKV } from "./edgekv.js"; //include this file from the parent repository. https://github.com/akamai/edgeworkers-examples/blob/master/edgekv/lib/edgekv.js
import { logger } from "log";
const edgeKv = new EdgeKV({ namespace: "im", group: "pristine" });
export function onClientResponse(request, response) {
... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/product-augmentation/image-manager-and-serverless (EKV)/pristine-ew/edgekv_tokens.js | edgecompute/examples/product-augmentation/image-manager-and-serverless (EKV)/pristine-ew/edgekv_tokens.js | var edgekv_access_tokens = {
"namespace-default": {
"name": "default_token",
"value": "insert_customer_token_here"
}
}
export { edgekv_access_tokens }; | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/product-augmentation/image-manager-and-serverless (EKV)/derivative-ew/main.js | edgecompute/examples/product-augmentation/image-manager-and-serverless (EKV)/derivative-ew/main.js | import { EdgeKV } from "./edgekv.js"; //include this file from the parent repository. https://github.com/akamai/edgeworkers-examples/blob/master/edgekv/lib/edgekv.js
import { logger } from "log";
const edgeKv = new EdgeKV({ namespace: "im", group: "pristine" });
export async function onClientRequest(request) {
let ... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/product-augmentation/image-manager-and-serverless (EKV)/derivative-ew/edgekv_tokens.js | edgecompute/examples/product-augmentation/image-manager-and-serverless (EKV)/derivative-ew/edgekv_tokens.js | var edgekv_access_tokens = {
"namespace-default": {
"name": "default_token",
"value": "insert_customer_token_here"
}
}
export { edgekv_access_tokens }; | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/security/csp/cspPolicyParser.js | edgecompute/examples/security/csp/cspPolicyParser.js | export const parsePolicy = (policy) => {
const result = {};
policy.split(";").forEach((directive) => {
const [directiveKey, ...directiveValue] = directive.trim().split(/\s+/g);
if (directiveKey && !Object.hasOwnProperty.call(result, directiveKey)) {
result[directiveKey] = directiveVa... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/security/csp/main.js | edgecompute/examples/security/csp/main.js | import {parsePolicy} from './cspPolicyParser.js';
import {HtmlRewritingStream} from 'html-rewriter';
import {httpRequest} from 'http-request';
import {createResponse} from 'create-response';
import {crypto} from 'crypto';
import {btoa} from "encoding";
export async function responseProvider(request) {
//Step 1: C... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/search/fast-autocomplete/main.js | edgecompute/examples/search/fast-autocomplete/main.js | /*
(c) Copyright 2020 Akamai Technologies, Inc. Licensed under Apache 2 license.
Version: 0.1
Purpose: Reply instantly to most popular search terms from the Edge, unpopular terms go forward to origin.
*/
import URLSearchParams from 'url-search-params';
import { default as searchterms } from './searchterms.js';
expor... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/search/fast-autocomplete/searchterms.js | edgecompute/examples/search/fast-autocomplete/searchterms.js | export default {
bmw: [{ label: 'bmw*... (2088)', value: 'bmw*' }, { label: 'BMW M3 (280)', value: 'BMW M3' }, { label: 'BMW M1 (196)', value: 'BMW M1' }, { label: 'BMW 3 (1982-1990) (193)', value: 'BMW 3 (1982-1990)' }, { label: 'BMW 3 (1990-1998) (125)', value: 'BMW 3 (1990-1998)' }, { label: 'BMW 02 (121)', value:... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/search/commerce-categories/main.js | edgecompute/examples/search/commerce-categories/main.js | /*
(c) Copyright 2019 Akamai Technologies, Inc. Licensed under Apache 2 license.
Version: 0.1
Purpose: Serve a commerce category API directly from a small set of data
*/
import URLSearchParams from 'url-search-params';
const categories =
[{
title: 'Furniture',
id: 1040,
desc: 'Desks, c... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/typescript/typescript-module-bundle/rollup.config.js | edgecompute/examples/typescript/typescript-module-bundle/rollup.config.js | import typescript from "@rollup/plugin-typescript";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
export default {
input: "src/main.ts",
output: {
dir: "dist",
format: "es",
},
plugins: [typescript(), commonjs(), resolve()],
};
| javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/error-handling/origin-overload/main.js | edgecompute/examples/error-handling/origin-overload/main.js | /*
(c) Copyright 2019 Akamai Technologies, Inc. Licensed under Apache 2 license.
Version: 0.1
Purpose: Present a useful error page to the user, instead of a plain 503, and include js to automatically retry after the period indicated in the 'Retry-After' header.
*/
/*
onOriginResponse: This event happens as the origin... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/personalization/forward-devicetype/main.js | edgecompute/examples/personalization/forward-devicetype/main.js | /*
(c) Copyright 2019 Akamai Technologies, Inc. Licensed under Apache 2 license.
Version: 0.1
Purpose: Modify forward path based on device type to point to device specific content.
*/
export function onClientRequest (request) {
if (request.device.isMobile) {
request.route({ path: '/mobile' + request.path });
... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/personalization/cookie-geolocation/main.js | edgecompute/examples/personalization/cookie-geolocation/main.js | /*
(c) Copyright 2019 Akamai Technologies, Inc. Licensed under Apache 2 license.
*/
// Import cookies library to provide helper functions
import { SetCookie } from 'cookies';
import { salesRegions } from 'data.js';
// Helper function to find a sales region by state.
function findRegionByState (state) {
return sale... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/personalization/cookie-geolocation/data.js | edgecompute/examples/personalization/cookie-geolocation/data.js | // 2019 Population data from https://www.census.gov/popclock/print.php?component=growth&image=//www.census.gov/popclock/share/images/growth_1561939200.png
const salesRegions = [
{
name: 'Northeast',
states: ['CT', 'MA', 'ME', 'NH', 'NJ', 'NY', 'PA', 'RI', 'VT'],
population: 55982803
},
{
name: 'Mi... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/personalization/cachekey-devicetype/main.js | edgecompute/examples/personalization/cachekey-devicetype/main.js | /*
(c) Copyright 2019 Akamai Technologies, Inc. Licensed under Apache 2 license.
Version: 0.1
Purpose: Include devcie type in cachekey, allows caching of device specific content without changing the url.
*/
export function onClientRequest (request) {
request.setVariable('PMUSER_DEVICETYPE', 'Desktop');
if (requ... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/personalization/storelocator/main.js | edgecompute/examples/personalization/storelocator/main.js | import URLSearchParams from 'url-search-params';
import KDBush from 'kdbush';
import geokdbush from 'geokdbush';
import locations from './data/locations.json';
// Initialize index of locations
const indexedLocations = new KDBush(locations.elements, (p) => p.lon, (p) => p.lat);
export function onClientRequest (reque... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/personalization/storelocator/rollup.config.js | edgecompute/examples/personalization/storelocator/rollup.config.js | import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import copy from 'rollup-plugin-copy-assets';
import json from 'rollup-plugin-json';
export default {
// Specify main file for EdgeWorker
input: 'main.js',
// Define external modules, which will be provided by the ... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/personalization/validate-promo-code (EKV)/main.js | edgecompute/examples/personalization/validate-promo-code (EKV)/main.js | import URLSearchParams from 'url-search-params';
import { createResponse } from 'create-response';
import { EdgeKV } from './edgekv.js';
function createErrorResponse(message) {
return createResponse(
400,
{'Content-Type':['application/json;charset=utf-8']},
JSON.stringify({error: message})
);
}
functi... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/personalization/validate-promo-code (EKV)/edgekv_tokens.js | edgecompute/examples/personalization/validate-promo-code (EKV)/edgekv_tokens.js | var edgekv_access_tokens = {
"namespace-ecom": {
name: '',
value: ''
}
};
export { edgekv_access_tokens };
| javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/personalization/microservice-geolocation/main.js | edgecompute/examples/personalization/microservice-geolocation/main.js | /*
(c) Copyright 2019 Akamai Technologies, Inc. Licensed under Apache 2 license.
Version: 0.1
Purpose: Respond with JSON formatted geographical location information.
*/
export function onClientRequest (request) {
var info = {};
info.continent = (request.userLocation.continent) ? request.userLocation.continent ... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/103-early-hints/dynamic-ekv/main.js | edgecompute/examples/103-early-hints/dynamic-ekv/main.js | import { EdgeKV } from './edgekv.js'; //You need to add the helper library https://techdocs.akamai.com/edgekv/docs/library-helper-methods
const PMUSER_103_HINTS='PMUSER_103_HINTS';
const edgeKv = new EdgeKV({group: "earlyHints"});
export async function onClientRequest(request){
try {
let data = await edg... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/103-early-hints/basic/main.js | edgecompute/examples/103-early-hints/basic/main.js | const PMUSER_103_HINTS='PMUSER_103_HINTS';
export async function onClientRequest(request){
let hints = [];
hints.push('<https://static1.example.com>;rel=preconnect');
hints.push('<https://cdn.example.com/assets/main.css>;rel=preload;as=style');
hints.push('</assets/main.js>;rel=preload;... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgecompute/examples/103-early-hints/dynamic/main.js | edgecompute/examples/103-early-hints/dynamic/main.js | import { httpRequest } from 'http-request';
const PMUSER_103_HINTS='PMUSER_103_HINTS';
const OPTIONS={timeout:50}; //Cancel Early hints when subrequest takes too long
export async function onClientRequest(request){
try {
let apiResponse = await httpRequest('https://www.yourdomain.com/api/listofresources',OPTIONS... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgekv/utils/edgekv-importer/index.js | edgekv/utils/edgekv-importer/index.js | #!/usr/bin/env node
const os = require('os');
const path = require('path');
const fs = require('fs')
const Bottleneck = require('bottleneck')
const csv = require('csv-parser')
const yargs = require('yargs/yargs');
const EdgeGrid = require('edgegrid');
//console.log( "Hello!" );
function sendEdgeGrid (edgeGrid, me... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/edgekv/lib/edgekv.js | edgekv/lib/edgekv.js | /*
(c) Copyright 2020 Akamai Technologies, Inc. Licensed under Apache 2 license.
Version: 0.6.3
Purpose: Provide a helper class to simplify the interaction with EdgeKV in an EdgeWorker.
Repo: https://github.com/akamai/edgeworkers-examples/tree/master/edgekv/lib
*/
import { TextDecoderStream } from 'text-encode-transf... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/jwt/examples/jwt-hs256/main.js | delivery/common/jwt/examples/jwt-hs256/main.js | import { logger } from 'log';
import { JWTValidator} from './jwt.js';
import { crypto } from 'crypto';
import { base16 } from 'encoding';
//advanced options for jwt validator
const jwtOption = {
//check token expiry
ignoreExpiration: false,
//check token nbf
ignoreNotBefore: false
};
const jwtValidator = new ... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/jwt/examples/jwt-hs256/jwt.js | delivery/common/jwt/examples/jwt-hs256/jwt.js | /** @preserve @version 1.0.1 */
import { crypto } from "crypto";
import { base64url, TextEncoder } from "encoding";
class JWTUtil {
static isEmptyString(str) {
return !str || 0 === str.trim().length;
}
}
class JWTValidator {
constructor(jwtOptions) {
this.jwtOptions = jwtOptions || {}, th... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/jwt/examples/jwt-es256/main.js | delivery/common/jwt/examples/jwt-es256/main.js | import { logger } from 'log';
import { JWTValidator} from './jwt.js';
import { crypto, pem2ab } from 'crypto';
//advanced options for jwt validator
const jwtOption = {
//check token expiry
ignoreExpiration: false,
//check token nbf
ignoreNotBefore: false
};
const jwtValidator = new JWTValidator(jwtOption);
e... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/jwt/examples/jwt-es256/jwt.js | delivery/common/jwt/examples/jwt-es256/jwt.js | /** @preserve @version 1.0.1 */
import { crypto } from "crypto";
import { base64url, TextEncoder } from "encoding";
class JWTUtil {
static isEmptyString(str) {
return !str || 0 === str.trim().length;
}
}
class JWTValidator {
constructor(jwtOptions) {
this.jwtOptions = jwtOptions || {}, th... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/jwt/examples/typescript/rollup.config.js | delivery/common/jwt/examples/typescript/rollup.config.js | import typescript from "@rollup/plugin-typescript";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
export default {
input: "src/main.ts",
output: {
dir: "dist",
format: "es",
},
external: ['crypto', 'encoding', 'log', 'base64'],
plugins: [typescript... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/jwt/examples/typescript/src/jwt/jwt.js | delivery/common/jwt/examples/typescript/src/jwt/jwt.js | /** @preserve @version 1.0.1 */
import { crypto } from "crypto";
import { base64url, TextEncoder } from "encoding";
class JWTUtil {
static isEmptyString(str) {
return !str || 0 === str.trim().length;
}
}
class JWTValidator {
constructor(jwtOptions) {
this.jwtOptions = jwtOptions || {}, th... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/jwt/examples/jwt-rs256/main.js | delivery/common/jwt/examples/jwt-rs256/main.js | import { logger } from 'log';
import { JWTValidator} from './jwt.js';
import { crypto, pem2ab } from 'crypto';
//advanced options for jwt validator
const jwtOption = {
//check token expiry
ignoreExpiration: false,
//check token nbf
ignoreNotBefore: false
};
const jwtValidator = new JWTValidator(jwtOption);
e... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/jwt/examples/jwt-rs256/jwt.js | delivery/common/jwt/examples/jwt-rs256/jwt.js | /** @preserve @version 1.0.1 */
import { crypto } from "crypto";
import { base64url, TextEncoder } from "encoding";
class JWTUtil {
static isEmptyString(str) {
return !str || 0 === str.trim().length;
}
}
class JWTValidator {
constructor(jwtOptions) {
this.jwtOptions = jwtOptions || {}, th... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/jwt/lib/jwt.js | delivery/common/jwt/lib/jwt.js | /** @preserve @version 1.0.1 */
import { crypto } from "crypto";
import { base64url, TextEncoder } from "encoding";
class JWTUtil {
static isEmptyString(str) {
return !str || 0 === str.trim().length;
}
}
class JWTValidator {
constructor(jwtOptions) {
this.jwtOptions = jwtOptions || {}, th... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/cwt/examples/cwt-es256/main.js | delivery/common/cwt/examples/cwt-es256/main.js | import { logger } from 'log';
import { CWTUtil, CWTValidator} from './cwt.js';
import { crypto, pem2ab } from 'crypto';
import { base16 } from 'encoding';
//Integer keys mapping for CWT payload. This mapping is application specific, However keys from 1-7 are reserved
const claimsLabelMap = {
1: 'iss',
2: 'sub',
... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/cwt/examples/cwt-es256/cbor-x.js | delivery/common/cwt/examples/cwt-es256/cbor-x.js | let decoder, src, srcEnd;
try {
decoder = new TextDecoder;
} catch (error) {}
let position$1 = 0;
const RECORD_DEFINITIONS_ID = 57342, RECORD_INLINE_ID = 57343, BUNDLED_STRINGS_ID = 57337, STOP_CODE = {};
let currentStructures, srcString, bundledStrings$1, referenceMap, packedValues, dataView, restoreMapsAsObje... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/cwt/examples/cwt-es256/cwt.js | delivery/common/cwt/examples/cwt-es256/cwt.js | /** @preserve @version 1.1.1 */
import { crypto } from "crypto";
import { Encoder, Decoder } from "./cbor-x.js";
const COSE_Mac0 = 17, COSE_Mac = 97, COSE_Sign = 98, COSE_Sign1 = 18, COSE_Encrypt0 = 16, COSE_Encrypt = 96, coseAlgTags = {
5: "HMAC 256/256",
"-7": "ES256"
}, HeaderLabelToKey_alg = 1, HeaderLabe... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/cwt/examples/cwt-hs256/main.js | delivery/common/cwt/examples/cwt-hs256/main.js | import { logger } from 'log';
import { CWTUtil, CWTValidator} from './cwt.js';
import { crypto } from 'crypto';
import { base16 } from 'encoding';
//Integer keys mapping for CWT payload. This mapping is application specific, However keys from 1-7 are reserved
const claimsLabelMap = {
1: 'iss',
2: 'sub',
3: 'aud... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/cwt/examples/cwt-hs256/cbor-x.js | delivery/common/cwt/examples/cwt-hs256/cbor-x.js | let decoder, src, srcEnd;
try {
decoder = new TextDecoder;
} catch (error) {}
let position$1 = 0;
const STOP_CODE = {};
let currentStructures, srcString, bundledStrings$1, referenceMap, packedValues, dataView, restoreMapsAsObject, currentDecoder = {}, srcStringStart = 0, srcStringEnd = 0, currentExtensions = []... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/cwt/examples/cwt-hs256/cwt.js | delivery/common/cwt/examples/cwt-hs256/cwt.js | /** @preserve @version 1.1.1 */
import { crypto } from "crypto";
import { Encoder, Decoder } from "./cbor-x.js";
const COSE_Mac0 = 17, COSE_Mac = 97, COSE_Sign = 98, COSE_Sign1 = 18, COSE_Encrypt0 = 16, COSE_Encrypt = 96, coseAlgTags = {
5: "HMAC 256/256",
"-7": "ES256"
}, HeaderLabelToKey_alg = 1, HeaderLabe... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/cwt/examples/typescript/rollup.config.js | delivery/common/cwt/examples/typescript/rollup.config.js | import typescript from "@rollup/plugin-typescript";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
export default {
input: "src/main.ts",
output: {
dir: "dist",
format: "es",
},
external: ['crypto', 'encoding', 'log', 'base64'],
plugins: [typescript... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/cwt/examples/typescript/src/cwt/cbor-x.js | delivery/common/cwt/examples/typescript/src/cwt/cbor-x.js | let decoder, src, srcEnd;
try {
decoder = new TextDecoder;
} catch (error) {}
let position$1 = 0;
const STOP_CODE = {};
let currentStructures, srcString, bundledStrings$1, referenceMap, packedValues, dataView, restoreMapsAsObject, currentDecoder = {}, srcStringStart = 0, srcStringEnd = 0, currentExtensions = []... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/cwt/examples/typescript/src/cwt/cwt.js | delivery/common/cwt/examples/typescript/src/cwt/cwt.js | /** @preserve @version 1.1.1 */
import { crypto } from "crypto";
import { Encoder, Decoder } from "./cbor-x.js";
const COSE_Mac0 = 17, COSE_Mac = 97, COSE_Sign = 98, COSE_Sign1 = 18, COSE_Encrypt0 = 16, COSE_Encrypt = 96, coseAlgTags = {
5: "HMAC 256/256",
"-7": "ES256"
}, HeaderLabelToKey_alg = 1, HeaderLabe... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/cwt/lib/cbor-x.js | delivery/common/cwt/lib/cbor-x.js | let decoder, src, srcEnd;
try {
decoder = new TextDecoder;
} catch (error) {}
let position$1 = 0;
const RECORD_DEFINITIONS_ID = 57342, RECORD_INLINE_ID = 57343, BUNDLED_STRINGS_ID = 57337, STOP_CODE = {};
let currentStructures, srcString, bundledStrings$1, referenceMap, packedValues, dataView, restoreMapsAsObje... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/common/cwt/lib/cwt.js | delivery/common/cwt/lib/cwt.js | /** @preserve @version 1.1.1 */
import { crypto } from "crypto";
import { Encoder, Decoder } from "./cbor-x.js";
const COSE_Mac0 = 17, COSE_Mac = 97, COSE_Sign = 98, COSE_Sign1 = 18, COSE_Encrypt0 = 16, COSE_Encrypt = 96, coseAlgTags = {
5: "HMAC 256/256",
"-7": "ES256"
}, HeaderLabelToKey_alg = 1, HeaderLabe... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/token-verification-with-renewal-near-expiry/main.js | delivery/media/cat/examples/token-verification-with-renewal-near-expiry/main.js | import { logger } from 'log';
import { CWTGenerator, CWTValidator } from './cwt.js';
import { HeaderLabelMap, CAT, ClaimsLabelMap, CatRLabelMap, AlgoLabelMap } from './cat.js';
import { TextDecoder, TextEncoder, base16, base64url } from 'encoding';
import { crypto, pem2ab } from 'crypto';
import URLSearchParams from 'u... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/token-verification-with-renewal-near-expiry/cbor-x.js | delivery/media/cat/examples/token-verification-with-renewal-near-expiry/cbor-x.js | let decoder, src, srcEnd;
try {
decoder = new TextDecoder;
} catch (error) {}
let position$1 = 0;
const RECORD_DEFINITIONS_ID = 57342, RECORD_INLINE_ID = 57343, BUNDLED_STRINGS_ID = 57337, STOP_CODE = {};
let currentStructures, srcString, bundledStrings$1, referenceMap, packedValues, dataView, restoreMapsAsObje... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/token-verification-with-renewal-near-expiry/cwt.js | delivery/media/cat/examples/token-verification-with-renewal-near-expiry/cwt.js | /** @preserve @version 1.2.0 */
import { crypto } from "crypto";
import { Encoder, Decoder, Tag } from "./cbor-x.js";
import { logger } from "log";
const COSE_Mac0 = 17, COSE_Mac = 97, COSE_Sign = 98, COSE_Sign1 = 18, COSE_Encrypt0 = 16, COSE_Encrypt = 96, coseAlgTags = {
"-7": "ES256",
5: "HS256"
}, HeaderL... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/token-verification-with-renewal-near-expiry/cat.js | delivery/media/cat/examples/token-verification-with-renewal-near-expiry/cat.js | /** @preserve @version 1.0.2 */
import { Decoder } from "./cbor-x.js";
import { logger } from "log";
import { crypto } from "crypto";
import { base16, TextEncoder } from "encoding";
const HeaderLabelMap = {
alg: 1,
crit: 2,
kid: 4,
IV: 5
}, AlgoLabelMap = {
ES256: -7,
HS256: 5,
PS256: -3... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/simple-token-verification-without-renewal/main.js | delivery/media/cat/examples/simple-token-verification-without-renewal/main.js | import { logger } from 'log';
import { CWTValidator } from './cwt.js';
import { HeaderLabelMap, CAT} from './cat.js';
import { TextDecoder, base16, base64url } from 'encoding';
import { crypto } from 'crypto';
import URLSearchParams from 'url-search-params';
import { Cookies } from 'cookies';
const hs256KeyHex = '4036... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/simple-token-verification-without-renewal/cbor-x.js | delivery/media/cat/examples/simple-token-verification-without-renewal/cbor-x.js | let decoder, src, srcEnd;
try {
decoder = new TextDecoder;
} catch (error) {}
let position$1 = 0;
const RECORD_DEFINITIONS_ID = 57342, RECORD_INLINE_ID = 57343, BUNDLED_STRINGS_ID = 57337, STOP_CODE = {};
let currentStructures, srcString, bundledStrings$1, referenceMap, packedValues, dataView, restoreMapsAsObje... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/simple-token-verification-without-renewal/cwt.js | delivery/media/cat/examples/simple-token-verification-without-renewal/cwt.js | /** @preserve @version 1.2.0 */
import { crypto } from "crypto";
import { Encoder, Decoder, Tag } from "./cbor-x.js";
import { logger } from "log";
const COSE_Mac0 = 17, COSE_Mac = 97, COSE_Sign = 98, COSE_Sign1 = 18, COSE_Encrypt0 = 16, COSE_Encrypt = 96, coseAlgTags = {
"-7": "ES256",
5: "HS256"
}, HeaderL... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/simple-token-verification-without-renewal/cat.js | delivery/media/cat/examples/simple-token-verification-without-renewal/cat.js | /** @preserve @version 1.0.2 */
import { Decoder } from "./cbor-x.js";
import { logger } from "log";
import { crypto } from "crypto";
import { base16, TextEncoder } from "encoding";
const HeaderLabelMap = {
alg: 1,
crit: 2,
kid: 4,
IV: 5
}, AlgoLabelMap = {
ES256: -7,
HS256: 5,
PS256: -3... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/token-generator/main.js | delivery/media/cat/examples/token-generator/main.js | import { logger } from 'log';
import { CWTGenerator, CWTUtil } from './cwt.js';
import { AlgoLabelMap, CatURILabelMap, ClaimsLabelMap, HeaderLabelMap, MatchTypeLabelMap, CAT } from './cat.js';
import { TextDecoder, TextEncoder, base16, base64url } from 'encoding';
import { crypto } from 'crypto';
import { createRespons... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/token-generator/cbor-x.js | delivery/media/cat/examples/token-generator/cbor-x.js | let decoder, src, srcEnd;
try {
decoder = new TextDecoder;
} catch (error) {}
let position$1 = 0;
const RECORD_DEFINITIONS_ID = 57342, RECORD_INLINE_ID = 57343, BUNDLED_STRINGS_ID = 57337, STOP_CODE = {};
let currentStructures, srcString, bundledStrings$1, referenceMap, packedValues, dataView, restoreMapsAsObje... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/token-generator/cwt.js | delivery/media/cat/examples/token-generator/cwt.js | /** @preserve @version 1.2.0 */
import { crypto } from "crypto";
import { Encoder, Decoder, Tag } from "./cbor-x.js";
import { logger } from "log";
const COSE_Mac0 = 17, COSE_Mac = 97, COSE_Sign = 98, COSE_Sign1 = 18, COSE_Encrypt0 = 16, COSE_Encrypt = 96, coseAlgTags = {
"-7": "ES256",
5: "HS256"
}, HeaderL... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/examples/token-generator/cat.js | delivery/media/cat/examples/token-generator/cat.js | /** @preserve @version 1.0.2 */
import { Decoder } from "./cbor-x.js";
import { logger } from "log";
import { crypto } from "crypto";
import { base16, TextEncoder } from "encoding";
const HeaderLabelMap = {
alg: 1,
crit: 2,
kid: 4,
IV: 5
}, AlgoLabelMap = {
ES256: -7,
HS256: 5,
PS256: -3... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/lib/cbor-x.js | delivery/media/cat/lib/cbor-x.js | let decoder, src, srcEnd;
try {
decoder = new TextDecoder;
} catch (error) {}
let position$1 = 0;
const RECORD_DEFINITIONS_ID = 57342, RECORD_INLINE_ID = 57343, BUNDLED_STRINGS_ID = 57337, STOP_CODE = {};
let currentStructures, srcString, bundledStrings$1, referenceMap, packedValues, dataView, restoreMapsAsObje... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/cat/lib/cat.js | delivery/media/cat/lib/cat.js | /** @preserve @version 1.0.2 */
import { Decoder } from "./cbor-x.js";
import { logger } from "log";
import { crypto } from "crypto";
import { base16, TextEncoder } from "encoding";
const HeaderLabelMap = {
alg: 1,
crit: 2,
kid: 4,
IV: 5
}, AlgoLabelMap = {
ES256: -7,
HS256: 5,
PS256: -3... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/dash/examples/bumperInsertion/main.js | delivery/media/dash/examples/bumperInsertion/main.js | import { logger } from 'log';
import { DashParser } from './media-delivery-dash-parser.js';
import { httpRequest } from 'http-request';
import { createResponse } from 'create-response';
import URLSearchParams from "url-search-params";
import { TextEncoderStream, TextDecoderStream } from 'text-encode-transform';
import ... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/dash/examples/bumperInsertion/media-delivery-dash-parser.js | delivery/media/dash/examples/bumperInsertion/media-delivery-dash-parser.js | import { logger } from "log";
const DashConstants = new class {
constructor() {
this.ACCESSIBILITY = "Accessibility", this.ADAPTATION_SET = "AdaptationSet", this.ASSET_IDENTIFIER = "AssetIdentifier",
this.AUDIO_CHANNEL_CONFIGURATION = "AudioChannelConfiguration", this.BASEURL = "BaseURL",
... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/dash/examples/mper/manifestmanipulation-1/main.js | delivery/media/dash/examples/mper/manifestmanipulation-1/main.js | import { logger } from 'log';
import { DashParser } from './media-delivery-dash-parser.js';
import { httpRequest } from 'http-request';
import { createResponse } from 'create-response';
import URLSearchParams from "url-search-params";
import { TextEncoderStream, TextDecoderStream } from 'text-encode-transform';
import ... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/dash/examples/mper/manifestmanipulation-1/media-delivery-dash-parser.js | delivery/media/dash/examples/mper/manifestmanipulation-1/media-delivery-dash-parser.js | import { logger } from "log";
const DashConstants = new class {
constructor() {
this.ACCESSIBILITY = "Accessibility", this.ADAPTATION_SET = "AdaptationSet", this.ASSET_IDENTIFIER = "AssetIdentifier",
this.AUDIO_CHANNEL_CONFIGURATION = "AudioChannelConfiguration", this.BASEURL = "BaseURL",
... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/dash/examples/mper/manifestmanipulation-2/main.js | delivery/media/dash/examples/mper/manifestmanipulation-2/main.js | import { logger } from 'log';
import { DashParser } from './media-delivery-dash-parser.js';
import { httpRequest } from 'http-request';
import { createResponse } from 'create-response';
import URLSearchParams from "url-search-params";
import { TextEncoderStream, TextDecoderStream } from 'text-encode-transform';
import ... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/dash/examples/mper/manifestmanipulation-2/media-delivery-dash-parser.js | delivery/media/dash/examples/mper/manifestmanipulation-2/media-delivery-dash-parser.js | import { logger } from "log";
const DashConstants = new class {
constructor() {
this.ACCESSIBILITY = "Accessibility", this.ADAPTATION_SET = "AdaptationSet", this.ASSET_IDENTIFIER = "AssetIdentifier",
this.AUDIO_CHANNEL_CONFIGURATION = "AudioChannelConfiguration", this.BASEURL = "BaseURL",
... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/dash/examples/mper/typescript/rollup.config.js | delivery/media/dash/examples/mper/typescript/rollup.config.js | import typescript from "@rollup/plugin-typescript";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
export default {
input: "src/main.ts",
output: {
dir: "dist",
format: "es",
},
external: ['http-request', 'log' ],
plugins: [typescript({ target: 'es2... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/dash/examples/mper/typescript/src/dashparser/media-delivery-dash-parser.js | delivery/media/dash/examples/mper/typescript/src/dashparser/media-delivery-dash-parser.js | import { logger } from "log";
const DashConstants = new class {
constructor() {
this.ACCESSIBILITY = "Accessibility", this.ADAPTATION_SET = "AdaptationSet", this.ASSET_IDENTIFIER = "AssetIdentifier",
this.AUDIO_CHANNEL_CONFIGURATION = "AudioChannelConfiguration", this.BASEURL = "BaseURL",
... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/dash/examples/mper/typescript/src/dash/media-delivery-dash-parser.js | delivery/media/dash/examples/mper/typescript/src/dash/media-delivery-dash-parser.js | import { logger } from "log";
const DashConstants = new class {
constructor() {
this.ACCESSIBILITY = "Accessibility", this.ADAPTATION_SET = "AdaptationSet", this.ASSET_IDENTIFIER = "AssetIdentifier",
this.AUDIO_CHANNEL_CONFIGURATION = "AudioChannelConfiguration", this.BASEURL = "BaseURL",
... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/dash/lib/media-delivery-dash-parser.js | delivery/media/dash/lib/media-delivery-dash-parser.js | import { logger } from "log";
const DashConstants = new class {
constructor() {
this.ACCESSIBILITY = "Accessibility", this.ADAPTATION_SET = "AdaptationSet", this.ASSET_IDENTIFIER = "AssetIdentifier",
this.AUDIO_CHANNEL_CONFIGURATION = "AudioChannelConfiguration", this.BASEURL = "BaseURL",
... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/hls/examples/manifest-personalization/main.js | delivery/media/hls/examples/manifest-personalization/main.js | import { HLS } from './hls.js';
import { httpRequest } from 'http-request';
import { createResponse } from 'create-response';
import URLSearchParams from "url-search-params";
import { TextEncoderStream, TextDecoderStream } from 'text-encode-transform';
import { ReadableStream, WritableStream } from 'streams';
const UN... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/hls/examples/manifest-personalization/hls.js | delivery/media/hls/examples/manifest-personalization/hls.js | /** @preserve @version 1.0.0 */
import { httpRequest } from "http-request";
var global$1 = "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, lookup = [], revLookup = [], Arr = "undefined" != typeof Uint8Array ? Uint8Array : Array, inited = !1;
func... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/hls/examples/live-program-replacement/main.js | delivery/media/hls/examples/live-program-replacement/main.js | /* eslint-disable @typescript-eslint/no-empty-function */
/* eslint-disable @typescript-eslint/no-unused-vars */
// Policy structure accepted by LiveManifestTransformer class
/**
* [{
startDate: 'ISO 8601 date',
endDate: 'ISO 8601 date',
content: 'URL or valid m3u8 contennt in utf8 encoded'
}]... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/hls/examples/live-program-replacement/hls.js | delivery/media/hls/examples/live-program-replacement/hls.js | /** @preserve @version 1.0.0 */
import { httpRequest } from "http-request";
var global$1 = "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, lookup = [], revLookup = [], Arr = "undefined" != typeof Uint8Array ? Uint8Array : Array, inited = !1;
func... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/hls/examples/bumper-insertion/main.js | delivery/media/hls/examples/bumper-insertion/main.js | import { HLS } from './hls.js';
import { httpRequest } from 'http-request';
import { createResponse } from 'create-response';
import URLSearchParams from "url-search-params";
import { TextEncoderStream, TextDecoderStream } from 'text-encode-transform';
import { ReadableStream, WritableStream } from 'streams';
const UN... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/hls/examples/bumper-insertion/hls.js | delivery/media/hls/examples/bumper-insertion/hls.js | /** @preserve @version 1.0.0 */
import { httpRequest } from "http-request";
var global$1 = "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, lookup = [], revLookup = [], Arr = "undefined" != typeof Uint8Array ? Uint8Array : Array, inited = !1;
func... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/hls/lib/hls.js | delivery/media/hls/lib/hls.js | /** @preserve @version 1.0.0 */
import { httpRequest } from "http-request";
var global$1 = "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}, lookup = [], revLookup = [], Arr = "undefined" != typeof Uint8Array ? Uint8Array : Array, inited = !1;
func... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/watermarking/examples/wm-direct/media-delivery-watermarking.js | delivery/media/watermarking/examples/wm-direct/media-delivery-watermarking.js | /** @preserve @version 1.1.0 */
import { WritableStream } from "streams";
import { crypto, pem2ab } from "crypto";
import { TextEncoder, base16, base64url } from "encoding";
import { logger } from "log";
import { httpRequest } from "http-request";
import { decode, Encoder } from "./cbor-x.js";
import { CWTValidat... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/watermarking/examples/wm-direct/main.js | delivery/media/watermarking/examples/wm-direct/main.js | import { logger } from 'log';
import { TokenType, Watermarking} from './media-delivery-watermarking.js';
//CWT Token will be used. Watermarking module also support JWT based token, set TokenType.JWT to enable JWT based tokens.
const watermarking = new Watermarking( { tokenType: TokenType.CWT, validateWMClaims: true })... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/watermarking/examples/wm-direct/jwt.js | delivery/media/watermarking/examples/wm-direct/jwt.js | /** @preserve @version 1.0.1 */
import { crypto } from "crypto";
import { base64url, TextEncoder } from "encoding";
class JWTUtil {
static isEmptyString(str) {
return !str || 0 === str.trim().length;
}
}
class JWTValidator {
constructor(jwtOptions) {
this.jwtOptions = jwtOptions || {}, th... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/watermarking/examples/wm-direct/cbor-x.js | delivery/media/watermarking/examples/wm-direct/cbor-x.js | let decoder, src, srcEnd;
try {
decoder = new TextDecoder;
} catch (error) {}
let position$1 = 0;
const RECORD_DEFINITIONS_ID = 57342, RECORD_INLINE_ID = 57343, BUNDLED_STRINGS_ID = 57337, STOP_CODE = {};
let currentStructures, srcString, bundledStrings$1, referenceMap, packedValues, dataView, restoreMapsAsObje... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | true |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/watermarking/examples/wm-direct/cwt.js | delivery/media/watermarking/examples/wm-direct/cwt.js | /** @preserve @version 1.1.1 */
import { crypto } from "crypto";
import { Encoder, Decoder } from "./cbor-x.js";
const COSE_Mac0 = 17, COSE_Mac = 97, COSE_Sign = 98, COSE_Sign1 = 18, COSE_Encrypt0 = 16, COSE_Encrypt = 96, coseAlgTags = {
5: "HMAC 256/256",
"-7": "ES256"
}, HeaderLabelToKey_alg = 1, HeaderLabe... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/watermarking/examples/wm-typescript/rollup.config.js | delivery/media/watermarking/examples/wm-typescript/rollup.config.js | import typescript from "@rollup/plugin-typescript";
import commonjs from "@rollup/plugin-commonjs";
import resolve from "@rollup/plugin-node-resolve";
export default {
input: "src/main.ts",
output: {
dir: "dist",
format: "es",
},
external: ['http-request', 'log', 'base64', 'crypto', 'encoding', 'stream... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/watermarking/examples/wm-typescript/src/vendor-algorithm/vendor-algorithm.js | delivery/media/watermarking/examples/wm-typescript/src/vendor-algorithm/vendor-algorithm.js | //This code just demonstrate the sample interface of the vendorAlgorithm class.
class VendorAlgorithm {
async generateTmid(payload, secretKey) {
//Vendor specific logic to generate TMID in hex.
//Customer needs to obtain/implement with permissions from respective vendor as this could be protected by cop... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
akamai/edgeworkers-examples | https://github.com/akamai/edgeworkers-examples/blob/2f8cbadcf293b1d37628327ed11f5c4a9399c200/delivery/media/watermarking/examples/wm-typescript/src/watermarking/media-delivery-watermarking.js | delivery/media/watermarking/examples/wm-typescript/src/watermarking/media-delivery-watermarking.js | /** @preserve @version 1.1.0 */
import { WritableStream } from "streams";
import { crypto, pem2ab } from "crypto";
import { TextEncoder, base16, base64url } from "encoding";
import { logger } from "log";
import { httpRequest } from "http-request";
import { decode, Encoder } from "./cbor-x.js";
import { CWTValidat... | javascript | Apache-2.0 | 2f8cbadcf293b1d37628327ed11f5c4a9399c200 | 2026-01-05T03:36:16.776355Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.