@adaptable/utils
Advanced tools
Comparing version 1.27.0 to 1.28.0
export * from "./certs"; | ||
export * from "./crypto"; | ||
export * from "./env"; | ||
export * from "./notNull"; | ||
export * from "./products"; | ||
export * from "./resourceName"; | ||
export * from "./schema"; | ||
@@ -6,0 +8,0 @@ export * from "./service"; |
@@ -18,5 +18,7 @@ "use strict"; | ||
__exportStar(require("./certs"), exports); | ||
__exportStar(require("./crypto"), exports); | ||
__exportStar(require("./env"), exports); | ||
__exportStar(require("./notNull"), exports); | ||
__exportStar(require("./products"), exports); | ||
__exportStar(require("./resourceName"), exports); | ||
__exportStar(require("./schema"), exports); | ||
@@ -23,0 +25,0 @@ __exportStar(require("./service"), exports); |
@@ -18,5 +18,11 @@ import z from "zod"; | ||
export interface Price { | ||
_id: string; | ||
name: string; | ||
/** Unit label before dividing by quantityPerUnit */ | ||
baseUnit: string; | ||
/** Unit that corresponds to the `usd` price (after dividing by quantityPerUnit */ | ||
unit: string; | ||
usd: number; | ||
gcpSkus: string[]; | ||
quantityPerUnit: number; | ||
} | ||
@@ -57,6 +63,5 @@ export declare const resourcePrices: Price[]; | ||
attachesTo: "apps" | "organizations"; | ||
beta?: boolean; | ||
buildsOnPlan?: string; | ||
defaultQuota?: ResourceConfig; | ||
defaultResourceConfig?: ResourceConfig; | ||
defaultQuota: ResourceConfig; | ||
defaultResourceConfig: ResourceConfig; | ||
desc?: string; | ||
@@ -72,3 +77,3 @@ experimentIds: ExperimentId[]; | ||
priceFinePrint?: string; | ||
pricePerItem?: "app"; | ||
pricePerItem?: "app" | "organization"; | ||
priceText?: string; | ||
@@ -79,2 +84,7 @@ teamMembersIncluded?: number; | ||
} | ||
/** | ||
* This list is ORDERED such that moving to a plan with a higher index | ||
* indicates an upgrade and moving to a plan with a lower index means a | ||
* downgrade. | ||
*/ | ||
export declare const allPlans: Plan[]; | ||
@@ -87,9 +97,4 @@ export interface GetPlansOptions { | ||
export declare function getPlan(planId: string): Plan | undefined; | ||
/** | ||
* This list is ORDERED such that moving to a plan with a higher index | ||
* indicates an upgrade and moving to a plan with a lower index means a | ||
* downgrade. | ||
*/ | ||
export declare const allPlanIds: string[]; | ||
export declare function isValidPlan(planId: string): boolean; | ||
export declare function isValidPlan(planId: string, attachesTo?: Plan["attachesTo"]): boolean; | ||
export declare function isNoBillingPlan(planId: string): boolean; | ||
@@ -96,0 +101,0 @@ export declare function getFreePlan(expId: ExperimentId): Plan; |
@@ -34,30 +34,71 @@ "use strict"; | ||
exports.UNLIMITED = Number.MAX_SAFE_INTEGER; | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
const ONE_GiB = 1024 * 1024 * 1024; | ||
exports.resourcePrices = [{ | ||
_id: "faa92d7c-efb3-48af-a169-4852aa202598", | ||
name: "Compute - Active", | ||
baseUnit: "vCPU second", | ||
unit: "vCPU second", | ||
usd: 0.0000249, | ||
gcpSkus: ["4856-B847-F1EB"], | ||
quantityPerUnit: 1, | ||
}, { | ||
_id: "a7db40bc-74a8-45de-83c2-a33d7c246573", | ||
name: "Compute - Idle", | ||
baseUnit: "vCPU second", | ||
unit: "vCPU second", | ||
usd: 0.000003125, | ||
gcpSkus: ["7EBB-8579-2C98"], | ||
quantityPerUnit: 1, | ||
}, { | ||
_id: "db15041b-bfc2-4315-889a-83bd3ead08d2", | ||
name: "Memory - Active", | ||
baseUnit: "Byte-second", | ||
unit: "GiB second", | ||
usd: 0.000003125, | ||
gcpSkus: ["02A2-9231-36A6"], | ||
quantityPerUnit: ONE_GiB, | ||
}, { | ||
_id: "294a7d08-f788-4a14-b614-c737a07415e0", | ||
name: "Memory - Idle", | ||
baseUnit: "Byte-second", | ||
unit: "GiB second", | ||
usd: 0.000003125, | ||
gcpSkus: ["740D-08F2-7A11"], | ||
quantityPerUnit: ONE_GiB, | ||
}, { | ||
_id: "b73872cc-bf4a-4a7e-b4d5-921d4c9476eb", | ||
name: "Network Ingress", | ||
baseUnit: "Byte", | ||
unit: "GiB", | ||
usd: 0, | ||
gcpSkus: [], | ||
quantityPerUnit: ONE_GiB, | ||
}, { | ||
_id: "fd9351d9-b59f-4ca7-9ada-03ccaf51bdce", | ||
name: "Network Egress", | ||
baseUnit: "Byte", | ||
unit: "GiB", | ||
usd: 0.25, | ||
gcpSkus: [ | ||
"0CCB-7057-48DE", | ||
"DDFD-AE42-E219", | ||
"D63C-EDCA-4726", | ||
"E262-332F-1474", | ||
"DBAA-7594-B9FA", | ||
"EF10-B23A-2545", | ||
"9B46-8DDB-2AC8", | ||
"DF75-E5D2-F9DB", | ||
"9841-EABE-71F3", | ||
"E14F-53F1-D9A8", | ||
], | ||
quantityPerUnit: ONE_GiB, | ||
}, { | ||
_id: "8916965d-5351-4002-b0cd-5f037768f52d", | ||
name: "HTTP requests", | ||
baseUnit: "request", | ||
unit: "1M requests", | ||
usd: 0.415, | ||
gcpSkus: ["2DA5-55D3-E679"], | ||
quantityPerUnit: 1000000, | ||
}]; | ||
@@ -99,2 +140,24 @@ const experimentIds = [ | ||
}; | ||
const defaultResourceConfig = { | ||
maxConcurrentRequestsPerInstance: 25, | ||
maxInstances: 1, | ||
memory: 512, | ||
minInstances: 0, | ||
requestTimeoutSeconds: 30, | ||
vCpus: 1, | ||
}; | ||
const maxLimits = { | ||
privateRepos: exports.UNLIMITED, | ||
concurrency: 1000, | ||
instances: 1000, | ||
minInstances: 1000, | ||
vCpus: 4, | ||
ramMb: 32 * 1024, | ||
cpuSeconds: Math.floor(Number.MAX_VALUE), | ||
databaseSizeMb: Math.floor(Number.MAX_VALUE), | ||
domains: Math.floor(Number.MAX_VALUE), | ||
egressGb: Math.floor(Number.MAX_VALUE), | ||
ingressGb: exports.UNLIMITED, | ||
requestTimeoutSeconds: 1 * 60 * 60, // 1 hour is a container service limit | ||
}; | ||
const starterV1 = { | ||
@@ -148,10 +211,3 @@ name: "Starter", | ||
defaultQuota, | ||
defaultResourceConfig: { | ||
maxConcurrentRequestsPerInstance: 25, | ||
maxInstances: 1, | ||
memory: 512, | ||
minInstances: 0, | ||
requestTimeoutSeconds: 30, | ||
vCpus: 1, | ||
}, | ||
defaultResourceConfig, | ||
limits: { | ||
@@ -218,10 +274,3 @@ privateRepos: exports.UNLIMITED, | ||
defaultQuota, | ||
defaultResourceConfig: { | ||
maxConcurrentRequestsPerInstance: 25, | ||
maxInstances: 1, | ||
memory: 512, | ||
minInstances: 0, | ||
requestTimeoutSeconds: 30, | ||
vCpus: 1, | ||
}, | ||
defaultResourceConfig, | ||
limits: { | ||
@@ -257,24 +306,4 @@ privateRepos: exports.UNLIMITED, | ||
defaultQuota, | ||
defaultResourceConfig: { | ||
maxConcurrentRequestsPerInstance: 25, | ||
maxInstances: 1, | ||
memory: 512, | ||
minInstances: 0, | ||
requestTimeoutSeconds: 30, | ||
vCpus: 1, | ||
}, | ||
limits: { | ||
privateRepos: exports.UNLIMITED, | ||
concurrency: 1000, | ||
instances: 1000, | ||
minInstances: 1000, | ||
vCpus: 4, | ||
ramMb: 32 * 1024, | ||
cpuSeconds: Math.floor(Number.MAX_VALUE), | ||
databaseSizeMb: Math.floor(Number.MAX_VALUE), | ||
domains: Math.floor(Number.MAX_VALUE), | ||
egressGb: Math.floor(Number.MAX_VALUE), | ||
ingressGb: exports.UNLIMITED, | ||
requestTimeoutSeconds: 1 * 60 * 60, // 1 hour is a container service limit | ||
}, | ||
defaultResourceConfig, | ||
limits: maxLimits, | ||
_id: exports.scalePlanId, | ||
@@ -305,3 +334,3 @@ buildsOnPlan: exports.launchPlanId, | ||
internalName: "Team v1", | ||
allowSubscription: false, | ||
allowSubscription: true, | ||
attachesTo: "organizations", | ||
@@ -311,5 +340,8 @@ type: "usage", | ||
pitch: "Bring your team on board with no per-app charges", | ||
beta: true, | ||
defaultQuota, | ||
defaultResourceConfig, | ||
limits: maxLimits, | ||
price: 20, | ||
priceFinePrint: "Up to 3 users. $10 / month per add'l user. Plus resource usage", | ||
pricePerItem: "organization", | ||
_id: exports.teamPlanId, | ||
@@ -330,2 +362,4 @@ buildsOnPlan: exports.scaleV2PlanId, | ||
priceText: "Custom", | ||
defaultQuota, | ||
defaultResourceConfig, | ||
_id: exports.enterprisePlanId, | ||
@@ -336,2 +370,7 @@ buildsOnPlan: exports.teamPlanId, | ||
}; | ||
/** | ||
* This list is ORDERED such that moving to a plan with a higher index | ||
* indicates an upgrade and moving to a plan with a lower index means a | ||
* downgrade. | ||
*/ | ||
exports.allPlans = [ | ||
@@ -349,2 +388,3 @@ starterV1, | ||
]; | ||
const allPlansMap = new Map(exports.allPlans.map((p) => [p._id, p])); | ||
function getPlans(optionsIn) { | ||
@@ -364,25 +404,13 @@ const options = typeof optionsIn === "string" ? { expId: optionsIn } : optionsIn; | ||
function getPlan(planId) { | ||
return exports.allPlans.find((p) => p._id === planId); | ||
return allPlansMap.get(planId); | ||
} | ||
exports.getPlan = getPlan; | ||
/** | ||
* This list is ORDERED such that moving to a plan with a higher index | ||
* indicates an upgrade and moving to a plan with a lower index means a | ||
* downgrade. | ||
*/ | ||
exports.allPlanIds = [ | ||
exports.starterPlanId, | ||
exports.buildPlanId, | ||
exports.buildV2PlanId, | ||
exports.buildV3PlanId, | ||
exports.launchPlanId, | ||
exports.scalePlanId, | ||
exports.scaleV2PlanId, | ||
exports.scaleV3PlanId, | ||
exports.teamPlanId, | ||
exports.enterprisePlanId, | ||
]; | ||
const validPlans = new Set(exports.allPlanIds); | ||
function isValidPlan(planId) { | ||
return validPlans.has(planId); | ||
exports.allPlanIds = exports.allPlans.map((p) => p._id); | ||
function isValidPlan(planId, attachesTo) { | ||
const plan = allPlansMap.get(planId); | ||
if (!plan) | ||
return false; | ||
if (!attachesTo) | ||
return true; | ||
return plan.attachesTo === attachesTo; | ||
} | ||
@@ -389,0 +417,0 @@ exports.isValidPlan = isValidPlan; |
@@ -47,2 +47,7 @@ import { MaybeArray } from "./types"; | ||
/** | ||
* Set to true if the template supports fast delete (just deleting | ||
* all Adaptable resources only). | ||
*/ | ||
fastDelete?: boolean; | ||
/** | ||
* The full name of the template in roughly 2-4 words. At the moment, all | ||
@@ -49,0 +54,0 @@ * names end with the word "Template". |
@@ -30,2 +30,3 @@ "use strict"; | ||
}, | ||
fastDelete: true, | ||
tags: ["nodejs"], | ||
@@ -81,2 +82,3 @@ guideUrl: "/docs/app-guides/deploy-feathers-js-api", | ||
}, | ||
fastDelete: true, | ||
tags: ["nodejs"], | ||
@@ -141,2 +143,3 @@ guideUrl: "/docs/app-guides/deploy-nestjs-app", | ||
}, | ||
fastDelete: true, | ||
tags: ["nodejs"], | ||
@@ -184,2 +187,3 @@ guideUrl: "/docs/app-guides/deploy-express-app", | ||
}, | ||
fastDelete: true, | ||
tags: ["nodejs"], | ||
@@ -223,2 +227,3 @@ guideUrl: "/docs/app-guides/deploy-nodejs-app", | ||
}, | ||
fastDelete: true, | ||
tags: ["python"], | ||
@@ -273,2 +278,3 @@ guideUrl: "/docs/app-guides/deploy-flask-app", | ||
}, | ||
fastDelete: true, | ||
tags: ["python"], | ||
@@ -311,2 +317,3 @@ guideUrl: "/docs/app-guides/deploy-python-app", | ||
}, | ||
fastDelete: true, | ||
tags: ["go"], | ||
@@ -346,6 +353,7 @@ guideUrl: "/docs/app-guides/deploy-gin-app", | ||
}, | ||
fastDelete: true, | ||
tags: ["go"], | ||
guideUrl: "/docs/app-guides/deploy-go-app", | ||
guideUrl: "/docs/app-guides/deploy-golang-app", | ||
iconUrl: "/img/tech_logos/go_cropped.svg", | ||
referenceUrl: "/docs/templates/go-app-template", | ||
referenceUrl: "/docs/templates/golang-app-template", | ||
slug: "go", | ||
@@ -381,2 +389,3 @@ url: exports.defaultTemplateUrl, | ||
}, | ||
fastDelete: true, | ||
tags: ["php"], | ||
@@ -421,2 +430,3 @@ guideUrl: "/docs/app-guides/deploy-laravel-app", | ||
}, | ||
fastDelete: true, | ||
tags: ["php"], | ||
@@ -456,2 +466,3 @@ guideUrl: "/docs/app-guides/deploy-php-app", | ||
}, | ||
fastDelete: true, | ||
tags: ["dockerfile"], | ||
@@ -458,0 +469,0 @@ guideUrl: "/docs/app-guides/deploy-with-dockerfile", |
{ | ||
"name": "@adaptable/utils", | ||
"version": "1.27.0", | ||
"version": "1.28.0", | ||
"description": "Common utilities for Adaptable.io", | ||
@@ -13,6 +13,2 @@ "homepage": "https://adaptable.io", | ||
], | ||
"engines": { | ||
"node": "14", | ||
"yarn": ">= 0.18.0" | ||
}, | ||
"scripts": { | ||
@@ -49,3 +45,3 @@ "build": "rm -rf dist/ .tsbuildinfo && tsc", | ||
}, | ||
"gitHead": "945178f6e173412e94f765df68aa8d4aea7ad7c9" | ||
"gitHead": "f1ddc2a50bc2937c7671598c83ba9090f7aaac82" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
110531
55
1595