Remove unnecessary files

This commit is contained in:
Koper
2023-12-04 21:57:30 +07:00
parent de72d43301
commit a27220ea37
3452 changed files with 4 additions and 2262142 deletions

View File

@@ -187,6 +187,9 @@ ehthumbs_vista.db
.aws-sam
UpdateZulipStreams/node_modules
UpdateZulipStreams/node_modules copy
# Dump file
*.stackdump

View File

@@ -1 +0,0 @@
../mocha/bin/_mocha

View File

@@ -1 +0,0 @@
../flat/cli.js

View File

@@ -1 +0,0 @@
../he/bin/he

View File

@@ -1 +0,0 @@
../js-yaml/bin/js-yaml.js

View File

@@ -1 +0,0 @@
../mocha/bin/mocha.js

View File

@@ -1 +0,0 @@
../nanoid/bin/nanoid.cjs

View File

@@ -1 +0,0 @@
../uuid/dist/bin/uuid

File diff suppressed because it is too large Load Diff

View File

@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015-present, Brian Woodward.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -1,315 +0,0 @@
# ansi-colors [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/ansi-colors.svg?style=flat)](https://www.npmjs.com/package/ansi-colors) [![NPM monthly downloads](https://img.shields.io/npm/dm/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![NPM total downloads](https://img.shields.io/npm/dt/ansi-colors.svg?style=flat)](https://npmjs.org/package/ansi-colors) [![Linux Build Status](https://img.shields.io/travis/doowb/ansi-colors.svg?style=flat&label=Travis)](https://travis-ci.org/doowb/ansi-colors)
> Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).
Please consider following this project's author, [Brian Woodward](https://github.com/doowb), and consider starring the project to show your :heart: and support.
## Install
Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save ansi-colors
```
![image](https://user-images.githubusercontent.com/383994/39635445-8a98a3a6-4f8b-11e8-89c1-068c45d4fff8.png)
## Why use this?
ansi-colors is _the fastest Node.js library for terminal styling_. A more performant drop-in replacement for chalk, with no dependencies.
* _Blazing fast_ - Fastest terminal styling library in node.js, 10-20x faster than chalk!
* _Drop-in replacement_ for [chalk](https://github.com/chalk/chalk).
* _No dependencies_ (Chalk has 7 dependencies in its tree!)
* _Safe_ - Does not modify the `String.prototype` like [colors](https://github.com/Marak/colors.js).
* Supports [nested colors](#nested-colors), **and does not have the [nested styling bug](#nested-styling-bug) that is present in [colorette](https://github.com/jorgebucaran/colorette), [chalk](https://github.com/chalk/chalk), and [kleur](https://github.com/lukeed/kleur)**.
* Supports [chained colors](#chained-colors).
* [Toggle color support](#toggle-color-support) on or off.
## Usage
```js
const c = require('ansi-colors');
console.log(c.red('This is a red string!'));
console.log(c.green('This is a red string!'));
console.log(c.cyan('This is a cyan string!'));
console.log(c.yellow('This is a yellow string!'));
```
![image](https://user-images.githubusercontent.com/383994/39653848-a38e67da-4fc0-11e8-89ae-98c65ebe9dcf.png)
## Chained colors
```js
console.log(c.bold.red('this is a bold red message'));
console.log(c.bold.yellow.italic('this is a bold yellow italicized message'));
console.log(c.green.bold.underline('this is a bold green underlined message'));
```
![image](https://user-images.githubusercontent.com/383994/39635780-7617246a-4f8c-11e8-89e9-05216cc54e38.png)
## Nested colors
```js
console.log(c.yellow(`foo ${c.red.bold('red')} bar ${c.cyan('cyan')} baz`));
```
![image](https://user-images.githubusercontent.com/383994/39635817-8ed93d44-4f8c-11e8-8afd-8c3ea35f5fbe.png)
### Nested styling bug
`ansi-colors` does not have the nested styling bug found in [colorette](https://github.com/jorgebucaran/colorette), [chalk](https://github.com/chalk/chalk), and [kleur](https://github.com/lukeed/kleur).
```js
const { bold, red } = require('ansi-styles');
console.log(bold(`foo ${red.dim('bar')} baz`));
const colorette = require('colorette');
console.log(colorette.bold(`foo ${colorette.red(colorette.dim('bar'))} baz`));
const kleur = require('kleur');
console.log(kleur.bold(`foo ${kleur.red.dim('bar')} baz`));
const chalk = require('chalk');
console.log(chalk.bold(`foo ${chalk.red.dim('bar')} baz`));
```
**Results in the following**
(sans icons and labels)
![image](https://user-images.githubusercontent.com/383994/47280326-d2ee0580-d5a3-11e8-9611-ea6010f0a253.png)
## Toggle color support
Easily enable/disable colors.
```js
const c = require('ansi-colors');
// disable colors manually
c.enabled = false;
// or use a library to automatically detect support
c.enabled = require('color-support').hasBasic;
console.log(c.red('I will only be colored red if the terminal supports colors'));
```
## Strip ANSI codes
Use the `.unstyle` method to strip ANSI codes from a string.
```js
console.log(c.unstyle(c.blue.bold('foo bar baz')));
//=> 'foo bar baz'
```
## Available styles
**Note** that bright and bright-background colors are not always supported.
| Colors | Background Colors | Bright Colors | Bright Background Colors |
| ------- | ----------------- | ------------- | ------------------------ |
| black | bgBlack | blackBright | bgBlackBright |
| red | bgRed | redBright | bgRedBright |
| green | bgGreen | greenBright | bgGreenBright |
| yellow | bgYellow | yellowBright | bgYellowBright |
| blue | bgBlue | blueBright | bgBlueBright |
| magenta | bgMagenta | magentaBright | bgMagentaBright |
| cyan | bgCyan | cyanBright | bgCyanBright |
| white | bgWhite | whiteBright | bgWhiteBright |
| gray | | | |
| grey | | | |
_(`gray` is the U.S. spelling, `grey` is more commonly used in the Canada and U.K.)_
### Style modifiers
* dim
* **bold**
* hidden
* _italic_
* underline
* inverse
* ~~strikethrough~~
* reset
## Aliases
Create custom aliases for styles.
```js
const colors = require('ansi-colors');
colors.alias('primary', colors.yellow);
colors.alias('secondary', colors.bold);
console.log(colors.primary.secondary('Foo'));
```
## Themes
A theme is an object of custom aliases.
```js
const colors = require('ansi-colors');
colors.theme({
danger: colors.red,
dark: colors.dim.gray,
disabled: colors.gray,
em: colors.italic,
heading: colors.bold.underline,
info: colors.cyan,
muted: colors.dim,
primary: colors.blue,
strong: colors.bold,
success: colors.green,
underline: colors.underline,
warning: colors.yellow
});
// Now, we can use our custom styles alongside the built-in styles!
console.log(colors.danger.strong.em('Error!'));
console.log(colors.warning('Heads up!'));
console.log(colors.info('Did you know...'));
console.log(colors.success.bold('It worked!'));
```
## Performance
**Libraries tested**
* ansi-colors v3.0.4
* chalk v2.4.1
### Mac
> MacBook Pro, Intel Core i7, 2.3 GHz, 16 GB.
**Load time**
Time it takes to load the first time `require()` is called:
* ansi-colors - `1.915ms`
* chalk - `12.437ms`
**Benchmarks**
```
# All Colors
ansi-colors x 173,851 ops/sec ±0.42% (91 runs sampled)
chalk x 9,944 ops/sec ±2.53% (81 runs sampled)))
# Chained colors
ansi-colors x 20,791 ops/sec ±0.60% (88 runs sampled)
chalk x 2,111 ops/sec ±2.34% (83 runs sampled)
# Nested colors
ansi-colors x 59,304 ops/sec ±0.98% (92 runs sampled)
chalk x 4,590 ops/sec ±2.08% (82 runs sampled)
```
### Windows
> Windows 10, Intel Core i7-7700k CPU @ 4.2 GHz, 32 GB
**Load time**
Time it takes to load the first time `require()` is called:
* ansi-colors - `1.494ms`
* chalk - `11.523ms`
**Benchmarks**
```
# All Colors
ansi-colors x 193,088 ops/sec ±0.51% (95 runs sampled))
chalk x 9,612 ops/sec ±3.31% (77 runs sampled)))
# Chained colors
ansi-colors x 26,093 ops/sec ±1.13% (94 runs sampled)
chalk x 2,267 ops/sec ±2.88% (80 runs sampled))
# Nested colors
ansi-colors x 67,747 ops/sec ±0.49% (93 runs sampled)
chalk x 4,446 ops/sec ±3.01% (82 runs sampled))
```
## About
<details>
<summary><strong>Contributing</strong></summary>
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
</details>
<details>
<summary><strong>Running Tests</strong></summary>
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
```sh
$ npm install && npm test
```
</details>
<details>
<summary><strong>Building docs</strong></summary>
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
To generate the readme, run the following command:
```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```
</details>
### Related projects
You might also be interested in these projects:
* [ansi-wrap](https://www.npmjs.com/package/ansi-wrap): Create ansi colors by passing the open and close codes. | [homepage](https://github.com/jonschlinkert/ansi-wrap "Create ansi colors by passing the open and close codes.")
* [strip-color](https://www.npmjs.com/package/strip-color): Strip ANSI color codes from a string. No dependencies. | [homepage](https://github.com/jonschlinkert/strip-color "Strip ANSI color codes from a string. No dependencies.")
### Contributors
| **Commits** | **Contributor** |
| --- | --- |
| 48 | [jonschlinkert](https://github.com/jonschlinkert) |
| 42 | [doowb](https://github.com/doowb) |
| 6 | [lukeed](https://github.com/lukeed) |
| 2 | [Silic0nS0ldier](https://github.com/Silic0nS0ldier) |
| 1 | [dwieeb](https://github.com/dwieeb) |
| 1 | [jorgebucaran](https://github.com/jorgebucaran) |
| 1 | [madhavarshney](https://github.com/madhavarshney) |
| 1 | [chapterjason](https://github.com/chapterjason) |
### Author
**Brian Woodward**
* [GitHub Profile](https://github.com/doowb)
* [Twitter Profile](https://twitter.com/doowb)
* [LinkedIn Profile](https://linkedin.com/in/woodwardbrian)
### License
Copyright © 2019, [Brian Woodward](https://github.com/doowb).
Released under the [MIT License](LICENSE).
***
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 01, 2019._

View File

@@ -1,177 +0,0 @@
'use strict';
const isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
const identity = val => val;
/* eslint-disable no-control-regex */
// this is a modified version of https://github.com/chalk/ansi-regex (MIT License)
const ANSI_REGEX = /[\u001b\u009b][[\]#;?()]*(?:(?:(?:[^\W_]*;?[^\W_]*)\u0007)|(?:(?:[0-9]{1,4}(;[0-9]{0,4})*)?[~0-9=<>cf-nqrtyA-PRZ]))/g;
const create = () => {
const colors = { enabled: true, visible: true, styles: {}, keys: {} };
if ('FORCE_COLOR' in process.env) {
colors.enabled = process.env.FORCE_COLOR !== '0';
}
const ansi = style => {
let open = style.open = `\u001b[${style.codes[0]}m`;
let close = style.close = `\u001b[${style.codes[1]}m`;
let regex = style.regex = new RegExp(`\\u001b\\[${style.codes[1]}m`, 'g');
style.wrap = (input, newline) => {
if (input.includes(close)) input = input.replace(regex, close + open);
let output = open + input + close;
// see https://github.com/chalk/chalk/pull/92, thanks to the
// chalk contributors for this fix. However, we've confirmed that
// this issue is also present in Windows terminals
return newline ? output.replace(/\r*\n/g, `${close}$&${open}`) : output;
};
return style;
};
const wrap = (style, input, newline) => {
return typeof style === 'function' ? style(input) : style.wrap(input, newline);
};
const style = (input, stack) => {
if (input === '' || input == null) return '';
if (colors.enabled === false) return input;
if (colors.visible === false) return '';
let str = '' + input;
let nl = str.includes('\n');
let n = stack.length;
if (n > 0 && stack.includes('unstyle')) {
stack = [...new Set(['unstyle', ...stack])].reverse();
}
while (n-- > 0) str = wrap(colors.styles[stack[n]], str, nl);
return str;
};
const define = (name, codes, type) => {
colors.styles[name] = ansi({ name, codes });
let keys = colors.keys[type] || (colors.keys[type] = []);
keys.push(name);
Reflect.defineProperty(colors, name, {
configurable: true,
enumerable: true,
set(value) {
colors.alias(name, value);
},
get() {
let color = input => style(input, color.stack);
Reflect.setPrototypeOf(color, colors);
color.stack = this.stack ? this.stack.concat(name) : [name];
return color;
}
});
};
define('reset', [0, 0], 'modifier');
define('bold', [1, 22], 'modifier');
define('dim', [2, 22], 'modifier');
define('italic', [3, 23], 'modifier');
define('underline', [4, 24], 'modifier');
define('inverse', [7, 27], 'modifier');
define('hidden', [8, 28], 'modifier');
define('strikethrough', [9, 29], 'modifier');
define('black', [30, 39], 'color');
define('red', [31, 39], 'color');
define('green', [32, 39], 'color');
define('yellow', [33, 39], 'color');
define('blue', [34, 39], 'color');
define('magenta', [35, 39], 'color');
define('cyan', [36, 39], 'color');
define('white', [37, 39], 'color');
define('gray', [90, 39], 'color');
define('grey', [90, 39], 'color');
define('bgBlack', [40, 49], 'bg');
define('bgRed', [41, 49], 'bg');
define('bgGreen', [42, 49], 'bg');
define('bgYellow', [43, 49], 'bg');
define('bgBlue', [44, 49], 'bg');
define('bgMagenta', [45, 49], 'bg');
define('bgCyan', [46, 49], 'bg');
define('bgWhite', [47, 49], 'bg');
define('blackBright', [90, 39], 'bright');
define('redBright', [91, 39], 'bright');
define('greenBright', [92, 39], 'bright');
define('yellowBright', [93, 39], 'bright');
define('blueBright', [94, 39], 'bright');
define('magentaBright', [95, 39], 'bright');
define('cyanBright', [96, 39], 'bright');
define('whiteBright', [97, 39], 'bright');
define('bgBlackBright', [100, 49], 'bgBright');
define('bgRedBright', [101, 49], 'bgBright');
define('bgGreenBright', [102, 49], 'bgBright');
define('bgYellowBright', [103, 49], 'bgBright');
define('bgBlueBright', [104, 49], 'bgBright');
define('bgMagentaBright', [105, 49], 'bgBright');
define('bgCyanBright', [106, 49], 'bgBright');
define('bgWhiteBright', [107, 49], 'bgBright');
colors.ansiRegex = ANSI_REGEX;
colors.hasColor = colors.hasAnsi = str => {
colors.ansiRegex.lastIndex = 0;
return typeof str === 'string' && str !== '' && colors.ansiRegex.test(str);
};
colors.alias = (name, color) => {
let fn = typeof color === 'string' ? colors[color] : color;
if (typeof fn !== 'function') {
throw new TypeError('Expected alias to be the name of an existing color (string) or a function');
}
if (!fn.stack) {
Reflect.defineProperty(fn, 'name', { value: name });
colors.styles[name] = fn;
fn.stack = [name];
}
Reflect.defineProperty(colors, name, {
configurable: true,
enumerable: true,
set(value) {
colors.alias(name, value);
},
get() {
let color = input => style(input, color.stack);
Reflect.setPrototypeOf(color, colors);
color.stack = this.stack ? this.stack.concat(fn.stack) : fn.stack;
return color;
}
});
};
colors.theme = custom => {
if (!isObject(custom)) throw new TypeError('Expected theme to be an object');
for (let name of Object.keys(custom)) {
colors.alias(name, custom[name]);
}
return colors;
};
colors.alias('unstyle', str => {
if (typeof str === 'string' && str !== '') {
colors.ansiRegex.lastIndex = 0;
return str.replace(colors.ansiRegex, '');
}
return '';
});
colors.alias('noop', str => str);
colors.none = colors.clear = colors.noop;
colors.stripColor = colors.unstyle;
colors.symbols = require('./symbols');
colors.define = define;
return colors;
};
module.exports = create();
module.exports.create = create;

View File

@@ -1,109 +0,0 @@
{
"name": "ansi-colors",
"description": "Easily add ANSI colors to your text and symbols in the terminal. A faster drop-in replacement for chalk, kleur and turbocolor (without the dependencies and rendering bugs).",
"version": "4.1.1",
"homepage": "https://github.com/doowb/ansi-colors",
"author": "Brian Woodward (https://github.com/doowb)",
"contributors": [
"Brian Woodward (https://twitter.com/doowb)",
"Jason Schilling (https://sourecode.de)",
"Jon Schlinkert (http://twitter.com/jonschlinkert)",
"Jordan (https://github.com/Silic0nS0ldier)"
],
"repository": "doowb/ansi-colors",
"bugs": {
"url": "https://github.com/doowb/ansi-colors/issues"
},
"license": "MIT",
"files": [
"index.js",
"symbols.js",
"types/index.d.ts"
],
"main": "index.js",
"types": "./types/index.d.ts",
"engines": {
"node": ">=6"
},
"scripts": {
"test": "mocha"
},
"devDependencies": {
"decache": "^4.5.1",
"gulp-format-md": "^2.0.0",
"justified": "^1.0.1",
"mocha": "^6.1.4",
"text-table": "^0.2.0"
},
"keywords": [
"ansi",
"bgblack",
"bgBlack",
"bgblue",
"bgBlue",
"bgcyan",
"bgCyan",
"bggreen",
"bgGreen",
"bgmagenta",
"bgMagenta",
"bgred",
"bgRed",
"bgwhite",
"bgWhite",
"bgyellow",
"bgYellow",
"black",
"blue",
"bold",
"clorox",
"colors",
"cyan",
"dim",
"gray",
"green",
"grey",
"hidden",
"inverse",
"italic",
"kleur",
"magenta",
"red",
"reset",
"strikethrough",
"underline",
"white",
"yellow"
],
"verb": {
"toc": false,
"layout": "default",
"tasks": [
"readme"
],
"data": {
"author": {
"linkedin": "woodwardbrian",
"twitter": "doowb"
}
},
"plugins": [
"gulp-format-md"
],
"lint": {
"reflinks": true
},
"related": {
"list": [
"ansi-wrap",
"strip-color"
]
},
"reflinks": [
"chalk",
"colorette",
"colors",
"kleur"
]
}
}

View File

@@ -1,70 +0,0 @@
'use strict';
const isHyper = process.env.TERM_PROGRAM === 'Hyper';
const isWindows = process.platform === 'win32';
const isLinux = process.platform === 'linux';
const common = {
ballotDisabled: '☒',
ballotOff: '☐',
ballotOn: '☑',
bullet: '•',
bulletWhite: '◦',
fullBlock: '█',
heart: '❤',
identicalTo: '≡',
line: '─',
mark: '※',
middot: '·',
minus: '',
multiplication: '×',
obelus: '÷',
pencilDownRight: '✎',
pencilRight: '✏',
pencilUpRight: '✐',
percent: '%',
pilcrow2: '❡',
pilcrow: '¶',
plusMinus: '±',
section: '§',
starsOff: '☆',
starsOn: '★',
upDownArrow: '↕'
};
const windows = Object.assign({}, common, {
check: '√',
cross: '×',
ellipsisLarge: '...',
ellipsis: '...',
info: 'i',
question: '?',
questionSmall: '?',
pointer: '>',
pointerSmall: '»',
radioOff: '( )',
radioOn: '(*)',
warning: '‼'
});
const other = Object.assign({}, common, {
ballotCross: '✘',
check: '✔',
cross: '✖',
ellipsisLarge: '⋯',
ellipsis: '…',
info: '',
question: '?',
questionFull: '',
questionSmall: '﹖',
pointer: isLinux ? '▸' : '',
pointerSmall: isLinux ? '‣' : '',
radioOff: '◯',
radioOn: '◉',
warning: '⚠'
});
module.exports = (isWindows && !isHyper) ? windows : other;
Reflect.defineProperty(module.exports, 'common', { enumerable: false, value: common });
Reflect.defineProperty(module.exports, 'windows', { enumerable: false, value: windows });
Reflect.defineProperty(module.exports, 'other', { enumerable: false, value: other });

View File

@@ -1,161 +0,0 @@
// Imported from DefinitelyTyped project.
// TypeScript definitions for ansi-colors
// Definitions by: Rogier Schouten <https://github.com/rogierschouten>
// Integrated by: Jordan Mele <https://github.com/Silic0nS0ldier>
interface SymbolsType {
check: string;
cross: string;
info: string;
line: string;
pointer: string;
pointerSmall: string;
question: string;
warning: string;
}
type StyleArrayStructure = [number, number];
interface StyleArrayProperties {
open: string;
close: string;
closeRe: string;
}
type StyleType = StyleArrayStructure & StyleArrayProperties;
export interface StyleFunction extends StylesType<StyleFunction> {
(s: string): string;
}
interface StylesType<T> {
// modifiers
reset: T;
bold: T;
dim: T;
italic: T;
underline: T;
inverse: T;
hidden: T;
strikethrough: T;
// colors
black: T;
red: T;
green: T;
yellow: T;
blue: T;
magenta: T;
cyan: T;
white: T;
gray: T;
grey: T;
// bright colors
blackBright: T;
redBright: T;
greenBright: T;
yellowBright: T;
blueBright: T;
magentaBright: T;
cyanBright: T;
whiteBright: T;
// background colors
bgBlack: T;
bgRed: T;
bgGreen: T;
bgYellow: T;
bgBlue: T;
bgMagenta: T;
bgCyan: T;
bgWhite: T;
// bright background colors
bgBlackBright: T;
bgRedBright: T;
bgGreenBright: T;
bgYellowBright: T;
bgBlueBright: T;
bgMagentaBright: T;
bgCyanBright: T;
bgWhiteBright: T;
}
// modifiers
export const reset: StyleFunction;
export const bold: StyleFunction;
export const dim: StyleFunction;
export const italic: StyleFunction;
export const underline: StyleFunction;
export const inverse: StyleFunction;
export const hidden: StyleFunction;
export const strikethrough: StyleFunction;
// colors
export const black: StyleFunction;
export const red: StyleFunction;
export const green: StyleFunction;
export const yellow: StyleFunction;
export const blue: StyleFunction;
export const magenta: StyleFunction;
export const cyan: StyleFunction;
export const white: StyleFunction;
export const gray: StyleFunction;
export const grey: StyleFunction;
// bright colors
export const blackBright: StyleFunction;
export const redBright: StyleFunction;
export const greenBright: StyleFunction;
export const yellowBright: StyleFunction;
export const blueBright: StyleFunction;
export const magentaBright: StyleFunction;
export const cyanBright: StyleFunction;
export const whiteBright: StyleFunction;
// background colors
export const bgBlack: StyleFunction;
export const bgRed: StyleFunction;
export const bgGreen: StyleFunction;
export const bgYellow: StyleFunction;
export const bgBlue: StyleFunction;
export const bgMagenta: StyleFunction;
export const bgCyan: StyleFunction;
export const bgWhite: StyleFunction;
// bright background colors
export const bgBlackBright: StyleFunction;
export const bgRedBright: StyleFunction;
export const bgGreenBright: StyleFunction;
export const bgYellowBright: StyleFunction;
export const bgBlueBright: StyleFunction;
export const bgMagentaBright: StyleFunction;
export const bgCyanBright: StyleFunction;
export const bgWhiteBright: StyleFunction;
export let enabled: boolean;
export let visible: boolean;
export const ansiRegex: RegExp;
/**
* Remove styles from string
*/
export function stripColor(s: string): string;
/**
* Remove styles from string
*/
export function strip(s: string): string;
/**
* Remove styles from string
*/
export function unstyle(s: string): string;
export const styles: StylesType<StyleType>;
export const symbols: SymbolsType;
/**
* Outputs a string with check-symbol as prefix
*/
export function ok(...args: string[]): string;

View File

@@ -1,37 +0,0 @@
declare namespace ansiRegex {
interface Options {
/**
Match only the first ANSI escape.
@default false
*/
onlyFirst: boolean;
}
}
/**
Regular expression for matching ANSI escape codes.
@example
```
import ansiRegex = require('ansi-regex');
ansiRegex().test('\u001B[4mcake\u001B[0m');
//=> true
ansiRegex().test('cake');
//=> false
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
//=> ['\u001B[4m', '\u001B[0m']
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
//=> ['\u001B[4m']
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
```
*/
declare function ansiRegex(options?: ansiRegex.Options): RegExp;
export = ansiRegex;

View File

@@ -1,10 +0,0 @@
'use strict';
module.exports = ({onlyFirst = false} = {}) => {
const pattern = [
'[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)',
'(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))'
].join('|');
return new RegExp(pattern, onlyFirst ? undefined : 'g');
};

View File

@@ -1,9 +0,0 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,55 +0,0 @@
{
"name": "ansi-regex",
"version": "5.0.1",
"description": "Regular expression for matching ANSI escape codes",
"license": "MIT",
"repository": "chalk/ansi-regex",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd",
"view-supported": "node fixtures/view-codes.js"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"cli",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"command-line",
"text",
"regex",
"regexp",
"re",
"match",
"test",
"find",
"pattern"
],
"devDependencies": {
"ava": "^2.4.0",
"tsd": "^0.9.0",
"xo": "^0.25.3"
}
}

View File

@@ -1,78 +0,0 @@
# ansi-regex
> Regular expression for matching [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)
## Install
```
$ npm install ansi-regex
```
## Usage
```js
const ansiRegex = require('ansi-regex');
ansiRegex().test('\u001B[4mcake\u001B[0m');
//=> true
ansiRegex().test('cake');
//=> false
'\u001B[4mcake\u001B[0m'.match(ansiRegex());
//=> ['\u001B[4m', '\u001B[0m']
'\u001B[4mcake\u001B[0m'.match(ansiRegex({onlyFirst: true}));
//=> ['\u001B[4m']
'\u001B]8;;https://github.com\u0007click\u001B]8;;\u0007'.match(ansiRegex());
//=> ['\u001B]8;;https://github.com\u0007', '\u001B]8;;\u0007']
```
## API
### ansiRegex(options?)
Returns a regex for matching ANSI escape codes.
#### options
Type: `object`
##### onlyFirst
Type: `boolean`<br>
Default: `false` *(Matches any ANSI escape codes in a string)*
Match only the first ANSI escape.
## FAQ
### Why do you test for codes not in the ECMA 48 standard?
Some of the codes we run as a test are codes that we acquired finding various lists of non-standard or manufacturer specific codes. We test for both standard and non-standard codes, as most of them follow the same or similar format and can be safely matched in strings without the risk of removing actual string content. There are a few non-standard control codes that do not follow the traditional format (i.e. they end in numbers) thus forcing us to exclude them from the test because we cannot reliably match them.
On the historical side, those ECMA standards were established in the early 90's whereas the VT100, for example, was designed in the mid/late 70's. At that point in time, control codes were still pretty ungoverned and engineers used them for a multitude of things, namely to activate hardware ports that may have been proprietary. Somewhere else you see a similar 'anarchy' of codes is in the x86 architecture for processors; there are a ton of "interrupts" that can mean different things on certain brands of processors, most of which have been phased out.
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-ansi-regex?utm_source=npm-ansi-regex&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

View File

@@ -1,345 +0,0 @@
declare type CSSColor =
| 'aliceblue'
| 'antiquewhite'
| 'aqua'
| 'aquamarine'
| 'azure'
| 'beige'
| 'bisque'
| 'black'
| 'blanchedalmond'
| 'blue'
| 'blueviolet'
| 'brown'
| 'burlywood'
| 'cadetblue'
| 'chartreuse'
| 'chocolate'
| 'coral'
| 'cornflowerblue'
| 'cornsilk'
| 'crimson'
| 'cyan'
| 'darkblue'
| 'darkcyan'
| 'darkgoldenrod'
| 'darkgray'
| 'darkgreen'
| 'darkgrey'
| 'darkkhaki'
| 'darkmagenta'
| 'darkolivegreen'
| 'darkorange'
| 'darkorchid'
| 'darkred'
| 'darksalmon'
| 'darkseagreen'
| 'darkslateblue'
| 'darkslategray'
| 'darkslategrey'
| 'darkturquoise'
| 'darkviolet'
| 'deeppink'
| 'deepskyblue'
| 'dimgray'
| 'dimgrey'
| 'dodgerblue'
| 'firebrick'
| 'floralwhite'
| 'forestgreen'
| 'fuchsia'
| 'gainsboro'
| 'ghostwhite'
| 'gold'
| 'goldenrod'
| 'gray'
| 'green'
| 'greenyellow'
| 'grey'
| 'honeydew'
| 'hotpink'
| 'indianred'
| 'indigo'
| 'ivory'
| 'khaki'
| 'lavender'
| 'lavenderblush'
| 'lawngreen'
| 'lemonchiffon'
| 'lightblue'
| 'lightcoral'
| 'lightcyan'
| 'lightgoldenrodyellow'
| 'lightgray'
| 'lightgreen'
| 'lightgrey'
| 'lightpink'
| 'lightsalmon'
| 'lightseagreen'
| 'lightskyblue'
| 'lightslategray'
| 'lightslategrey'
| 'lightsteelblue'
| 'lightyellow'
| 'lime'
| 'limegreen'
| 'linen'
| 'magenta'
| 'maroon'
| 'mediumaquamarine'
| 'mediumblue'
| 'mediumorchid'
| 'mediumpurple'
| 'mediumseagreen'
| 'mediumslateblue'
| 'mediumspringgreen'
| 'mediumturquoise'
| 'mediumvioletred'
| 'midnightblue'
| 'mintcream'
| 'mistyrose'
| 'moccasin'
| 'navajowhite'
| 'navy'
| 'oldlace'
| 'olive'
| 'olivedrab'
| 'orange'
| 'orangered'
| 'orchid'
| 'palegoldenrod'
| 'palegreen'
| 'paleturquoise'
| 'palevioletred'
| 'papayawhip'
| 'peachpuff'
| 'peru'
| 'pink'
| 'plum'
| 'powderblue'
| 'purple'
| 'rebeccapurple'
| 'red'
| 'rosybrown'
| 'royalblue'
| 'saddlebrown'
| 'salmon'
| 'sandybrown'
| 'seagreen'
| 'seashell'
| 'sienna'
| 'silver'
| 'skyblue'
| 'slateblue'
| 'slategray'
| 'slategrey'
| 'snow'
| 'springgreen'
| 'steelblue'
| 'tan'
| 'teal'
| 'thistle'
| 'tomato'
| 'turquoise'
| 'violet'
| 'wheat'
| 'white'
| 'whitesmoke'
| 'yellow'
| 'yellowgreen';
declare namespace ansiStyles {
interface ColorConvert {
/**
The RGB color space.
@param red - (`0`-`255`)
@param green - (`0`-`255`)
@param blue - (`0`-`255`)
*/
rgb(red: number, green: number, blue: number): string;
/**
The RGB HEX color space.
@param hex - A hexadecimal string containing RGB data.
*/
hex(hex: string): string;
/**
@param keyword - A CSS color name.
*/
keyword(keyword: CSSColor): string;
/**
The HSL color space.
@param hue - (`0`-`360`)
@param saturation - (`0`-`100`)
@param lightness - (`0`-`100`)
*/
hsl(hue: number, saturation: number, lightness: number): string;
/**
The HSV color space.
@param hue - (`0`-`360`)
@param saturation - (`0`-`100`)
@param value - (`0`-`100`)
*/
hsv(hue: number, saturation: number, value: number): string;
/**
The HSV color space.
@param hue - (`0`-`360`)
@param whiteness - (`0`-`100`)
@param blackness - (`0`-`100`)
*/
hwb(hue: number, whiteness: number, blackness: number): string;
/**
Use a [4-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#3/4-bit) to set text color.
*/
ansi(ansi: number): string;
/**
Use an [8-bit unsigned number](https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit) to set text color.
*/
ansi256(ansi: number): string;
}
interface CSPair {
/**
The ANSI terminal control sequence for starting this style.
*/
readonly open: string;
/**
The ANSI terminal control sequence for ending this style.
*/
readonly close: string;
}
interface ColorBase {
readonly ansi: ColorConvert;
readonly ansi256: ColorConvert;
readonly ansi16m: ColorConvert;
/**
The ANSI terminal control sequence for ending this color.
*/
readonly close: string;
}
interface Modifier {
/**
Resets the current color chain.
*/
readonly reset: CSPair;
/**
Make text bold.
*/
readonly bold: CSPair;
/**
Emitting only a small amount of light.
*/
readonly dim: CSPair;
/**
Make text italic. (Not widely supported)
*/
readonly italic: CSPair;
/**
Make text underline. (Not widely supported)
*/
readonly underline: CSPair;
/**
Inverse background and foreground colors.
*/
readonly inverse: CSPair;
/**
Prints the text, but makes it invisible.
*/
readonly hidden: CSPair;
/**
Puts a horizontal line through the center of the text. (Not widely supported)
*/
readonly strikethrough: CSPair;
}
interface ForegroundColor {
readonly black: CSPair;
readonly red: CSPair;
readonly green: CSPair;
readonly yellow: CSPair;
readonly blue: CSPair;
readonly cyan: CSPair;
readonly magenta: CSPair;
readonly white: CSPair;
/**
Alias for `blackBright`.
*/
readonly gray: CSPair;
/**
Alias for `blackBright`.
*/
readonly grey: CSPair;
readonly blackBright: CSPair;
readonly redBright: CSPair;
readonly greenBright: CSPair;
readonly yellowBright: CSPair;
readonly blueBright: CSPair;
readonly cyanBright: CSPair;
readonly magentaBright: CSPair;
readonly whiteBright: CSPair;
}
interface BackgroundColor {
readonly bgBlack: CSPair;
readonly bgRed: CSPair;
readonly bgGreen: CSPair;
readonly bgYellow: CSPair;
readonly bgBlue: CSPair;
readonly bgCyan: CSPair;
readonly bgMagenta: CSPair;
readonly bgWhite: CSPair;
/**
Alias for `bgBlackBright`.
*/
readonly bgGray: CSPair;
/**
Alias for `bgBlackBright`.
*/
readonly bgGrey: CSPair;
readonly bgBlackBright: CSPair;
readonly bgRedBright: CSPair;
readonly bgGreenBright: CSPair;
readonly bgYellowBright: CSPair;
readonly bgBlueBright: CSPair;
readonly bgCyanBright: CSPair;
readonly bgMagentaBright: CSPair;
readonly bgWhiteBright: CSPair;
}
}
declare const ansiStyles: {
readonly modifier: ansiStyles.Modifier;
readonly color: ansiStyles.ForegroundColor & ansiStyles.ColorBase;
readonly bgColor: ansiStyles.BackgroundColor & ansiStyles.ColorBase;
readonly codes: ReadonlyMap<number, number>;
} & ansiStyles.BackgroundColor & ansiStyles.ForegroundColor & ansiStyles.Modifier;
export = ansiStyles;

View File

@@ -1,163 +0,0 @@
'use strict';
const wrapAnsi16 = (fn, offset) => (...args) => {
const code = fn(...args);
return `\u001B[${code + offset}m`;
};
const wrapAnsi256 = (fn, offset) => (...args) => {
const code = fn(...args);
return `\u001B[${38 + offset};5;${code}m`;
};
const wrapAnsi16m = (fn, offset) => (...args) => {
const rgb = fn(...args);
return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
};
const ansi2ansi = n => n;
const rgb2rgb = (r, g, b) => [r, g, b];
const setLazyProperty = (object, property, get) => {
Object.defineProperty(object, property, {
get: () => {
const value = get();
Object.defineProperty(object, property, {
value,
enumerable: true,
configurable: true
});
return value;
},
enumerable: true,
configurable: true
});
};
/** @type {typeof import('color-convert')} */
let colorConvert;
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
if (colorConvert === undefined) {
colorConvert = require('color-convert');
}
const offset = isBackground ? 10 : 0;
const styles = {};
for (const [sourceSpace, suite] of Object.entries(colorConvert)) {
const name = sourceSpace === 'ansi16' ? 'ansi' : sourceSpace;
if (sourceSpace === targetSpace) {
styles[name] = wrap(identity, offset);
} else if (typeof suite === 'object') {
styles[name] = wrap(suite[targetSpace], offset);
}
}
return styles;
};
function assembleStyles() {
const codes = new Map();
const styles = {
modifier: {
reset: [0, 0],
// 21 isn't widely supported and 22 does the same thing
bold: [1, 22],
dim: [2, 22],
italic: [3, 23],
underline: [4, 24],
inverse: [7, 27],
hidden: [8, 28],
strikethrough: [9, 29]
},
color: {
black: [30, 39],
red: [31, 39],
green: [32, 39],
yellow: [33, 39],
blue: [34, 39],
magenta: [35, 39],
cyan: [36, 39],
white: [37, 39],
// Bright color
blackBright: [90, 39],
redBright: [91, 39],
greenBright: [92, 39],
yellowBright: [93, 39],
blueBright: [94, 39],
magentaBright: [95, 39],
cyanBright: [96, 39],
whiteBright: [97, 39]
},
bgColor: {
bgBlack: [40, 49],
bgRed: [41, 49],
bgGreen: [42, 49],
bgYellow: [43, 49],
bgBlue: [44, 49],
bgMagenta: [45, 49],
bgCyan: [46, 49],
bgWhite: [47, 49],
// Bright color
bgBlackBright: [100, 49],
bgRedBright: [101, 49],
bgGreenBright: [102, 49],
bgYellowBright: [103, 49],
bgBlueBright: [104, 49],
bgMagentaBright: [105, 49],
bgCyanBright: [106, 49],
bgWhiteBright: [107, 49]
}
};
// Alias bright black as gray (and grey)
styles.color.gray = styles.color.blackBright;
styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
styles.color.grey = styles.color.blackBright;
styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
for (const [groupName, group] of Object.entries(styles)) {
for (const [styleName, style] of Object.entries(group)) {
styles[styleName] = {
open: `\u001B[${style[0]}m`,
close: `\u001B[${style[1]}m`
};
group[styleName] = styles[styleName];
codes.set(style[0], style[1]);
}
Object.defineProperty(styles, groupName, {
value: group,
enumerable: false
});
}
Object.defineProperty(styles, 'codes', {
value: codes,
enumerable: false
});
styles.color.close = '\u001B[39m';
styles.bgColor.close = '\u001B[49m';
setLazyProperty(styles.color, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, false));
setLazyProperty(styles.color, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, false));
setLazyProperty(styles.color, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, false));
setLazyProperty(styles.bgColor, 'ansi', () => makeDynamicStyles(wrapAnsi16, 'ansi16', ansi2ansi, true));
setLazyProperty(styles.bgColor, 'ansi256', () => makeDynamicStyles(wrapAnsi256, 'ansi256', ansi2ansi, true));
setLazyProperty(styles.bgColor, 'ansi16m', () => makeDynamicStyles(wrapAnsi16m, 'rgb', rgb2rgb, true));
return styles;
}
// Make the export immutable
Object.defineProperty(module, 'exports', {
enumerable: true,
get: assembleStyles
});

View File

@@ -1,9 +0,0 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,56 +0,0 @@
{
"name": "ansi-styles",
"version": "4.3.0",
"description": "ANSI escape codes for styling strings in the terminal",
"license": "MIT",
"repository": "chalk/ansi-styles",
"funding": "https://github.com/chalk/ansi-styles?sponsor=1",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd",
"screenshot": "svg-term --command='node screenshot' --out=screenshot.svg --padding=3 --width=55 --height=3 --at=1000 --no-cursor"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"ansi",
"styles",
"color",
"colour",
"colors",
"terminal",
"console",
"cli",
"string",
"tty",
"escape",
"formatting",
"rgb",
"256",
"shell",
"xterm",
"log",
"logging",
"command-line",
"text"
],
"dependencies": {
"color-convert": "^2.0.1"
},
"devDependencies": {
"@types/color-convert": "^1.9.0",
"ava": "^2.3.0",
"svg-term-cli": "^2.1.1",
"tsd": "^0.11.0",
"xo": "^0.25.3"
}
}

View File

@@ -1,152 +0,0 @@
# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)
> [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal
You probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.
<img src="screenshot.svg" width="900">
## Install
```
$ npm install ansi-styles
```
## Usage
```js
const style = require('ansi-styles');
console.log(`${style.green.open}Hello world!${style.green.close}`);
// Color conversion between 16/256/truecolor
// NOTE: If conversion goes to 16 colors or 256 colors, the original color
// may be degraded to fit that color palette. This means terminals
// that do not support 16 million colors will best-match the
// original color.
console.log(style.bgColor.ansi.hsl(120, 80, 72) + 'Hello world!' + style.bgColor.close);
console.log(style.color.ansi256.rgb(199, 20, 250) + 'Hello world!' + style.color.close);
console.log(style.color.ansi16m.hex('#abcdef') + 'Hello world!' + style.color.close);
```
## API
Each style has an `open` and `close` property.
## Styles
### Modifiers
- `reset`
- `bold`
- `dim`
- `italic` *(Not widely supported)*
- `underline`
- `inverse`
- `hidden`
- `strikethrough` *(Not widely supported)*
### Colors
- `black`
- `red`
- `green`
- `yellow`
- `blue`
- `magenta`
- `cyan`
- `white`
- `blackBright` (alias: `gray`, `grey`)
- `redBright`
- `greenBright`
- `yellowBright`
- `blueBright`
- `magentaBright`
- `cyanBright`
- `whiteBright`
### Background colors
- `bgBlack`
- `bgRed`
- `bgGreen`
- `bgYellow`
- `bgBlue`
- `bgMagenta`
- `bgCyan`
- `bgWhite`
- `bgBlackBright` (alias: `bgGray`, `bgGrey`)
- `bgRedBright`
- `bgGreenBright`
- `bgYellowBright`
- `bgBlueBright`
- `bgMagentaBright`
- `bgCyanBright`
- `bgWhiteBright`
## Advanced usage
By default, you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.
- `style.modifier`
- `style.color`
- `style.bgColor`
###### Example
```js
console.log(style.color.green.open);
```
Raw escape codes (i.e. without the CSI escape prefix `\u001B[` and render mode postfix `m`) are available under `style.codes`, which returns a `Map` with the open codes as keys and close codes as values.
###### Example
```js
console.log(style.codes.get(36));
//=> 39
```
## [256 / 16 million (TrueColor) support](https://gist.github.com/XVilka/8346728)
`ansi-styles` uses the [`color-convert`](https://github.com/Qix-/color-convert) package to allow for converting between various colors and ANSI escapes, with support for 256 and 16 million colors.
The following color spaces from `color-convert` are supported:
- `rgb`
- `hex`
- `keyword`
- `hsl`
- `hsv`
- `hwb`
- `ansi`
- `ansi256`
To use these, call the associated conversion function with the intended output, for example:
```js
style.color.ansi.rgb(100, 200, 15); // RGB to 16 color ansi foreground code
style.bgColor.ansi.rgb(100, 200, 15); // RGB to 16 color ansi background code
style.color.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
style.bgColor.ansi256.hsl(120, 100, 60); // HSL to 256 color ansi foreground code
style.color.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color foreground code
style.bgColor.ansi16m.hex('#C0FFEE'); // Hex (RGB) to 16 million color background code
```
## Related
- [ansi-escapes](https://github.com/sindresorhus/ansi-escapes) - ANSI escape codes for manipulating the terminal
## Maintainers
- [Sindre Sorhus](https://github.com/sindresorhus)
- [Josh Junon](https://github.com/qix-)
## For enterprise
Available as part of the Tidelift Subscription.
The maintainers of `ansi-styles` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-ansi-styles?utm_source=npm-ansi-styles&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

View File

@@ -1,15 +0,0 @@
The ISC License
Copyright (c) 2019 Elan Shanker, Paul Miller (https://paulmillr.com)
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@@ -1,87 +0,0 @@
anymatch [![Build Status](https://travis-ci.org/micromatch/anymatch.svg?branch=master)](https://travis-ci.org/micromatch/anymatch) [![Coverage Status](https://img.shields.io/coveralls/micromatch/anymatch.svg?branch=master)](https://coveralls.io/r/micromatch/anymatch?branch=master)
======
Javascript module to match a string against a regular expression, glob, string,
or function that takes the string as an argument and returns a truthy or falsy
value. The matcher can also be an array of any or all of these. Useful for
allowing a very flexible user-defined config to define things like file paths.
__Note: This module has Bash-parity, please be aware that Windows-style backslashes are not supported as separators. See https://github.com/micromatch/micromatch#backslashes for more information.__
Usage
-----
```sh
npm install anymatch
```
#### anymatch(matchers, testString, [returnIndex], [options])
* __matchers__: (_Array|String|RegExp|Function_)
String to be directly matched, string with glob patterns, regular expression
test, function that takes the testString as an argument and returns a truthy
value if it should be matched, or an array of any number and mix of these types.
* __testString__: (_String|Array_) The string to test against the matchers. If
passed as an array, the first element of the array will be used as the
`testString` for non-function matchers, while the entire array will be applied
as the arguments for function matchers.
* __options__: (_Object_ [optional]_) Any of the [picomatch](https://github.com/micromatch/picomatch#options) options.
* __returnIndex__: (_Boolean [optional]_) If true, return the array index of
the first matcher that that testString matched, or -1 if no match, instead of a
boolean result.
```js
const anymatch = require('anymatch');
const matchers = [ 'path/to/file.js', 'path/anyjs/**/*.js', /foo.js$/, string => string.includes('bar') && string.length > 10 ] ;
anymatch(matchers, 'path/to/file.js'); // true
anymatch(matchers, 'path/anyjs/baz.js'); // true
anymatch(matchers, 'path/to/foo.js'); // true
anymatch(matchers, 'path/to/bar.js'); // true
anymatch(matchers, 'bar.js'); // false
// returnIndex = true
anymatch(matchers, 'foo.js', {returnIndex: true}); // 2
anymatch(matchers, 'path/anyjs/foo.js', {returnIndex: true}); // 1
// any picomatc
// using globs to match directories and their children
anymatch('node_modules', 'node_modules'); // true
anymatch('node_modules', 'node_modules/somelib/index.js'); // false
anymatch('node_modules/**', 'node_modules/somelib/index.js'); // true
anymatch('node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // false
anymatch('**/node_modules/**', '/absolute/path/to/node_modules/somelib/index.js'); // true
const matcher = anymatch(matchers);
['foo.js', 'bar.js'].filter(matcher); // [ 'foo.js' ]
anymatch master*
```
#### anymatch(matchers)
You can also pass in only your matcher(s) to get a curried function that has
already been bound to the provided matching criteria. This can be used as an
`Array#filter` callback.
```js
var matcher = anymatch(matchers);
matcher('path/to/file.js'); // true
matcher('path/anyjs/baz.js', true); // 1
['foo.js', 'bar.js'].filter(matcher); // ['foo.js']
```
Changelog
----------
[See release notes page on GitHub](https://github.com/micromatch/anymatch/releases)
- **v3.0:** Removed `startIndex` and `endIndex` arguments. Node 8.x-only.
- **v2.0:** [micromatch](https://github.com/jonschlinkert/micromatch) moves away from minimatch-parity and inline with Bash. This includes handling backslashes differently (see https://github.com/micromatch/micromatch#backslashes for more information).
- **v1.2:** anymatch uses [micromatch](https://github.com/jonschlinkert/micromatch)
for glob pattern matching. Issues with glob pattern matching should be
reported directly to the [micromatch issue tracker](https://github.com/jonschlinkert/micromatch/issues).
License
-------
[ISC](https://raw.github.com/micromatch/anymatch/master/LICENSE)

View File

@@ -1,20 +0,0 @@
type AnymatchFn = (testString: string) => boolean;
type AnymatchPattern = string|RegExp|AnymatchFn;
type AnymatchMatcher = AnymatchPattern|AnymatchPattern[]
type AnymatchTester = {
(testString: string|any[], returnIndex: true): number;
(testString: string|any[]): boolean;
}
type PicomatchOptions = {dot: boolean};
declare const anymatch: {
(matchers: AnymatchMatcher): AnymatchTester;
(matchers: AnymatchMatcher, testString: null, returnIndex: true | PicomatchOptions): AnymatchTester;
(matchers: AnymatchMatcher, testString: string|any[], returnIndex: true | PicomatchOptions): number;
(matchers: AnymatchMatcher, testString: string|any[]): boolean;
}
export {AnymatchMatcher as Matcher}
export {AnymatchTester as Tester}
export default anymatch

View File

@@ -1,104 +0,0 @@
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const picomatch = require('picomatch');
const normalizePath = require('normalize-path');
/**
* @typedef {(testString: string) => boolean} AnymatchFn
* @typedef {string|RegExp|AnymatchFn} AnymatchPattern
* @typedef {AnymatchPattern|AnymatchPattern[]} AnymatchMatcher
*/
const BANG = '!';
const DEFAULT_OPTIONS = {returnIndex: false};
const arrify = (item) => Array.isArray(item) ? item : [item];
/**
* @param {AnymatchPattern} matcher
* @param {object} options
* @returns {AnymatchFn}
*/
const createPattern = (matcher, options) => {
if (typeof matcher === 'function') {
return matcher;
}
if (typeof matcher === 'string') {
const glob = picomatch(matcher, options);
return (string) => matcher === string || glob(string);
}
if (matcher instanceof RegExp) {
return (string) => matcher.test(string);
}
return (string) => false;
};
/**
* @param {Array<Function>} patterns
* @param {Array<Function>} negPatterns
* @param {String|Array} args
* @param {Boolean} returnIndex
* @returns {boolean|number}
*/
const matchPatterns = (patterns, negPatterns, args, returnIndex) => {
const isList = Array.isArray(args);
const _path = isList ? args[0] : args;
if (!isList && typeof _path !== 'string') {
throw new TypeError('anymatch: second argument must be a string: got ' +
Object.prototype.toString.call(_path))
}
const path = normalizePath(_path, false);
for (let index = 0; index < negPatterns.length; index++) {
const nglob = negPatterns[index];
if (nglob(path)) {
return returnIndex ? -1 : false;
}
}
const applied = isList && [path].concat(args.slice(1));
for (let index = 0; index < patterns.length; index++) {
const pattern = patterns[index];
if (isList ? pattern(...applied) : pattern(path)) {
return returnIndex ? index : true;
}
}
return returnIndex ? -1 : false;
};
/**
* @param {AnymatchMatcher} matchers
* @param {Array|string} testString
* @param {object} options
* @returns {boolean|number|Function}
*/
const anymatch = (matchers, testString, options = DEFAULT_OPTIONS) => {
if (matchers == null) {
throw new TypeError('anymatch: specify first argument');
}
const opts = typeof options === 'boolean' ? {returnIndex: options} : options;
const returnIndex = opts.returnIndex || false;
// Early cache for matchers.
const mtchers = arrify(matchers);
const negatedGlobs = mtchers
.filter(item => typeof item === 'string' && item.charAt(0) === BANG)
.map(item => item.slice(1))
.map(item => picomatch(item, opts));
const patterns = mtchers
.filter(item => typeof item !== 'string' || (typeof item === 'string' && item.charAt(0) !== BANG))
.map(matcher => createPattern(matcher, opts));
if (testString == null) {
return (testString, ri = false) => {
const returnIndex = typeof ri === 'boolean' ? ri : false;
return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
}
}
return matchPatterns(patterns, negatedGlobs, testString, returnIndex);
};
anymatch.default = anymatch;
module.exports = anymatch;

View File

@@ -1,48 +0,0 @@
{
"name": "anymatch",
"version": "3.1.3",
"description": "Matches strings against configurable strings, globs, regular expressions, and/or functions",
"files": [
"index.js",
"index.d.ts"
],
"dependencies": {
"normalize-path": "^3.0.0",
"picomatch": "^2.0.4"
},
"author": {
"name": "Elan Shanker",
"url": "https://github.com/es128"
},
"license": "ISC",
"homepage": "https://github.com/micromatch/anymatch",
"repository": {
"type": "git",
"url": "https://github.com/micromatch/anymatch"
},
"keywords": [
"match",
"any",
"string",
"file",
"fs",
"list",
"glob",
"regex",
"regexp",
"regular",
"expression",
"function"
],
"scripts": {
"test": "nyc mocha",
"mocha": "mocha"
},
"devDependencies": {
"mocha": "^6.1.3",
"nyc": "^14.0.0"
},
"engines": {
"node": ">= 8"
}
}

View File

@@ -1,216 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [2.0.1] - 2020-08-29
### Fixed
- Fix issue with `process.argv` when used with interpreters (`coffee`, `ts-node`, etc.), #150.
## [2.0.0] - 2020-08-14
### Changed
- Full rewrite. Now port from python 3.9.0 & more precise following.
See [doc](./doc) for difference and migration info.
- node.js 10+ required
- Removed most of local docs in favour of original ones.
## [1.0.10] - 2018-02-15
### Fixed
- Use .concat instead of + for arrays, #122.
## [1.0.9] - 2016-09-29
### Changed
- Rerelease after 1.0.8 - deps cleanup.
## [1.0.8] - 2016-09-29
### Changed
- Maintenance (deps bump, fix node 6.5+ tests, coverage report).
## [1.0.7] - 2016-03-17
### Changed
- Teach `addArgument` to accept string arg names. #97, @tomxtobin.
## [1.0.6] - 2016-02-06
### Changed
- Maintenance: moved to eslint & updated CS.
## [1.0.5] - 2016-02-05
### Changed
- Removed lodash dependency to significantly reduce install size.
Thanks to @mourner.
## [1.0.4] - 2016-01-17
### Changed
- Maintenance: lodash update to 4.0.0.
## [1.0.3] - 2015-10-27
### Fixed
- Fix parse `=` in args: `--examplepath="C:\myfolder\env=x64"`. #84, @CatWithApple.
## [1.0.2] - 2015-03-22
### Changed
- Relaxed lodash version dependency.
## [1.0.1] - 2015-02-20
### Changed
- Changed dependencies to be compatible with ancient nodejs.
## [1.0.0] - 2015-02-19
### Changed
- Maintenance release.
- Replaced `underscore` with `lodash`.
- Bumped version to 1.0.0 to better reflect semver meaning.
- HISTORY.md -> CHANGELOG.md
## [0.1.16] - 2013-12-01
### Changed
- Maintenance release. Updated dependencies and docs.
## [0.1.15] - 2013-05-13
### Fixed
- Fixed #55, @trebor89
## [0.1.14] - 2013-05-12
### Fixed
- Fixed #62, @maxtaco
## [0.1.13] - 2013-04-08
### Changed
- Added `.npmignore` to reduce package size
## [0.1.12] - 2013-02-10
### Fixed
- Fixed conflictHandler (#46), @hpaulj
## [0.1.11] - 2013-02-07
### Added
- Added 70+ tests (ported from python), @hpaulj
- Added conflictHandler, @applepicke
- Added fromfilePrefixChar, @hpaulj
### Fixed
- Multiple bugfixes, @hpaulj
## [0.1.10] - 2012-12-30
### Added
- Added [mutual exclusion](http://docs.python.org/dev/library/argparse.html#mutual-exclusion)
support, thanks to @hpaulj
### Fixed
- Fixed options check for `storeConst` & `appendConst` actions, thanks to @hpaulj
## [0.1.9] - 2012-12-27
### Fixed
- Fixed option dest interferens with other options (issue #23), thanks to @hpaulj
- Fixed default value behavior with `*` positionals, thanks to @hpaulj
- Improve `getDefault()` behavior, thanks to @hpaulj
- Improve negative argument parsing, thanks to @hpaulj
## [0.1.8] - 2012-12-01
### Fixed
- Fixed parser parents (issue #19), thanks to @hpaulj
- Fixed negative argument parse (issue #20), thanks to @hpaulj
## [0.1.7] - 2012-10-14
### Fixed
- Fixed 'choices' argument parse (issue #16)
- Fixed stderr output (issue #15)
## [0.1.6] - 2012-09-09
### Fixed
- Fixed check for conflict of options (thanks to @tomxtobin)
## [0.1.5] - 2012-09-03
### Fixed
- Fix parser #setDefaults method (thanks to @tomxtobin)
## [0.1.4] - 2012-07-30
### Fixed
- Fixed pseudo-argument support (thanks to @CGamesPlay)
- Fixed addHelp default (should be true), if not set (thanks to @benblank)
## [0.1.3] - 2012-06-27
### Fixed
- Fixed formatter api name: Formatter -> HelpFormatter
## [0.1.2] - 2012-05-29
### Fixed
- Removed excess whitespace in help
- Fixed error reporting, when parcer with subcommands
called with empty arguments
### Added
- Added basic tests
## [0.1.1] - 2012-05-23
### Fixed
- Fixed line wrapping in help formatter
- Added better error reporting on invalid arguments
## [0.1.0] - 2012-05-16
### Added
- First release.
[2.0.1]: https://github.com/nodeca/argparse/compare/2.0.0...2.0.1
[2.0.0]: https://github.com/nodeca/argparse/compare/1.0.10...2.0.0
[1.0.10]: https://github.com/nodeca/argparse/compare/1.0.9...1.0.10
[1.0.9]: https://github.com/nodeca/argparse/compare/1.0.8...1.0.9
[1.0.8]: https://github.com/nodeca/argparse/compare/1.0.7...1.0.8
[1.0.7]: https://github.com/nodeca/argparse/compare/1.0.6...1.0.7
[1.0.6]: https://github.com/nodeca/argparse/compare/1.0.5...1.0.6
[1.0.5]: https://github.com/nodeca/argparse/compare/1.0.4...1.0.5
[1.0.4]: https://github.com/nodeca/argparse/compare/1.0.3...1.0.4
[1.0.3]: https://github.com/nodeca/argparse/compare/1.0.2...1.0.3
[1.0.2]: https://github.com/nodeca/argparse/compare/1.0.1...1.0.2
[1.0.1]: https://github.com/nodeca/argparse/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/nodeca/argparse/compare/0.1.16...1.0.0
[0.1.16]: https://github.com/nodeca/argparse/compare/0.1.15...0.1.16
[0.1.15]: https://github.com/nodeca/argparse/compare/0.1.14...0.1.15
[0.1.14]: https://github.com/nodeca/argparse/compare/0.1.13...0.1.14
[0.1.13]: https://github.com/nodeca/argparse/compare/0.1.12...0.1.13
[0.1.12]: https://github.com/nodeca/argparse/compare/0.1.11...0.1.12
[0.1.11]: https://github.com/nodeca/argparse/compare/0.1.10...0.1.11
[0.1.10]: https://github.com/nodeca/argparse/compare/0.1.9...0.1.10
[0.1.9]: https://github.com/nodeca/argparse/compare/0.1.8...0.1.9
[0.1.8]: https://github.com/nodeca/argparse/compare/0.1.7...0.1.8
[0.1.7]: https://github.com/nodeca/argparse/compare/0.1.6...0.1.7
[0.1.6]: https://github.com/nodeca/argparse/compare/0.1.5...0.1.6
[0.1.5]: https://github.com/nodeca/argparse/compare/0.1.4...0.1.5
[0.1.4]: https://github.com/nodeca/argparse/compare/0.1.3...0.1.4
[0.1.3]: https://github.com/nodeca/argparse/compare/0.1.2...0.1.3
[0.1.2]: https://github.com/nodeca/argparse/compare/0.1.1...0.1.2
[0.1.1]: https://github.com/nodeca/argparse/compare/0.1.0...0.1.1
[0.1.0]: https://github.com/nodeca/argparse/releases/tag/0.1.0

View File

@@ -1,254 +0,0 @@
A. HISTORY OF THE SOFTWARE
==========================
Python was created in the early 1990s by Guido van Rossum at Stichting
Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands
as a successor of a language called ABC. Guido remains Python's
principal author, although it includes many contributions from others.
In 1995, Guido continued his work on Python at the Corporation for
National Research Initiatives (CNRI, see http://www.cnri.reston.va.us)
in Reston, Virginia where he released several versions of the
software.
In May 2000, Guido and the Python core development team moved to
BeOpen.com to form the BeOpen PythonLabs team. In October of the same
year, the PythonLabs team moved to Digital Creations, which became
Zope Corporation. In 2001, the Python Software Foundation (PSF, see
https://www.python.org/psf/) was formed, a non-profit organization
created specifically to own Python-related Intellectual Property.
Zope Corporation was a sponsoring member of the PSF.
All Python releases are Open Source (see http://www.opensource.org for
the Open Source Definition). Historically, most, but not all, Python
releases have also been GPL-compatible; the table below summarizes
the various releases.
Release Derived Year Owner GPL-
from compatible? (1)
0.9.0 thru 1.2 1991-1995 CWI yes
1.3 thru 1.5.2 1.2 1995-1999 CNRI yes
1.6 1.5.2 2000 CNRI no
2.0 1.6 2000 BeOpen.com no
1.6.1 1.6 2001 CNRI yes (2)
2.1 2.0+1.6.1 2001 PSF no
2.0.1 2.0+1.6.1 2001 PSF yes
2.1.1 2.1+2.0.1 2001 PSF yes
2.1.2 2.1.1 2002 PSF yes
2.1.3 2.1.2 2002 PSF yes
2.2 and above 2.1.1 2001-now PSF yes
Footnotes:
(1) GPL-compatible doesn't mean that we're distributing Python under
the GPL. All Python licenses, unlike the GPL, let you distribute
a modified version without making your changes open source. The
GPL-compatible licenses make it possible to combine Python with
other software that is released under the GPL; the others don't.
(2) According to Richard Stallman, 1.6.1 is not GPL-compatible,
because its license has a choice of law clause. According to
CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1
is "not incompatible" with the GPL.
Thanks to the many outside volunteers who have worked under Guido's
direction to make these releases possible.
B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON
===============================================================
PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
--------------------------------------------
1. This LICENSE AGREEMENT is between the Python Software Foundation
("PSF"), and the Individual or Organization ("Licensee") accessing and
otherwise using this software ("Python") in source or binary form and
its associated documentation.
2. Subject to the terms and conditions of this License Agreement, PSF hereby
grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce,
analyze, test, perform and/or display publicly, prepare derivative works,
distribute, and otherwise use Python alone or in any derivative version,
provided, however, that PSF's License Agreement and PSF's notice of copyright,
i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Python Software Foundation;
All Rights Reserved" are retained in Python alone or in any derivative version
prepared by Licensee.
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python.
4. PSF is making Python available to Licensee on an "AS IS"
basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. Nothing in this License Agreement shall be deemed to create any
relationship of agency, partnership, or joint venture between PSF and
Licensee. This License Agreement does not grant permission to use PSF
trademarks or trade name in a trademark sense to endorse or promote
products or services of Licensee, or any third party.
8. By copying, installing or otherwise using Python, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
-------------------------------------------
BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
Individual or Organization ("Licensee") accessing and otherwise using
this software in source or binary form and its associated
documentation ("the Software").
2. Subject to the terms and conditions of this BeOpen Python License
Agreement, BeOpen hereby grants Licensee a non-exclusive,
royalty-free, world-wide license to reproduce, analyze, test, perform
and/or display publicly, prepare derivative works, distribute, and
otherwise use the Software alone or in any derivative version,
provided, however, that the BeOpen Python License is retained in the
Software, alone or in any derivative version prepared by Licensee.
3. BeOpen is making the Software available to Licensee on an "AS IS"
basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
5. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
6. This License Agreement shall be governed by and interpreted in all
respects by the law of the State of California, excluding conflict of
law provisions. Nothing in this License Agreement shall be deemed to
create any relationship of agency, partnership, or joint venture
between BeOpen and Licensee. This License Agreement does not grant
permission to use BeOpen trademarks or trade names in a trademark
sense to endorse or promote products or services of Licensee, or any
third party. As an exception, the "BeOpen Python" logos available at
http://www.pythonlabs.com/logos.html may be used according to the
permissions granted on that web page.
7. By copying, installing or otherwise using the software, Licensee
agrees to be bound by the terms and conditions of this License
Agreement.
CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1
---------------------------------------
1. This LICENSE AGREEMENT is between the Corporation for National
Research Initiatives, having an office at 1895 Preston White Drive,
Reston, VA 20191 ("CNRI"), and the Individual or Organization
("Licensee") accessing and otherwise using Python 1.6.1 software in
source or binary form and its associated documentation.
2. Subject to the terms and conditions of this License Agreement, CNRI
hereby grants Licensee a nonexclusive, royalty-free, world-wide
license to reproduce, analyze, test, perform and/or display publicly,
prepare derivative works, distribute, and otherwise use Python 1.6.1
alone or in any derivative version, provided, however, that CNRI's
License Agreement and CNRI's notice of copyright, i.e., "Copyright (c)
1995-2001 Corporation for National Research Initiatives; All Rights
Reserved" are retained in Python 1.6.1 alone or in any derivative
version prepared by Licensee. Alternately, in lieu of CNRI's License
Agreement, Licensee may substitute the following text (omitting the
quotes): "Python 1.6.1 is made available subject to the terms and
conditions in CNRI's License Agreement. This Agreement together with
Python 1.6.1 may be located on the Internet using the following
unique, persistent identifier (known as a handle): 1895.22/1013. This
Agreement may also be obtained from a proxy server on the Internet
using the following URL: http://hdl.handle.net/1895.22/1013".
3. In the event Licensee prepares a derivative work that is based on
or incorporates Python 1.6.1 or any part thereof, and wants to make
the derivative work available to others as provided herein, then
Licensee hereby agrees to include in any such work a brief summary of
the changes made to Python 1.6.1.
4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS"
basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT
INFRINGE ANY THIRD PARTY RIGHTS.
5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1,
OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
6. This License Agreement will automatically terminate upon a material
breach of its terms and conditions.
7. This License Agreement shall be governed by the federal
intellectual property law of the United States, including without
limitation the federal copyright law, and, to the extent such
U.S. federal law does not apply, by the law of the Commonwealth of
Virginia, excluding Virginia's conflict of law provisions.
Notwithstanding the foregoing, with regard to derivative works based
on Python 1.6.1 that incorporate non-separable material that was
previously distributed under the GNU General Public License (GPL), the
law of the Commonwealth of Virginia shall govern this License
Agreement only as to issues arising under or with respect to
Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this
License Agreement shall be deemed to create any relationship of
agency, partnership, or joint venture between CNRI and Licensee. This
License Agreement does not grant permission to use CNRI trademarks or
trade name in a trademark sense to endorse or promote products or
services of Licensee, or any third party.
8. By clicking on the "ACCEPT" button where indicated, or by copying,
installing or otherwise using Python 1.6.1, Licensee agrees to be
bound by the terms and conditions of this License Agreement.
ACCEPT
CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
--------------------------------------------------
Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
The Netherlands. All rights reserved.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior
permission.
STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@@ -1,84 +0,0 @@
argparse
========
[![Build Status](https://secure.travis-ci.org/nodeca/argparse.svg?branch=master)](http://travis-ci.org/nodeca/argparse)
[![NPM version](https://img.shields.io/npm/v/argparse.svg)](https://www.npmjs.org/package/argparse)
CLI arguments parser for node.js, with [sub-commands](https://docs.python.org/3.9/library/argparse.html#sub-commands) support. Port of python's [argparse](http://docs.python.org/dev/library/argparse.html) (version [3.9.0](https://github.com/python/cpython/blob/v3.9.0rc1/Lib/argparse.py)).
**Difference with original.**
- JS has no keyword arguments support.
- Pass options instead: `new ArgumentParser({ description: 'example', add_help: true })`.
- JS has no python's types `int`, `float`, ...
- Use string-typed names: `.add_argument('-b', { type: 'int', help: 'help' })`.
- `%r` format specifier uses `require('util').inspect()`.
More details in [doc](./doc).
Example
-------
`test.js` file:
```javascript
#!/usr/bin/env node
'use strict';
const { ArgumentParser } = require('argparse');
const { version } = require('./package.json');
const parser = new ArgumentParser({
description: 'Argparse example'
});
parser.add_argument('-v', '--version', { action: 'version', version });
parser.add_argument('-f', '--foo', { help: 'foo bar' });
parser.add_argument('-b', '--bar', { help: 'bar foo' });
parser.add_argument('--baz', { help: 'baz bar' });
console.dir(parser.parse_args());
```
Display help:
```
$ ./test.js -h
usage: test.js [-h] [-v] [-f FOO] [-b BAR] [--baz BAZ]
Argparse example
optional arguments:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-f FOO, --foo FOO foo bar
-b BAR, --bar BAR bar foo
--baz BAZ baz bar
```
Parse arguments:
```
$ ./test.js -f=3 --bar=4 --baz 5
{ foo: '3', bar: '4', baz: '5' }
```
API docs
--------
Since this is a port with minimal divergence, there's no separate documentation.
Use original one instead, with notes about difference.
1. [Original doc](https://docs.python.org/3.9/library/argparse.html).
2. [Original tutorial](https://docs.python.org/3.9/howto/argparse.html).
3. [Difference with python](./doc).
argparse for enterprise
-----------------------
Available as part of the Tidelift Subscription
The maintainers of argparse and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-argparse?utm_source=npm-argparse&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

File diff suppressed because it is too large Load Diff

View File

@@ -1,67 +0,0 @@
// Limited implementation of python % string operator, supports only %s and %r for now
// (other formats are not used here, but may appear in custom templates)
'use strict'
const { inspect } = require('util')
module.exports = function sub(pattern, ...values) {
let regex = /%(?:(%)|(-)?(\*)?(?:\((\w+)\))?([A-Za-z]))/g
let result = pattern.replace(regex, function (_, is_literal, is_left_align, is_padded, name, format) {
if (is_literal) return '%'
let padded_count = 0
if (is_padded) {
if (values.length === 0) throw new TypeError('not enough arguments for format string')
padded_count = values.shift()
if (!Number.isInteger(padded_count)) throw new TypeError('* wants int')
}
let str
if (name !== undefined) {
let dict = values[0]
if (typeof dict !== 'object' || dict === null) throw new TypeError('format requires a mapping')
if (!(name in dict)) throw new TypeError(`no such key: '${name}'`)
str = dict[name]
} else {
if (values.length === 0) throw new TypeError('not enough arguments for format string')
str = values.shift()
}
switch (format) {
case 's':
str = String(str)
break
case 'r':
str = inspect(str)
break
case 'd':
case 'i':
if (typeof str !== 'number') {
throw new TypeError(`%${format} format: a number is required, not ${typeof str}`)
}
str = String(str.toFixed(0))
break
default:
throw new TypeError(`unsupported format character '${format}'`)
}
if (padded_count > 0) {
return is_left_align ? str.padEnd(padded_count) : str.padStart(padded_count)
} else {
return str
}
})
if (values.length) {
if (values.length === 1 && typeof values[0] === 'object' && values[0] !== null) {
// mapping
} else {
throw new TypeError('not all arguments converted during string formatting')
}
}
return result
}

View File

@@ -1,440 +0,0 @@
// Partial port of python's argparse module, version 3.9.0 (only wrap and fill functions):
// https://github.com/python/cpython/blob/v3.9.0b4/Lib/textwrap.py
'use strict'
/*
* Text wrapping and filling.
*/
// Copyright (C) 1999-2001 Gregory P. Ward.
// Copyright (C) 2002, 2003 Python Software Foundation.
// Copyright (C) 2020 argparse.js authors
// Originally written by Greg Ward <gward@python.net>
// Hardcode the recognized whitespace characters to the US-ASCII
// whitespace characters. The main reason for doing this is that
// some Unicode spaces (like \u00a0) are non-breaking whitespaces.
//
// This less funky little regex just split on recognized spaces. E.g.
// "Hello there -- you goof-ball, use the -b option!"
// splits into
// Hello/ /there/ /--/ /you/ /goof-ball,/ /use/ /the/ /-b/ /option!/
const wordsep_simple_re = /([\t\n\x0b\x0c\r ]+)/
class TextWrapper {
/*
* Object for wrapping/filling text. The public interface consists of
* the wrap() and fill() methods; the other methods are just there for
* subclasses to override in order to tweak the default behaviour.
* If you want to completely replace the main wrapping algorithm,
* you'll probably have to override _wrap_chunks().
*
* Several instance attributes control various aspects of wrapping:
* width (default: 70)
* the maximum width of wrapped lines (unless break_long_words
* is false)
* initial_indent (default: "")
* string that will be prepended to the first line of wrapped
* output. Counts towards the line's width.
* subsequent_indent (default: "")
* string that will be prepended to all lines save the first
* of wrapped output; also counts towards each line's width.
* expand_tabs (default: true)
* Expand tabs in input text to spaces before further processing.
* Each tab will become 0 .. 'tabsize' spaces, depending on its position
* in its line. If false, each tab is treated as a single character.
* tabsize (default: 8)
* Expand tabs in input text to 0 .. 'tabsize' spaces, unless
* 'expand_tabs' is false.
* replace_whitespace (default: true)
* Replace all whitespace characters in the input text by spaces
* after tab expansion. Note that if expand_tabs is false and
* replace_whitespace is true, every tab will be converted to a
* single space!
* fix_sentence_endings (default: false)
* Ensure that sentence-ending punctuation is always followed
* by two spaces. Off by default because the algorithm is
* (unavoidably) imperfect.
* break_long_words (default: true)
* Break words longer than 'width'. If false, those words will not
* be broken, and some lines might be longer than 'width'.
* break_on_hyphens (default: true)
* Allow breaking hyphenated words. If true, wrapping will occur
* preferably on whitespaces and right after hyphens part of
* compound words.
* drop_whitespace (default: true)
* Drop leading and trailing whitespace from lines.
* max_lines (default: None)
* Truncate wrapped lines.
* placeholder (default: ' [...]')
* Append to the last line of truncated text.
*/
constructor(options = {}) {
let {
width = 70,
initial_indent = '',
subsequent_indent = '',
expand_tabs = true,
replace_whitespace = true,
fix_sentence_endings = false,
break_long_words = true,
drop_whitespace = true,
break_on_hyphens = true,
tabsize = 8,
max_lines = undefined,
placeholder=' [...]'
} = options
this.width = width
this.initial_indent = initial_indent
this.subsequent_indent = subsequent_indent
this.expand_tabs = expand_tabs
this.replace_whitespace = replace_whitespace
this.fix_sentence_endings = fix_sentence_endings
this.break_long_words = break_long_words
this.drop_whitespace = drop_whitespace
this.break_on_hyphens = break_on_hyphens
this.tabsize = tabsize
this.max_lines = max_lines
this.placeholder = placeholder
}
// -- Private methods -----------------------------------------------
// (possibly useful for subclasses to override)
_munge_whitespace(text) {
/*
* _munge_whitespace(text : string) -> string
*
* Munge whitespace in text: expand tabs and convert all other
* whitespace characters to spaces. Eg. " foo\\tbar\\n\\nbaz"
* becomes " foo bar baz".
*/
if (this.expand_tabs) {
text = text.replace(/\t/g, ' '.repeat(this.tabsize)) // not strictly correct in js
}
if (this.replace_whitespace) {
text = text.replace(/[\t\n\x0b\x0c\r]/g, ' ')
}
return text
}
_split(text) {
/*
* _split(text : string) -> [string]
*
* Split the text to wrap into indivisible chunks. Chunks are
* not quite the same as words; see _wrap_chunks() for full
* details. As an example, the text
* Look, goof-ball -- use the -b option!
* breaks into the following chunks:
* 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ',
* 'use', ' ', 'the', ' ', '-b', ' ', 'option!'
* if break_on_hyphens is True, or in:
* 'Look,', ' ', 'goof-ball', ' ', '--', ' ',
* 'use', ' ', 'the', ' ', '-b', ' ', option!'
* otherwise.
*/
let chunks = text.split(wordsep_simple_re)
chunks = chunks.filter(Boolean)
return chunks
}
_handle_long_word(reversed_chunks, cur_line, cur_len, width) {
/*
* _handle_long_word(chunks : [string],
* cur_line : [string],
* cur_len : int, width : int)
*
* Handle a chunk of text (most likely a word, not whitespace) that
* is too long to fit in any line.
*/
// Figure out when indent is larger than the specified width, and make
// sure at least one character is stripped off on every pass
let space_left
if (width < 1) {
space_left = 1
} else {
space_left = width - cur_len
}
// If we're allowed to break long words, then do so: put as much
// of the next chunk onto the current line as will fit.
if (this.break_long_words) {
cur_line.push(reversed_chunks[reversed_chunks.length - 1].slice(0, space_left))
reversed_chunks[reversed_chunks.length - 1] = reversed_chunks[reversed_chunks.length - 1].slice(space_left)
// Otherwise, we have to preserve the long word intact. Only add
// it to the current line if there's nothing already there --
// that minimizes how much we violate the width constraint.
} else if (!cur_line) {
cur_line.push(...reversed_chunks.pop())
}
// If we're not allowed to break long words, and there's already
// text on the current line, do nothing. Next time through the
// main loop of _wrap_chunks(), we'll wind up here again, but
// cur_len will be zero, so the next line will be entirely
// devoted to the long word that we can't handle right now.
}
_wrap_chunks(chunks) {
/*
* _wrap_chunks(chunks : [string]) -> [string]
*
* Wrap a sequence of text chunks and return a list of lines of
* length 'self.width' or less. (If 'break_long_words' is false,
* some lines may be longer than this.) Chunks correspond roughly
* to words and the whitespace between them: each chunk is
* indivisible (modulo 'break_long_words'), but a line break can
* come between any two chunks. Chunks should not have internal
* whitespace; ie. a chunk is either all whitespace or a "word".
* Whitespace chunks will be removed from the beginning and end of
* lines, but apart from that whitespace is preserved.
*/
let lines = []
let indent
if (this.width <= 0) {
throw Error(`invalid width ${this.width} (must be > 0)`)
}
if (this.max_lines !== undefined) {
if (this.max_lines > 1) {
indent = this.subsequent_indent
} else {
indent = this.initial_indent
}
if (indent.length + this.placeholder.trimStart().length > this.width) {
throw Error('placeholder too large for max width')
}
}
// Arrange in reverse order so items can be efficiently popped
// from a stack of chucks.
chunks = chunks.reverse()
while (chunks.length > 0) {
// Start the list of chunks that will make up the current line.
// cur_len is just the length of all the chunks in cur_line.
let cur_line = []
let cur_len = 0
// Figure out which static string will prefix this line.
let indent
if (lines) {
indent = this.subsequent_indent
} else {
indent = this.initial_indent
}
// Maximum width for this line.
let width = this.width - indent.length
// First chunk on line is whitespace -- drop it, unless this
// is the very beginning of the text (ie. no lines started yet).
if (this.drop_whitespace && chunks[chunks.length - 1].trim() === '' && lines.length > 0) {
chunks.pop()
}
while (chunks.length > 0) {
let l = chunks[chunks.length - 1].length
// Can at least squeeze this chunk onto the current line.
if (cur_len + l <= width) {
cur_line.push(chunks.pop())
cur_len += l
// Nope, this line is full.
} else {
break
}
}
// The current line is full, and the next chunk is too big to
// fit on *any* line (not just this one).
if (chunks.length && chunks[chunks.length - 1].length > width) {
this._handle_long_word(chunks, cur_line, cur_len, width)
cur_len = cur_line.map(l => l.length).reduce((a, b) => a + b, 0)
}
// If the last chunk on this line is all whitespace, drop it.
if (this.drop_whitespace && cur_line.length > 0 && cur_line[cur_line.length - 1].trim() === '') {
cur_len -= cur_line[cur_line.length - 1].length
cur_line.pop()
}
if (cur_line) {
if (this.max_lines === undefined ||
lines.length + 1 < this.max_lines ||
(chunks.length === 0 ||
this.drop_whitespace &&
chunks.length === 1 &&
!chunks[0].trim()) && cur_len <= width) {
// Convert current line back to a string and store it in
// list of all lines (return value).
lines.push(indent + cur_line.join(''))
} else {
let had_break = false
while (cur_line) {
if (cur_line[cur_line.length - 1].trim() &&
cur_len + this.placeholder.length <= width) {
cur_line.push(this.placeholder)
lines.push(indent + cur_line.join(''))
had_break = true
break
}
cur_len -= cur_line[-1].length
cur_line.pop()
}
if (!had_break) {
if (lines) {
let prev_line = lines[lines.length - 1].trimEnd()
if (prev_line.length + this.placeholder.length <=
this.width) {
lines[lines.length - 1] = prev_line + this.placeholder
break
}
}
lines.push(indent + this.placeholder.lstrip())
}
break
}
}
}
return lines
}
_split_chunks(text) {
text = this._munge_whitespace(text)
return this._split(text)
}
// -- Public interface ----------------------------------------------
wrap(text) {
/*
* wrap(text : string) -> [string]
*
* Reformat the single paragraph in 'text' so it fits in lines of
* no more than 'self.width' columns, and return a list of wrapped
* lines. Tabs in 'text' are expanded with string.expandtabs(),
* and all other whitespace characters (including newline) are
* converted to space.
*/
let chunks = this._split_chunks(text)
// not implemented in js
//if (this.fix_sentence_endings) {
// this._fix_sentence_endings(chunks)
//}
return this._wrap_chunks(chunks)
}
fill(text) {
/*
* fill(text : string) -> string
*
* Reformat the single paragraph in 'text' to fit in lines of no
* more than 'self.width' columns, and return a new string
* containing the entire wrapped paragraph.
*/
return this.wrap(text).join('\n')
}
}
// -- Convenience interface ---------------------------------------------
function wrap(text, options = {}) {
/*
* Wrap a single paragraph of text, returning a list of wrapped lines.
*
* Reformat the single paragraph in 'text' so it fits in lines of no
* more than 'width' columns, and return a list of wrapped lines. By
* default, tabs in 'text' are expanded with string.expandtabs(), and
* all other whitespace characters (including newline) are converted to
* space. See TextWrapper class for available keyword args to customize
* wrapping behaviour.
*/
let { width = 70, ...kwargs } = options
let w = new TextWrapper(Object.assign({ width }, kwargs))
return w.wrap(text)
}
function fill(text, options = {}) {
/*
* Fill a single paragraph of text, returning a new string.
*
* Reformat the single paragraph in 'text' to fit in lines of no more
* than 'width' columns, and return a new string containing the entire
* wrapped paragraph. As with wrap(), tabs are expanded and other
* whitespace characters converted to space. See TextWrapper class for
* available keyword args to customize wrapping behaviour.
*/
let { width = 70, ...kwargs } = options
let w = new TextWrapper(Object.assign({ width }, kwargs))
return w.fill(text)
}
// -- Loosely related functionality -------------------------------------
let _whitespace_only_re = /^[ \t]+$/mg
let _leading_whitespace_re = /(^[ \t]*)(?:[^ \t\n])/mg
function dedent(text) {
/*
* Remove any common leading whitespace from every line in `text`.
*
* This can be used to make triple-quoted strings line up with the left
* edge of the display, while still presenting them in the source code
* in indented form.
*
* Note that tabs and spaces are both treated as whitespace, but they
* are not equal: the lines " hello" and "\\thello" are
* considered to have no common leading whitespace.
*
* Entirely blank lines are normalized to a newline character.
*/
// Look for the longest leading string of spaces and tabs common to
// all lines.
let margin = undefined
text = text.replace(_whitespace_only_re, '')
let indents = text.match(_leading_whitespace_re) || []
for (let indent of indents) {
indent = indent.slice(0, -1)
if (margin === undefined) {
margin = indent
// Current line more deeply indented than previous winner:
// no change (previous winner is still on top).
} else if (indent.startsWith(margin)) {
// pass
// Current line consistent with and no deeper than previous winner:
// it's the new winner.
} else if (margin.startsWith(indent)) {
margin = indent
// Find the largest common whitespace between current line and previous
// winner.
} else {
for (let i = 0; i < margin.length && i < indent.length; i++) {
if (margin[i] !== indent[i]) {
margin = margin.slice(0, i)
break
}
}
}
}
if (margin) {
text = text.replace(new RegExp('^' + margin, 'mg'), '')
}
return text
}
module.exports = { wrap, fill, dedent }

View File

@@ -1,31 +0,0 @@
{
"name": "argparse",
"description": "CLI arguments parser. Native port of python's argparse.",
"version": "2.0.1",
"keywords": [
"cli",
"parser",
"argparse",
"option",
"args"
],
"main": "argparse.js",
"files": [
"argparse.js",
"lib/"
],
"license": "Python-2.0",
"repository": "nodeca/argparse",
"scripts": {
"lint": "eslint .",
"test": "npm run lint && nyc mocha",
"coverage": "npm run test && nyc report --reporter html"
},
"devDependencies": {
"@babel/eslint-parser": "^7.11.0",
"@babel/plugin-syntax-class-properties": "^7.10.4",
"eslint": "^7.5.0",
"mocha": "^8.0.1",
"nyc": "^15.1.0"
}
}

View File

@@ -1,24 +0,0 @@
1.1.0 / 2018-01-02
==================
* Add type definitions ([#11](https://github.com/chaijs/assertion-error/pull/11))
1.0.1 / 2015-03-04
==================
* Merge pull request #2 from simonzack/master
* fixes `.stack` on firefox
1.0.0 / 2013-06-08
==================
* readme: change travis and component urls
* refactor: [*] prepare for move to chaijs gh org
0.1.0 / 2013-04-07
==================
* test: use vanilla test runner/assert
* pgk: remove unused deps
* lib: implement
* "Initial commit"

View File

@@ -1,41 +0,0 @@
# AssertionError [![Build Status](https://travis-ci.org/chaijs/assertion-error.png?branch=master)](https://travis-ci.org/chaijs/assertion-error)
> Error constructor for test and validation frameworks that implements standardized AssertionError specification.
## Installation
### Node.js
`assertion-error` is available on [npm](http://npmjs.org).
$ npm install assertion-error
### Component
`assertion-error` is available as a [component](https://github.com/component/component).
$ component install chaijs/assertion-error
## License
(The MIT License)
Copyright (c) 2013 Jake Luer <jake@qualiancy.com> (http://qualiancy.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -1,11 +0,0 @@
type AssertionError<T = {}> = Error & T & {
showDiff: boolean;
};
interface AssertionErrorConstructor {
new<T = {}>(message: string, props?: T, ssf?: Function): AssertionError<T>;
}
declare const AssertionError: AssertionErrorConstructor;
export = AssertionError;

View File

@@ -1,116 +0,0 @@
/*!
* assertion-error
* Copyright(c) 2013 Jake Luer <jake@qualiancy.com>
* MIT Licensed
*/
/*!
* Return a function that will copy properties from
* one object to another excluding any originally
* listed. Returned function will create a new `{}`.
*
* @param {String} excluded properties ...
* @return {Function}
*/
function exclude () {
var excludes = [].slice.call(arguments);
function excludeProps (res, obj) {
Object.keys(obj).forEach(function (key) {
if (!~excludes.indexOf(key)) res[key] = obj[key];
});
}
return function extendExclude () {
var args = [].slice.call(arguments)
, i = 0
, res = {};
for (; i < args.length; i++) {
excludeProps(res, args[i]);
}
return res;
};
};
/*!
* Primary Exports
*/
module.exports = AssertionError;
/**
* ### AssertionError
*
* An extension of the JavaScript `Error` constructor for
* assertion and validation scenarios.
*
* @param {String} message
* @param {Object} properties to include (optional)
* @param {callee} start stack function (optional)
*/
function AssertionError (message, _props, ssf) {
var extend = exclude('name', 'message', 'stack', 'constructor', 'toJSON')
, props = extend(_props || {});
// default values
this.message = message || 'Unspecified AssertionError';
this.showDiff = false;
// copy from properties
for (var key in props) {
this[key] = props[key];
}
// capture stack trace
ssf = ssf || AssertionError;
if (Error.captureStackTrace) {
Error.captureStackTrace(this, ssf);
} else {
try {
throw new Error();
} catch(e) {
this.stack = e.stack;
}
}
}
/*!
* Inherit from Error.prototype
*/
AssertionError.prototype = Object.create(Error.prototype);
/*!
* Statically set name
*/
AssertionError.prototype.name = 'AssertionError';
/*!
* Ensure correct constructor
*/
AssertionError.prototype.constructor = AssertionError;
/**
* Allow errors to be converted to JSON for static transfer.
*
* @param {Boolean} include stack (default: `true`)
* @return {Object} object that can be `JSON.stringify`
*/
AssertionError.prototype.toJSON = function (stack) {
var extend = exclude('constructor', 'toJSON', 'stack')
, props = extend({ name: this.name }, this);
// include stack if exists and not turned off
if (false !== stack && this.stack) {
props.stack = this.stack;
}
return props;
};

View File

@@ -1,29 +0,0 @@
{
"name": "assertion-error",
"version": "1.1.0",
"description": "Error constructor for test and validation frameworks that implements standardized AssertionError specification.",
"author": "Jake Luer <jake@qualiancy.com> (http://qualiancy.com)",
"license": "MIT",
"types": "./index.d.ts",
"keywords": [
"test",
"assertion",
"assertion-error"
],
"repository": {
"type": "git",
"url": "git@github.com:chaijs/assertion-error.git"
},
"engines": {
"node": "*"
},
"main": "./index",
"scripts": {
"test": "make test"
},
"dependencies": {},
"devDependencies": {
"component": "*",
"typescript": "^2.6.1"
}
}

View File

@@ -1,21 +0,0 @@
The MIT License (MIT)
Copyright (c) 2016 Alex Indigo
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,233 +0,0 @@
# asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit)
Minimal async jobs utility library, with streams support.
[![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit)
[![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit)
[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit)
[![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master)
[![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit)
[![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit)
<!-- [![Readme](https://img.shields.io/badge/readme-tested-brightgreen.svg?style=flat)](https://www.npmjs.com/package/reamde) -->
AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects.
Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method.
It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators.
| compression | size |
| :----------------- | -------: |
| asynckit.js | 12.34 kB |
| asynckit.min.js | 4.11 kB |
| asynckit.min.js.gz | 1.47 kB |
## Install
```sh
$ npm install --save asynckit
```
## Examples
### Parallel Jobs
Runs iterator over provided array in parallel. Stores output in the `result` array,
on the matching positions. In unlikely event of an error from one of the jobs,
will terminate rest of the active jobs (if abort function is provided)
and return error along with salvaged data to the main callback function.
#### Input Array
```javascript
var parallel = require('asynckit').parallel
, assert = require('assert')
;
var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
, expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
, expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
, target = []
;
parallel(source, asyncJob, function(err, result)
{
assert.deepEqual(result, expectedResult);
assert.deepEqual(target, expectedTarget);
});
// async job accepts one element from the array
// and a callback function
function asyncJob(item, cb)
{
// different delays (in ms) per item
var delay = item * 25;
// pretend different jobs take different time to finish
// and not in consequential order
var timeoutId = setTimeout(function() {
target.push(item);
cb(null, item * 2);
}, delay);
// allow to cancel "leftover" jobs upon error
// return function, invoking of which will abort this job
return clearTimeout.bind(null, timeoutId);
}
```
More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js).
#### Input Object
Also it supports named jobs, listed via object.
```javascript
var parallel = require('asynckit/parallel')
, assert = require('assert')
;
var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
, expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
, expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
, expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ]
, target = []
, keys = []
;
parallel(source, asyncJob, function(err, result)
{
assert.deepEqual(result, expectedResult);
assert.deepEqual(target, expectedTarget);
assert.deepEqual(keys, expectedKeys);
});
// supports full value, key, callback (shortcut) interface
function asyncJob(item, key, cb)
{
// different delays (in ms) per item
var delay = item * 25;
// pretend different jobs take different time to finish
// and not in consequential order
var timeoutId = setTimeout(function() {
keys.push(key);
target.push(item);
cb(null, item * 2);
}, delay);
// allow to cancel "leftover" jobs upon error
// return function, invoking of which will abort this job
return clearTimeout.bind(null, timeoutId);
}
```
More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js).
### Serial Jobs
Runs iterator over provided array sequentially. Stores output in the `result` array,
on the matching positions. In unlikely event of an error from one of the jobs,
will not proceed to the rest of the items in the list
and return error along with salvaged data to the main callback function.
#### Input Array
```javascript
var serial = require('asynckit/serial')
, assert = require('assert')
;
var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
, expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
, expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
, target = []
;
serial(source, asyncJob, function(err, result)
{
assert.deepEqual(result, expectedResult);
assert.deepEqual(target, expectedTarget);
});
// extended interface (item, key, callback)
// also supported for arrays
function asyncJob(item, key, cb)
{
target.push(key);
// it will be automatically made async
// even it iterator "returns" in the same event loop
cb(null, item * 2);
}
```
More examples could be found in [test/test-serial-array.js](test/test-serial-array.js).
#### Input Object
Also it supports named jobs, listed via object.
```javascript
var serial = require('asynckit').serial
, assert = require('assert')
;
var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
, expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
, expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
, target = []
;
var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
, expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
, expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
, target = []
;
serial(source, asyncJob, function(err, result)
{
assert.deepEqual(result, expectedResult);
assert.deepEqual(target, expectedTarget);
});
// shortcut interface (item, callback)
// works for object as well as for the arrays
function asyncJob(item, cb)
{
target.push(item);
// it will be automatically made async
// even it iterator "returns" in the same event loop
cb(null, item * 2);
}
```
More examples could be found in [test/test-serial-object.js](test/test-serial-object.js).
_Note: Since _object_ is an _unordered_ collection of properties,
it may produce unexpected results with sequential iterations.
Whenever order of the jobs' execution is important please use `serialOrdered` method._
### Ordered Serial Iterations
TBD
For example [compare-property](compare-property) package.
### Streaming interface
TBD
## Want to Know More?
More examples can be found in [test folder](test/).
Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions.
## License
AsyncKit is licensed under the MIT license.

View File

@@ -1,76 +0,0 @@
/* eslint no-console: "off" */
var asynckit = require('./')
, async = require('async')
, assert = require('assert')
, expected = 0
;
var Benchmark = require('benchmark');
var suite = new Benchmark.Suite;
var source = [];
for (var z = 1; z < 100; z++)
{
source.push(z);
expected += z;
}
suite
// add tests
.add('async.map', function(deferred)
{
var total = 0;
async.map(source,
function(i, cb)
{
setImmediate(function()
{
total += i;
cb(null, total);
});
},
function(err, result)
{
assert.ifError(err);
assert.equal(result[result.length - 1], expected);
deferred.resolve();
});
}, {'defer': true})
.add('asynckit.parallel', function(deferred)
{
var total = 0;
asynckit.parallel(source,
function(i, cb)
{
setImmediate(function()
{
total += i;
cb(null, total);
});
},
function(err, result)
{
assert.ifError(err);
assert.equal(result[result.length - 1], expected);
deferred.resolve();
});
}, {'defer': true})
// add listeners
.on('cycle', function(ev)
{
console.log(String(ev.target));
})
.on('complete', function()
{
console.log('Fastest is ' + this.filter('fastest').map('name'));
})
// run async
.run({ 'async': true });

View File

@@ -1,6 +0,0 @@
module.exports =
{
parallel : require('./parallel.js'),
serial : require('./serial.js'),
serialOrdered : require('./serialOrdered.js')
};

View File

@@ -1,29 +0,0 @@
// API
module.exports = abort;
/**
* Aborts leftover active jobs
*
* @param {object} state - current state object
*/
function abort(state)
{
Object.keys(state.jobs).forEach(clean.bind(state));
// reset leftover jobs
state.jobs = {};
}
/**
* Cleans up leftover job by invoking abort function for the provided job id
*
* @this state
* @param {string|number} key - job id to abort
*/
function clean(key)
{
if (typeof this.jobs[key] == 'function')
{
this.jobs[key]();
}
}

View File

@@ -1,34 +0,0 @@
var defer = require('./defer.js');
// API
module.exports = async;
/**
* Runs provided callback asynchronously
* even if callback itself is not
*
* @param {function} callback - callback to invoke
* @returns {function} - augmented callback
*/
function async(callback)
{
var isAsync = false;
// check if async happened
defer(function() { isAsync = true; });
return function async_callback(err, result)
{
if (isAsync)
{
callback(err, result);
}
else
{
defer(function nextTick_callback()
{
callback(err, result);
});
}
};
}

View File

@@ -1,26 +0,0 @@
module.exports = defer;
/**
* Runs provided function on next iteration of the event loop
*
* @param {function} fn - function to run
*/
function defer(fn)
{
var nextTick = typeof setImmediate == 'function'
? setImmediate
: (
typeof process == 'object' && typeof process.nextTick == 'function'
? process.nextTick
: null
);
if (nextTick)
{
nextTick(fn);
}
else
{
setTimeout(fn, 0);
}
}

View File

@@ -1,75 +0,0 @@
var async = require('./async.js')
, abort = require('./abort.js')
;
// API
module.exports = iterate;
/**
* Iterates over each job object
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {object} state - current job status
* @param {function} callback - invoked when all elements processed
*/
function iterate(list, iterator, state, callback)
{
// store current index
var key = state['keyedList'] ? state['keyedList'][state.index] : state.index;
state.jobs[key] = runJob(iterator, key, list[key], function(error, output)
{
// don't repeat yourself
// skip secondary callbacks
if (!(key in state.jobs))
{
return;
}
// clean up jobs
delete state.jobs[key];
if (error)
{
// don't process rest of the results
// stop still active jobs
// and reset the list
abort(state);
}
else
{
state.results[key] = output;
}
// return salvaged results
callback(error, state.results);
});
}
/**
* Runs iterator over provided job element
*
* @param {function} iterator - iterator to invoke
* @param {string|number} key - key/index of the element in the list of jobs
* @param {mixed} item - job description
* @param {function} callback - invoked after iterator is done with the job
* @returns {function|mixed} - job abort function or something else
*/
function runJob(iterator, key, item, callback)
{
var aborter;
// allow shortcut if iterator expects only two arguments
if (iterator.length == 2)
{
aborter = iterator(item, async(callback));
}
// otherwise go with full three arguments
else
{
aborter = iterator(item, key, async(callback));
}
return aborter;
}

View File

@@ -1,91 +0,0 @@
var streamify = require('./streamify.js')
, defer = require('./defer.js')
;
// API
module.exports = ReadableAsyncKit;
/**
* Base constructor for all streams
* used to hold properties/methods
*/
function ReadableAsyncKit()
{
ReadableAsyncKit.super_.apply(this, arguments);
// list of active jobs
this.jobs = {};
// add stream methods
this.destroy = destroy;
this._start = _start;
this._read = _read;
}
/**
* Destroys readable stream,
* by aborting outstanding jobs
*
* @returns {void}
*/
function destroy()
{
if (this.destroyed)
{
return;
}
this.destroyed = true;
if (typeof this.terminator == 'function')
{
this.terminator();
}
}
/**
* Starts provided jobs in async manner
*
* @private
*/
function _start()
{
// first argument runner function
var runner = arguments[0]
// take away first argument
, args = Array.prototype.slice.call(arguments, 1)
// second argument - input data
, input = args[0]
// last argument - result callback
, endCb = streamify.callback.call(this, args[args.length - 1])
;
args[args.length - 1] = endCb;
// third argument - iterator
args[1] = streamify.iterator.call(this, args[1]);
// allow time for proper setup
defer(function()
{
if (!this.destroyed)
{
this.terminator = runner.apply(null, args);
}
else
{
endCb(null, Array.isArray(input) ? [] : {});
}
}.bind(this));
}
/**
* Implement _read to comply with Readable streams
* Doesn't really make sense for flowing object mode
*
* @private
*/
function _read()
{
}

View File

@@ -1,25 +0,0 @@
var parallel = require('../parallel.js');
// API
module.exports = ReadableParallel;
/**
* Streaming wrapper to `asynckit.parallel`
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} callback - invoked when all elements processed
* @returns {stream.Readable#}
*/
function ReadableParallel(list, iterator, callback)
{
if (!(this instanceof ReadableParallel))
{
return new ReadableParallel(list, iterator, callback);
}
// turn on object mode
ReadableParallel.super_.call(this, {objectMode: true});
this._start(parallel, list, iterator, callback);
}

View File

@@ -1,25 +0,0 @@
var serial = require('../serial.js');
// API
module.exports = ReadableSerial;
/**
* Streaming wrapper to `asynckit.serial`
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} callback - invoked when all elements processed
* @returns {stream.Readable#}
*/
function ReadableSerial(list, iterator, callback)
{
if (!(this instanceof ReadableSerial))
{
return new ReadableSerial(list, iterator, callback);
}
// turn on object mode
ReadableSerial.super_.call(this, {objectMode: true});
this._start(serial, list, iterator, callback);
}

View File

@@ -1,29 +0,0 @@
var serialOrdered = require('../serialOrdered.js');
// API
module.exports = ReadableSerialOrdered;
// expose sort helpers
module.exports.ascending = serialOrdered.ascending;
module.exports.descending = serialOrdered.descending;
/**
* Streaming wrapper to `asynckit.serialOrdered`
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} sortMethod - custom sort function
* @param {function} callback - invoked when all elements processed
* @returns {stream.Readable#}
*/
function ReadableSerialOrdered(list, iterator, sortMethod, callback)
{
if (!(this instanceof ReadableSerialOrdered))
{
return new ReadableSerialOrdered(list, iterator, sortMethod, callback);
}
// turn on object mode
ReadableSerialOrdered.super_.call(this, {objectMode: true});
this._start(serialOrdered, list, iterator, sortMethod, callback);
}

View File

@@ -1,37 +0,0 @@
// API
module.exports = state;
/**
* Creates initial state object
* for iteration over list
*
* @param {array|object} list - list to iterate over
* @param {function|null} sortMethod - function to use for keys sort,
* or `null` to keep them as is
* @returns {object} - initial state object
*/
function state(list, sortMethod)
{
var isNamedList = !Array.isArray(list)
, initState =
{
index : 0,
keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
jobs : {},
results : isNamedList ? {} : [],
size : isNamedList ? Object.keys(list).length : list.length
}
;
if (sortMethod)
{
// sort array keys based on it's values
// sort object's keys just on own merit
initState.keyedList.sort(isNamedList ? sortMethod : function(a, b)
{
return sortMethod(list[a], list[b]);
});
}
return initState;
}

View File

@@ -1,141 +0,0 @@
var async = require('./async.js');
// API
module.exports = {
iterator: wrapIterator,
callback: wrapCallback
};
/**
* Wraps iterators with long signature
*
* @this ReadableAsyncKit#
* @param {function} iterator - function to wrap
* @returns {function} - wrapped function
*/
function wrapIterator(iterator)
{
var stream = this;
return function(item, key, cb)
{
var aborter
, wrappedCb = async(wrapIteratorCallback.call(stream, cb, key))
;
stream.jobs[key] = wrappedCb;
// it's either shortcut (item, cb)
if (iterator.length == 2)
{
aborter = iterator(item, wrappedCb);
}
// or long format (item, key, cb)
else
{
aborter = iterator(item, key, wrappedCb);
}
return aborter;
};
}
/**
* Wraps provided callback function
* allowing to execute snitch function before
* real callback
*
* @this ReadableAsyncKit#
* @param {function} callback - function to wrap
* @returns {function} - wrapped function
*/
function wrapCallback(callback)
{
var stream = this;
var wrapped = function(error, result)
{
return finisher.call(stream, error, result, callback);
};
return wrapped;
}
/**
* Wraps provided iterator callback function
* makes sure snitch only called once,
* but passes secondary calls to the original callback
*
* @this ReadableAsyncKit#
* @param {function} callback - callback to wrap
* @param {number|string} key - iteration key
* @returns {function} wrapped callback
*/
function wrapIteratorCallback(callback, key)
{
var stream = this;
return function(error, output)
{
// don't repeat yourself
if (!(key in stream.jobs))
{
callback(error, output);
return;
}
// clean up jobs
delete stream.jobs[key];
return streamer.call(stream, error, {key: key, value: output}, callback);
};
}
/**
* Stream wrapper for iterator callback
*
* @this ReadableAsyncKit#
* @param {mixed} error - error response
* @param {mixed} output - iterator output
* @param {function} callback - callback that expects iterator results
*/
function streamer(error, output, callback)
{
if (error && !this.error)
{
this.error = error;
this.pause();
this.emit('error', error);
// send back value only, as expected
callback(error, output && output.value);
return;
}
// stream stuff
this.push(output);
// back to original track
// send back value only, as expected
callback(error, output && output.value);
}
/**
* Stream wrapper for finishing callback
*
* @this ReadableAsyncKit#
* @param {mixed} error - error response
* @param {mixed} output - iterator output
* @param {function} callback - callback that expects final results
*/
function finisher(error, output, callback)
{
// signal end of the stream
// only for successfully finished streams
if (!error)
{
this.push(null);
}
// back to original track
callback(error, output);
}

View File

@@ -1,29 +0,0 @@
var abort = require('./abort.js')
, async = require('./async.js')
;
// API
module.exports = terminator;
/**
* Terminates jobs in the attached state context
*
* @this AsyncKitState#
* @param {function} callback - final callback to invoke after termination
*/
function terminator(callback)
{
if (!Object.keys(this.jobs).length)
{
return;
}
// fast forward iteration index
this.index = this.size;
// abort jobs
abort(this);
// send back results we have so far
async(callback)(null, this.results);
}

View File

@@ -1,63 +0,0 @@
{
"name": "asynckit",
"version": "0.4.0",
"description": "Minimal async jobs utility library, with streams support",
"main": "index.js",
"scripts": {
"clean": "rimraf coverage",
"lint": "eslint *.js lib/*.js test/*.js",
"test": "istanbul cover --reporter=json tape -- 'test/test-*.js' | tap-spec",
"win-test": "tape test/test-*.js",
"browser": "browserify -t browserify-istanbul test/lib/browserify_adjustment.js test/test-*.js | obake --coverage | tap-spec",
"report": "istanbul report",
"size": "browserify index.js | size-table asynckit",
"debug": "tape test/test-*.js"
},
"pre-commit": [
"clean",
"lint",
"test",
"browser",
"report",
"size"
],
"repository": {
"type": "git",
"url": "git+https://github.com/alexindigo/asynckit.git"
},
"keywords": [
"async",
"jobs",
"parallel",
"serial",
"iterator",
"array",
"object",
"stream",
"destroy",
"terminate",
"abort"
],
"author": "Alex Indigo <iam@alexindigo.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/alexindigo/asynckit/issues"
},
"homepage": "https://github.com/alexindigo/asynckit#readme",
"devDependencies": {
"browserify": "^13.0.0",
"browserify-istanbul": "^2.0.0",
"coveralls": "^2.11.9",
"eslint": "^2.9.0",
"istanbul": "^0.4.3",
"obake": "^0.1.2",
"phantomjs-prebuilt": "^2.1.7",
"pre-commit": "^1.1.3",
"reamde": "^1.1.0",
"rimraf": "^2.5.2",
"size-table": "^0.2.0",
"tap-spec": "^4.1.1",
"tape": "^4.5.1"
},
"dependencies": {}
}

View File

@@ -1,43 +0,0 @@
var iterate = require('./lib/iterate.js')
, initState = require('./lib/state.js')
, terminator = require('./lib/terminator.js')
;
// Public API
module.exports = parallel;
/**
* Runs iterator over provided array elements in parallel
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} callback - invoked when all elements processed
* @returns {function} - jobs terminator
*/
function parallel(list, iterator, callback)
{
var state = initState(list);
while (state.index < (state['keyedList'] || list).length)
{
iterate(list, iterator, state, function(error, result)
{
if (error)
{
callback(error, result);
return;
}
// looks like it's the last one
if (Object.keys(state.jobs).length === 0)
{
callback(null, state.results);
return;
}
});
state.index++;
}
return terminator.bind(state, callback);
}

View File

@@ -1,17 +0,0 @@
var serialOrdered = require('./serialOrdered.js');
// Public API
module.exports = serial;
/**
* Runs iterator over provided array elements in series
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} callback - invoked when all elements processed
* @returns {function} - jobs terminator
*/
function serial(list, iterator, callback)
{
return serialOrdered(list, iterator, null, callback);
}

View File

@@ -1,75 +0,0 @@
var iterate = require('./lib/iterate.js')
, initState = require('./lib/state.js')
, terminator = require('./lib/terminator.js')
;
// Public API
module.exports = serialOrdered;
// sorting helpers
module.exports.ascending = ascending;
module.exports.descending = descending;
/**
* Runs iterator over provided sorted array elements in series
*
* @param {array|object} list - array or object (named list) to iterate over
* @param {function} iterator - iterator to run
* @param {function} sortMethod - custom sort function
* @param {function} callback - invoked when all elements processed
* @returns {function} - jobs terminator
*/
function serialOrdered(list, iterator, sortMethod, callback)
{
var state = initState(list, sortMethod);
iterate(list, iterator, state, function iteratorHandler(error, result)
{
if (error)
{
callback(error, result);
return;
}
state.index++;
// are we there yet?
if (state.index < (state['keyedList'] || list).length)
{
iterate(list, iterator, state, iteratorHandler);
return;
}
// done here
callback(null, state.results);
});
return terminator.bind(state, callback);
}
/*
* -- Sort methods
*/
/**
* sort helper to sort array elements in ascending order
*
* @param {mixed} a - an item to compare
* @param {mixed} b - an item to compare
* @returns {number} - comparison result
*/
function ascending(a, b)
{
return a < b ? -1 : a > b ? 1 : 0;
}
/**
* sort helper to sort array elements in descending order
*
* @param {mixed} a - an item to compare
* @param {mixed} b - an item to compare
* @returns {number} - comparison result
*/
function descending(a, b)
{
return -1 * ascending(a, b);
}

View File

@@ -1,21 +0,0 @@
var inherits = require('util').inherits
, Readable = require('stream').Readable
, ReadableAsyncKit = require('./lib/readable_asynckit.js')
, ReadableParallel = require('./lib/readable_parallel.js')
, ReadableSerial = require('./lib/readable_serial.js')
, ReadableSerialOrdered = require('./lib/readable_serial_ordered.js')
;
// API
module.exports =
{
parallel : ReadableParallel,
serial : ReadableSerial,
serialOrdered : ReadableSerialOrdered,
};
inherits(ReadableAsyncKit, Readable);
inherits(ReadableParallel, ReadableAsyncKit);
inherits(ReadableSerial, ReadableAsyncKit);
inherits(ReadableSerialOrdered, ReadableAsyncKit);

View File

@@ -1,9 +0,0 @@
{
"root": true,
"extends": "@ljharb",
"globals": {
"globalThis": false
}
}

View File

@@ -1,12 +0,0 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/available-typed-arrays
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@@ -1,9 +0,0 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"exclude": [
"coverage",
"test"
]
}

View File

@@ -1,79 +0,0 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [v1.0.5](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.4...v1.0.5) - 2021-08-30
### Fixed
- [Refactor] use `globalThis` if available [`#12`](https://github.com/inspect-js/available-typed-arrays/issues/12)
### Commits
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`1199790`](https://github.com/inspect-js/available-typed-arrays/commit/1199790ab5841517ad04827fab3f135d2dc5cfb7)
## [v1.0.4](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.3...v1.0.4) - 2021-05-25
### Commits
- [Refactor] Remove `array.prototype.filter` dependency [`f39c90e`](https://github.com/inspect-js/available-typed-arrays/commit/f39c90ecb1907de28ee2d3577b7da37ae12aac56)
- [Dev Deps] update `eslint`, `auto-changelog` [`b2e3a03`](https://github.com/inspect-js/available-typed-arrays/commit/b2e3a035e8cd3ddfd7b565249e1651c6419a34d0)
- [meta] create `FUNDING.yml` [`8c0e758`](https://github.com/inspect-js/available-typed-arrays/commit/8c0e758c6ec80adbb3770554653cdc3aa16beb55)
- [Tests] fix harmony test matrix [`ef96549`](https://github.com/inspect-js/available-typed-arrays/commit/ef96549df171776267529413240a2219cb59d5ce)
- [meta] add `sideEffects` flag [`288cca0`](https://github.com/inspect-js/available-typed-arrays/commit/288cca0fbd214bec706447851bb8bccc4b899a48)
## [v1.0.3](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.2...v1.0.3) - 2021-05-19
### Commits
- [Tests] migrate tests to Github Actions [`3ef082c`](https://github.com/inspect-js/available-typed-arrays/commit/3ef082caaa153b49f4c37c85bbd5c4b13fe4f638)
- [meta] do not publish github action workflow files [`fd95ffd`](https://github.com/inspect-js/available-typed-arrays/commit/fd95ffdaca759eca81cb4c5d5772ee863dfea501)
- [actions] use `node/install` instead of `node/run`; use `codecov` action [`eb6bd65`](https://github.com/inspect-js/available-typed-arrays/commit/eb6bd659a31c92a6a178c71a89fe0d5261413e6c)
- [Tests] run `nyc` on all tests [`636c946`](https://github.com/inspect-js/available-typed-arrays/commit/636c94657b532599ef90a214aaa12639d11b0161)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`70a3b61`](https://github.com/inspect-js/available-typed-arrays/commit/70a3b61367b318fb883c2f35b8f2d539849a23b6)
- [actions] add "Allow Edits" workflow [`bd09c45`](https://github.com/inspect-js/available-typed-arrays/commit/bd09c45299e396fa5bbd5be4c58b1aedcb372a82)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `array.prototype.every`, `aud`, `tape` [`8f97523`](https://github.com/inspect-js/available-typed-arrays/commit/8f9752308390a79068cd431436bbfd77bca15647)
- [readme] fix URLs [`75418e2`](https://github.com/inspect-js/available-typed-arrays/commit/75418e20b57f4ad5e65d8c2e1864efd14eaa2e65)
- [readme] add actions and codecov badges [`4a8bc30`](https://github.com/inspect-js/available-typed-arrays/commit/4a8bc30af2ce1f48e2b28ab3db5be9589bd6f2d0)
- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud` [`65198ac`](https://github.com/inspect-js/available-typed-arrays/commit/65198ace335a013ef49b6bd722bc80bbbc6be784)
- [actions] update workflows [`7f816eb`](https://github.com/inspect-js/available-typed-arrays/commit/7f816eb231131e53ced2572ba6c6c6a00f975789)
- [Refactor] use `array.prototype.filter` instead of `array-filter` [`2dd1038`](https://github.com/inspect-js/available-typed-arrays/commit/2dd1038d71ce48b5650687691cf8fe09795a6d30)
- [actions] switch Automatic Rease workflow to `pull_request_target` event [`9b45e91`](https://github.com/inspect-js/available-typed-arrays/commit/9b45e914fcb08bdaaaa0166b41716e51f400d1c6)
- [Dev Deps] update `auto-changelog`, `tape` [`0003a5b`](https://github.com/inspect-js/available-typed-arrays/commit/0003a5b122a0724db5499c114104eeeb396b2f67)
- [meta] use `prepublishOnly` script for npm 7+ [`d884dd1`](https://github.com/inspect-js/available-typed-arrays/commit/d884dd1c1117411f35d9fbc07f513a1a85ccdead)
- [readme] remove travis badge [`9da2b3c`](https://github.com/inspect-js/available-typed-arrays/commit/9da2b3c29706340fada995137aba12cfae4d6f37)
- [Dev Deps] update `auto-changelog`; add `aud` [`41b1336`](https://github.com/inspect-js/available-typed-arrays/commit/41b13369c71b0e3e57b9de0f4fb1e4d67950d74a)
- [Tests] only audit prod deps [`2571826`](https://github.com/inspect-js/available-typed-arrays/commit/2571826a5d121eeeeccf4c711e3f9e4616685d50)
## [v1.0.2](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.1...v1.0.2) - 2020-01-26
### Commits
- [actions] add automatic rebasing / merge commit blocking [`3229a74`](https://github.com/inspect-js/available-typed-arrays/commit/3229a74bda60f24e2257efc40ddff9a3ce98de76)
- [Dev Deps] update `@ljharb/eslint-config` [`9579abe`](https://github.com/inspect-js/available-typed-arrays/commit/9579abecc196088561d3aedf27cad45b56f8e18b)
- [Fix] remove `require` condition to avoid experimental warning [`2cade6b`](https://github.com/inspect-js/available-typed-arrays/commit/2cade6b56d6a508a950c7da27d038bee496e716b)
## [v1.0.1](https://github.com/inspect-js/available-typed-arrays/compare/v1.0.0...v1.0.1) - 2020-01-24
### Commits
- [meta] add "exports" [`5942917`](https://github.com/inspect-js/available-typed-arrays/commit/5942917aafb56c6bce80f01b7ae6a9b46bc72c69)
## v1.0.0 - 2020-01-24
### Commits
- Initial commit [`2bc5144`](https://github.com/inspect-js/available-typed-arrays/commit/2bc514459c9f65756adfbd9964abf433183d78f6)
- readme [`31e4796`](https://github.com/inspect-js/available-typed-arrays/commit/31e4796379eba4a16d3c6a8e9baf6eb3f39e33d1)
- npm init [`9194266`](https://github.com/inspect-js/available-typed-arrays/commit/9194266b471a2a2dd5e6969bc40358ceb346e21e)
- Tests [`b539830`](https://github.com/inspect-js/available-typed-arrays/commit/b539830c3213f90de42b4d6e62803f52daf61a6d)
- Implementation [`6577df2`](https://github.com/inspect-js/available-typed-arrays/commit/6577df244ea146ef5ec16858044c8955e0fc445c)
- [meta] add `auto-changelog` [`7b43310`](https://github.com/inspect-js/available-typed-arrays/commit/7b43310be76f00fe60b74a2fd6d0e46ac1d01f3e)
- [Tests] add `npm run lint` [`dedfbc1`](https://github.com/inspect-js/available-typed-arrays/commit/dedfbc1592f86ac1636267d3965f2345df43815b)
- [Tests] use shared travis-ci configs [`c459d78`](https://github.com/inspect-js/available-typed-arrays/commit/c459d78bf2efa9d777f88599ae71a796dbfcb70f)
- Only apps should have lockfiles [`d294668`](https://github.com/inspect-js/available-typed-arrays/commit/d294668422cf35f5e7716a85bfd204e62b01c056)
- [meta] add `funding` field [`6e70bc1`](https://github.com/inspect-js/available-typed-arrays/commit/6e70bc1fb199c7898165aaf05c25bb49f4062e53)
- [meta] add `safe-publish-latest` [`dd89ca2`](https://github.com/inspect-js/available-typed-arrays/commit/dd89ca2c6842f0f3e82958df2b2bd0fc0c929c51)

View File

@@ -1,21 +0,0 @@
MIT License
Copyright (c) 2020 Inspect JS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@@ -1,52 +0,0 @@
# available-typed-arrays <sup>[![Version Badge][2]][1]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][11]][1]
Returns an array of Typed Array names that are available in the current environment.
## Example
```js
var availableTypedArrays = require('available-typed-arrays');
var assert = require('assert');
assert.deepStrictEqual(availableTypedArrays(), [
'Int8Array',
'Uint8Array',
'Uint8ClampedArray',
'Int16Array',
'Uint16Array',
'Int32Array',
'Uint32Array',
'Float32Array',
'Float64Array',
'BigInt64Array',
'BigUint64Array'
].sort());
```
## Tests
Simply clone the repo, `npm install`, and run `npm test`
[1]: https://npmjs.org/package/available-typed-arrays
[2]: https://versionbadg.es/inspect-js/available-typed-arrays.svg
[5]: https://david-dm.org/inspect-js/available-typed-arrays.svg
[6]: https://david-dm.org/inspect-js/available-typed-arrays
[7]: https://david-dm.org/inspect-js/available-typed-arrays/dev-status.svg
[8]: https://david-dm.org/inspect-js/available-typed-arrays#info=devDependencies
[11]: https://nodei.co/npm/available-typed-arrays.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/available-typed-arrays.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/available-typed-arrays.svg
[downloads-url]: https://npm-stat.com/charts.html?package=available-typed-arrays
[codecov-image]: https://codecov.io/gh/inspect-js/available-typed-arrays/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/available-typed-arrays/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/available-typed-arrays
[actions-url]: https://github.com/inspect-js/available-typed-arrays/actions

View File

@@ -1,27 +0,0 @@
'use strict';
var possibleNames = [
'BigInt64Array',
'BigUint64Array',
'Float32Array',
'Float64Array',
'Int16Array',
'Int32Array',
'Int8Array',
'Uint16Array',
'Uint32Array',
'Uint8Array',
'Uint8ClampedArray'
];
var g = typeof globalThis === 'undefined' ? global : globalThis;
module.exports = function availableTypedArrays() {
var out = [];
for (var i = 0; i < possibleNames.length; i++) {
if (typeof g[possibleNames[i]] === 'function') {
out[out.length] = possibleNames[i];
}
}
return out;
};

View File

@@ -1,82 +0,0 @@
{
"name": "available-typed-arrays",
"version": "1.0.5",
"description": "Returns an array of Typed Array names that are available in the current environment",
"main": "index.js",
"type": "commonjs",
"exports": {
".": [
{
"default": "./index.js"
},
"./index.js"
],
"./package": "./package.json",
"./package.json": "./package.json"
},
"sideEffects": false,
"scripts": {
"prepublish": "not-in-publish || npm run prepublishOnly",
"prepublishOnly": "safe-publish-latest",
"prelint": "evalmd README.md",
"lint": "eslint --ext=js,mjs .",
"pretest": "npm run lint",
"tests-only": "nyc tape 'test/**/*.js'",
"test:harmony": "nyc node --harmony --es-staging test",
"test": "npm run tests-only && npm run test:harmony",
"posttest": "aud --production",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/inspect-js/available-typed-arrays.git"
},
"keywords": [
"typed",
"arrays",
"Float32Array",
"Float64Array",
"Int8Array",
"Int16Array",
"Int32Array",
"Uint8Array",
"Uint8ClampedArray",
"Uint16Array",
"Uint32Array",
"BigInt64Array",
"BigUint64Array"
],
"author": "Jordan Harband <ljharb@gmail.com>",
"funding": {
"url": "https://github.com/sponsors/ljharb"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/inspect-js/available-typed-arrays/issues"
},
"homepage": "https://github.com/inspect-js/available-typed-arrays#readme",
"engines": {
"node": ">= 0.4"
},
"devDependencies": {
"@ljharb/eslint-config": "^18.0.0",
"array.prototype.every": "^1.1.2",
"aud": "^1.1.5",
"auto-changelog": "^2.3.0",
"eslint": "^7.32.0",
"evalmd": "^0.0.19",
"isarray": "^2.0.5",
"nyc": "^10.3.2",
"safe-publish-latest": "^1.1.4",
"tape": "^5.3.1"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
}
}

View File

@@ -1,18 +0,0 @@
'use strict';
var test = require('tape');
var isArray = require('isarray');
var every = require('array.prototype.every');
var availableTypedArrays = require('../');
test('available typed arrays', function (t) {
t.equal(typeof availableTypedArrays, 'function', 'is a function');
var arrays = availableTypedArrays();
t.equal(isArray(arrays), true, 'returns an array');
t.equal(every(arrays, function (array) { return typeof array === 'string'; }), true, 'contains only strings');
t.end();
});

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +0,0 @@
## Code of Conduct
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
opensource-codeofconduct@amazon.com with any additional questions or comments.

View File

@@ -1,202 +0,0 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -1,5 +0,0 @@
AWS SDK for JavaScript
Copyright 2012-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
This product includes software developed at
Amazon Web Services, Inc. (http://aws.amazon.com/).

View File

@@ -1,225 +0,0 @@
# AWS SDK for JavaScript
[![NPM version](https://img.shields.io/npm/v/aws-sdk.svg)](https://www.npmjs.com/package/aws-sdk)
[![NPM downloads](https://img.shields.io/npm/dm/aws-sdk.svg)](https://www.npmjs.com/package/aws-sdk)
[![Gitter chat](https://badges.gitter.im/gitterHQ/gitter.svg)](https://gitter.im/aws/aws-sdk-js)
[![Build Status](https://travis-ci.org/aws/aws-sdk-js.svg?branch=master)](https://travis-ci.org/aws/aws-sdk-js)
[![Coverage Status](https://codecov.io/gh/aws/aws-sdk-js/branch/master/graph/badge.svg)](https://codecov.io/gh/aws/aws-sdk-js)
[![Known Vulnerabilities](https://snyk.io/test/github/aws/aws-sdk-js/badge.svg)](https://snyk.io/test/github/aws/aws-sdk-js)
## Version 3.x Now Available
The [version 3.x](https://github.com/aws/aws-sdk-js-v3) of the AWS SDK for JavaScript is generally available.
For more information see the [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/)
or [API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/index.html).
For release notes, see the [CHANGELOG](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md). Prior to v2.4.8, release notes can be found at https://aws.amazon.com/releasenotes/?tag=releasenotes%23keywords%23javascript
### We are excited to announce the [developer preview](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/preview/) of AWS SDK for JavaScript v3's new API documentation.
## Version 2.x Support
We are formalizing our plans to make the *Maintenance Announcement (Phase 2)* for **AWS SDK for JavaScript v2** in 2023.
Please refer to the [AWS SDKs and Tools maintenance policy][aws-sdks-maintenance-policy] for further details.
[**AWS SDK for JavaScript v3**][aws-sdk-js-v3] is the latest and recommended version,
which has been GA since December 2020. Here is [why and how you should use
**AWS SDK for JavaScript v3**][v3-recommended-blog]. You can try our experimental
migration scripts in [aws-sdk-js-codemod][aws-sdk-js-codemod] to migrate
your application from v2 to v3.
To get help with your migration, please follow our general guidelines to
[open an issue][v2-new-issue] and choose [guidance][open-issue-v2-guidance].
To give feedback on and report issues in the v3 repo, please refer to
[Giving feedback and contributing][v3-contributing].
Watch this README and the [AWS Developer Tools Blog][aws-devtools-blog]
for updates and announcements regarding the maintenance plans and timelines.
A maintenance mode message may be emitted by this package on startup.
To suppress this message, use an environment variable:
```sh
AWS_SDK_JS_SUPPRESS_MAINTENANCE_MODE_MESSAGE=1 node my_program.js
```
or a JavaScript setting as follows:
```js
var SDK = require('aws-sdk');
require('aws-sdk/lib/maintenance_mode_message').suppress = true;
```
[v2-new-issue]: https://github.com/aws/aws-sdk-js/issues/new/choose
[v3-recommended-blog]: https://aws.amazon.com/blogs/developer/why-and-how-you-should-use-aws-sdk-for-javascript-v3-on-node-js-18/
[v3-contributing]: https://github.com/aws/aws-sdk-js-v3#giving-feedback-and-contributing
[aws-sdk-js-v3]: https://github.com/aws/aws-sdk-js-v3
[aws-devtools-blog]: https://aws.amazon.com/blogs/developer/
[aws-sdks-maintenance-policy]: https://docs.aws.amazon.com/sdkref/latest/guide/maint-policy.html
[open-issue-v2-guidance]: https://github.com/aws/aws-sdk-js/issues/new?assignees=&labels=guidance%2C+needs-triage&template=---questions---help.md&title=
[aws-sdk-js-codemod]: https://www.npmjs.com/package/aws-sdk-js-codemod
## Table of Contents:
* [Getting Started](#getting-Started)
* [Getting Help](#getting-help)
* [Contributing](#contributing)
## Getting Started
## How To Install
### In the Browser
To use the SDK in the browser, simply add the following script tag to your
HTML pages:
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.1498.0.min.js"></script>
You can also build a custom browser SDK with your specified set of AWS services.
This can allow you to reduce the SDK's size, specify different API versions of
services, or use AWS services that don't currently support CORS if you are
working in an environment that does not enforce CORS. To get started:
http://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/building-sdk-for-browsers.html
The AWS SDK is also compatible with [browserify](http://browserify.org).
For browser-based web, mobile and hybrid apps, you can use [AWS Amplify Library](https://aws.github.io/aws-amplify/?utm_source=aws-js-sdk&utm_campaign=browser) which extends the AWS SDK and provides an easier and declarative interface.
### In Node.js
The preferred way to install the AWS SDK for Node.js is to use the
[npm](http://npmjs.org) package manager for Node.js. Simply type the following
into a terminal window:
```sh
npm install aws-sdk
```
### In React Native
To use the SDK in a react native project, first install the SDK using npm:
```sh
npm install aws-sdk
```
Then within your application, you can reference the react native compatible version of the SDK with the following:
```javascript
var AWS = require('aws-sdk/dist/aws-sdk-react-native');
```
Alternatively, you can use [AWS Amplify Library](https://aws.github.io/aws-amplify/media/react_native_guide?utm_source=aws-js-sdk&utm_campaign=react-native) which extends AWS SDK and provides React Native UI components and CLI support to work with AWS services.
### Using Bower
You can also use [Bower](http://bower.io) to install the SDK by typing the
following into a terminal window:
```sh
bower install aws-sdk-js
```
## Usage with TypeScript
The AWS SDK for JavaScript bundles TypeScript definition files for use in TypeScript projects and to support tools that can read `.d.ts` files.
Our goal is to keep these TypeScript definition files updated with each release for any public api.
### Pre-requisites
Before you can begin using these TypeScript definitions with your project, you need to make sure your project meets a few of these requirements:
* Use latest version of TypeScript. We recommend 4.x+
* Includes the TypeScript definitions for node. You can use npm to install this by typing the following into a terminal window:
```sh
npm install --save-dev @types/node
```
* If you are targeting at es5 or older ECMA standards, your `tsconfig.json` has to include `'es5'` and `'es2015.promise'` under `compilerOptions.lib`.
See [tsconfig.json](https://github.com/aws/aws-sdk-js/blob/master/ts/tsconfig.json) for an example.
### In the Browser
To use the TypeScript definition files with the global `AWS` object in a front-end project, add the following line to the top of your JavaScript file:
```javascript
/// <reference types="aws-sdk" />
```
This will provide support for the global `AWS` object.
### In Node.js
To use the TypeScript definition files within a Node.js project, simply import `aws-sdk` as you normally would.
In a TypeScript file:
```javascript
// import entire SDK
import AWS from 'aws-sdk';
// import AWS object without services
import AWS from 'aws-sdk/global';
// import individual service
import S3 from 'aws-sdk/clients/s3';
```
**NOTE:** You need to add `"esModuleInterop": true` to compilerOptions of your `tsconfig.json`. If not possible, use like `import * as AWS from 'aws-sdk'`.
In a JavaScript file:
```javascript
// import entire SDK
var AWS = require('aws-sdk');
// import AWS object without services
var AWS = require('aws-sdk/global');
// import individual service
var S3 = require('aws-sdk/clients/s3');
```
### With React
To create React applications with AWS SDK, you can use [AWS Amplify Library](https://aws.github.io/aws-amplify/media/react_guide?utm_source=aws-js-sdk&utm_campaign=react) which provides React components and CLI support to work with AWS services.
### With Angular
Due to the SDK's reliance on node.js typings, you may encounter compilation
[issues](https://github.com/aws/aws-sdk-js/issues/1271) when using the
typings provided by the SDK in an Angular project created using the Angular CLI.
To resolve these issues, either add `"types": ["node"]` to the project's `tsconfig.app.json`
file, or remove the `"types"` field entirely.
[AWS Amplify Library](https://aws.github.io/aws-amplify/media/angular_guide?utm_source=aws-js-sdk&utm_campaign=angular) provides Angular components and CLI support to work with AWS services.
### Known Limitations
There are a few known limitations with the bundled TypeScript definitions at this time:
* Service client typings reflect the latest `apiVersion`, regardless of which `apiVersion` is specified when creating a client.
* Service-bound parameters use the `any` type.
# Getting Help
The best way to interact with our team is through GitHub.
You can [open an issue](https://github.com/aws/aws-sdk-js/issues/new/choose) and choose from one of our templates for
[bug reports](https://github.com/aws/aws-sdk-js/issues/new?assignees=&labels=bug%2C+needs-triage&template=---bug-report.md&title=),
[feature requests](https://github.com/aws/aws-sdk-js/issues/new?assignees=&labels=feature-request&template=---feature-request.md&title=)
or [guidance](https://github.com/aws/aws-sdk-js/issues/new?assignees=&labels=guidance%2C+needs-triage&template=---questions---help.md&title=).
You may also find help on community resources such as [StackOverFlow](https://stackoverflow.com/questions/tagged/aws-sdk-js) with the tag #aws-sdk-js.
If you have a support plan with [AWS Support](https://aws.amazon.com/premiumsupport/), you can also create a new support case.
Please make sure to check out our resources too before opening an issue:
* Our [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/welcome.html) and [API reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/)
* Our [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) for recent changes.
* Our [code examples](https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/sdk-code-samples.html).
Please see [SERVICES.md](https://github.com/aws/aws-sdk-js/blob/master/SERVICES.md) for a list of supported services.
# Maintenance and support for SDK major versions
For information about maintenance and support for SDK major versions and their underlying dependencies, see the following in the [AWS SDKs and Tools Shared Configuration and Credentials Reference Guide](https://docs.aws.amazon.com/credref/latest/refdocs/overview.html):
* [AWS SDKs and Tools Maintenance Policy](https://docs.aws.amazon.com/credref/latest/refdocs/maint-policy.html)
* [AWS SDKs and Tools Version Support Matrix](https://docs.aws.amazon.com/credref/latest/refdocs/version-support-matrix.html)
# Contributing
We welcome community contributions and pull requests. See [CONTRIBUTING.md](https://github.com/aws/aws-sdk-js/blob/master/CONTRIBUTING.md) for information on how to set up a development environment and submit code.
## License
This SDK is distributed under the
[Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0),
see LICENSE.txt and NOTICE.txt for more information.

View File

@@ -1,5 +0,0 @@
{
"version": "1.0",
"examples": {
}
}

View File

@@ -1,503 +0,0 @@
{
"version": "2.0",
"metadata": {
"apiVersion": "2017-05-31",
"endpointPrefix": "mgh",
"jsonVersion": "1.1",
"protocol": "json",
"serviceFullName": "AWS Migration Hub",
"serviceId": "Migration Hub",
"signatureVersion": "v4",
"targetPrefix": "AWSMigrationHub",
"uid": "AWSMigrationHub-2017-05-31"
},
"operations": {
"AssociateCreatedArtifact": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStream",
"MigrationTaskName",
"CreatedArtifact"
],
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {},
"CreatedArtifact": {
"shape": "S4"
},
"DryRun": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"AssociateDiscoveredResource": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStream",
"MigrationTaskName",
"DiscoveredResource"
],
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {},
"DiscoveredResource": {
"shape": "Sa"
},
"DryRun": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"CreateProgressUpdateStream": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStreamName"
],
"members": {
"ProgressUpdateStreamName": {},
"DryRun": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"DeleteProgressUpdateStream": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStreamName"
],
"members": {
"ProgressUpdateStreamName": {},
"DryRun": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"DescribeApplicationState": {
"input": {
"type": "structure",
"required": [
"ApplicationId"
],
"members": {
"ApplicationId": {}
}
},
"output": {
"type": "structure",
"members": {
"ApplicationStatus": {},
"LastUpdatedTime": {
"type": "timestamp"
}
}
}
},
"DescribeMigrationTask": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStream",
"MigrationTaskName"
],
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {}
}
},
"output": {
"type": "structure",
"members": {
"MigrationTask": {
"type": "structure",
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {},
"Task": {
"shape": "Sq"
},
"UpdateDateTime": {
"type": "timestamp"
},
"ResourceAttributeList": {
"type": "list",
"member": {
"shape": "Sv"
}
}
}
}
}
}
},
"DisassociateCreatedArtifact": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStream",
"MigrationTaskName",
"CreatedArtifactName"
],
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {},
"CreatedArtifactName": {},
"DryRun": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"DisassociateDiscoveredResource": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStream",
"MigrationTaskName",
"ConfigurationId"
],
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {},
"ConfigurationId": {},
"DryRun": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"ImportMigrationTask": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStream",
"MigrationTaskName"
],
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {},
"DryRun": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"ListApplicationStates": {
"input": {
"type": "structure",
"members": {
"ApplicationIds": {
"type": "list",
"member": {}
},
"NextToken": {},
"MaxResults": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"ApplicationStateList": {
"type": "list",
"member": {
"type": "structure",
"members": {
"ApplicationId": {},
"ApplicationStatus": {},
"LastUpdatedTime": {
"type": "timestamp"
}
}
}
},
"NextToken": {}
}
}
},
"ListCreatedArtifacts": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStream",
"MigrationTaskName"
],
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {},
"NextToken": {},
"MaxResults": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"NextToken": {},
"CreatedArtifactList": {
"type": "list",
"member": {
"shape": "S4"
}
}
}
}
},
"ListDiscoveredResources": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStream",
"MigrationTaskName"
],
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {},
"NextToken": {},
"MaxResults": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"NextToken": {},
"DiscoveredResourceList": {
"type": "list",
"member": {
"shape": "Sa"
}
}
}
}
},
"ListMigrationTasks": {
"input": {
"type": "structure",
"members": {
"NextToken": {},
"MaxResults": {
"type": "integer"
},
"ResourceName": {}
}
},
"output": {
"type": "structure",
"members": {
"NextToken": {},
"MigrationTaskSummaryList": {
"type": "list",
"member": {
"type": "structure",
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {},
"Status": {},
"ProgressPercent": {
"type": "integer"
},
"StatusDetail": {},
"UpdateDateTime": {
"type": "timestamp"
}
}
}
}
}
}
},
"ListProgressUpdateStreams": {
"input": {
"type": "structure",
"members": {
"NextToken": {},
"MaxResults": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"ProgressUpdateStreamSummaryList": {
"type": "list",
"member": {
"type": "structure",
"members": {
"ProgressUpdateStreamName": {}
}
}
},
"NextToken": {}
}
}
},
"NotifyApplicationState": {
"input": {
"type": "structure",
"required": [
"ApplicationId",
"Status"
],
"members": {
"ApplicationId": {},
"Status": {},
"UpdateDateTime": {
"type": "timestamp"
},
"DryRun": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"NotifyMigrationTaskState": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStream",
"MigrationTaskName",
"Task",
"UpdateDateTime",
"NextUpdateSeconds"
],
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {},
"Task": {
"shape": "Sq"
},
"UpdateDateTime": {
"type": "timestamp"
},
"NextUpdateSeconds": {
"type": "integer"
},
"DryRun": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"PutResourceAttributes": {
"input": {
"type": "structure",
"required": [
"ProgressUpdateStream",
"MigrationTaskName",
"ResourceAttributeList"
],
"members": {
"ProgressUpdateStream": {},
"MigrationTaskName": {},
"ResourceAttributeList": {
"type": "list",
"member": {
"shape": "Sv"
}
},
"DryRun": {
"type": "boolean"
}
}
},
"output": {
"type": "structure",
"members": {}
}
}
},
"shapes": {
"S4": {
"type": "structure",
"required": [
"Name"
],
"members": {
"Name": {},
"Description": {}
}
},
"Sa": {
"type": "structure",
"required": [
"ConfigurationId"
],
"members": {
"ConfigurationId": {},
"Description": {}
}
},
"Sq": {
"type": "structure",
"required": [
"Status"
],
"members": {
"Status": {},
"StatusDetail": {},
"ProgressPercent": {
"type": "integer"
}
}
},
"Sv": {
"type": "structure",
"required": [
"Type",
"Value"
],
"members": {
"Type": {},
"Value": {}
}
}
}
}

View File

@@ -1,34 +0,0 @@
{
"pagination": {
"ListApplicationStates": {
"input_token": "NextToken",
"limit_key": "MaxResults",
"output_token": "NextToken",
"result_key": "ApplicationStateList"
},
"ListCreatedArtifacts": {
"input_token": "NextToken",
"limit_key": "MaxResults",
"output_token": "NextToken",
"result_key": "CreatedArtifactList"
},
"ListDiscoveredResources": {
"input_token": "NextToken",
"limit_key": "MaxResults",
"output_token": "NextToken",
"result_key": "DiscoveredResourceList"
},
"ListMigrationTasks": {
"input_token": "NextToken",
"limit_key": "MaxResults",
"output_token": "NextToken",
"result_key": "MigrationTaskSummaryList"
},
"ListProgressUpdateStreams": {
"input_token": "NextToken",
"limit_key": "MaxResults",
"output_token": "NextToken",
"result_key": "ProgressUpdateStreamSummaryList"
}
}
}

View File

@@ -1,5 +0,0 @@
{
"version": "1.0",
"examples": {
}
}

View File

@@ -1,52 +0,0 @@
{
"pagination": {
"ListAccessPreviewFindings": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults",
"result_key": "findings"
},
"ListAccessPreviews": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults",
"result_key": "accessPreviews"
},
"ListAnalyzedResources": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults",
"result_key": "analyzedResources"
},
"ListAnalyzers": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults",
"result_key": "analyzers"
},
"ListArchiveRules": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults",
"result_key": "archiveRules"
},
"ListFindings": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults",
"result_key": "findings"
},
"ListPolicyGenerations": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults",
"result_key": "policyGenerations"
},
"ValidatePolicy": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults",
"result_key": "findings"
}
}
}

View File

@@ -1,5 +0,0 @@
{
"version": "1.0",
"examples": {
}
}

View File

@@ -1,315 +0,0 @@
{
"version": "2.0",
"metadata": {
"apiVersion": "2021-02-01",
"endpointPrefix": "account",
"jsonVersion": "1.1",
"protocol": "rest-json",
"serviceFullName": "AWS Account",
"serviceId": "Account",
"signatureVersion": "v4",
"signingName": "account",
"uid": "account-2021-02-01"
},
"operations": {
"DeleteAlternateContact": {
"http": {
"requestUri": "/deleteAlternateContact",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"AlternateContactType"
],
"members": {
"AccountId": {},
"AlternateContactType": {}
}
},
"idempotent": true
},
"DisableRegion": {
"http": {
"requestUri": "/disableRegion",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"RegionName"
],
"members": {
"AccountId": {},
"RegionName": {}
}
}
},
"EnableRegion": {
"http": {
"requestUri": "/enableRegion",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"RegionName"
],
"members": {
"AccountId": {},
"RegionName": {}
}
}
},
"GetAlternateContact": {
"http": {
"requestUri": "/getAlternateContact",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"AlternateContactType"
],
"members": {
"AccountId": {},
"AlternateContactType": {}
}
},
"output": {
"type": "structure",
"members": {
"AlternateContact": {
"type": "structure",
"members": {
"AlternateContactType": {},
"EmailAddress": {
"shape": "Sa"
},
"Name": {
"shape": "Sb"
},
"PhoneNumber": {
"shape": "Sc"
},
"Title": {
"shape": "Sd"
}
}
}
}
}
},
"GetContactInformation": {
"http": {
"requestUri": "/getContactInformation",
"responseCode": 200
},
"input": {
"type": "structure",
"members": {
"AccountId": {}
}
},
"output": {
"type": "structure",
"members": {
"ContactInformation": {
"shape": "Sg"
}
}
}
},
"GetRegionOptStatus": {
"http": {
"requestUri": "/getRegionOptStatus",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"RegionName"
],
"members": {
"AccountId": {},
"RegionName": {}
}
},
"output": {
"type": "structure",
"members": {
"RegionName": {},
"RegionOptStatus": {}
}
}
},
"ListRegions": {
"http": {
"requestUri": "/listRegions",
"responseCode": 200
},
"input": {
"type": "structure",
"members": {
"AccountId": {},
"MaxResults": {
"type": "integer"
},
"NextToken": {},
"RegionOptStatusContains": {
"type": "list",
"member": {}
}
}
},
"output": {
"type": "structure",
"members": {
"NextToken": {},
"Regions": {
"type": "list",
"member": {
"type": "structure",
"members": {
"RegionName": {},
"RegionOptStatus": {}
}
}
}
}
}
},
"PutAlternateContact": {
"http": {
"requestUri": "/putAlternateContact",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"AlternateContactType",
"EmailAddress",
"Name",
"PhoneNumber",
"Title"
],
"members": {
"AccountId": {},
"AlternateContactType": {},
"EmailAddress": {
"shape": "Sa"
},
"Name": {
"shape": "Sb"
},
"PhoneNumber": {
"shape": "Sc"
},
"Title": {
"shape": "Sd"
}
}
},
"idempotent": true
},
"PutContactInformation": {
"http": {
"requestUri": "/putContactInformation",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"ContactInformation"
],
"members": {
"AccountId": {},
"ContactInformation": {
"shape": "Sg"
}
}
},
"idempotent": true
}
},
"shapes": {
"Sa": {
"type": "string",
"sensitive": true
},
"Sb": {
"type": "string",
"sensitive": true
},
"Sc": {
"type": "string",
"sensitive": true
},
"Sd": {
"type": "string",
"sensitive": true
},
"Sg": {
"type": "structure",
"required": [
"AddressLine1",
"City",
"CountryCode",
"FullName",
"PhoneNumber",
"PostalCode"
],
"members": {
"AddressLine1": {
"shape": "Sh"
},
"AddressLine2": {
"shape": "Sh"
},
"AddressLine3": {
"shape": "Sh"
},
"City": {
"type": "string",
"sensitive": true
},
"CompanyName": {
"type": "string",
"sensitive": true
},
"CountryCode": {
"type": "string",
"sensitive": true
},
"DistrictOrCounty": {
"type": "string",
"sensitive": true
},
"FullName": {
"type": "string",
"sensitive": true
},
"PhoneNumber": {
"type": "string",
"sensitive": true
},
"PostalCode": {
"type": "string",
"sensitive": true
},
"StateOrRegion": {
"type": "string",
"sensitive": true
},
"WebsiteUrl": {
"type": "string",
"sensitive": true
}
}
},
"Sh": {
"type": "string",
"sensitive": true
}
}
}

View File

@@ -1,10 +0,0 @@
{
"pagination": {
"ListRegions": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults",
"result_key": "Regions"
}
}
}

View File

@@ -1,5 +0,0 @@
{
"version": "1.0",
"examples": {
}
}

View File

@@ -1,521 +0,0 @@
{
"version": "2.0",
"metadata": {
"apiVersion": "2015-12-08",
"endpointPrefix": "acm",
"jsonVersion": "1.1",
"protocol": "json",
"serviceAbbreviation": "ACM",
"serviceFullName": "AWS Certificate Manager",
"serviceId": "ACM",
"signatureVersion": "v4",
"targetPrefix": "CertificateManager",
"uid": "acm-2015-12-08"
},
"operations": {
"AddTagsToCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateArn",
"Tags"
],
"members": {
"CertificateArn": {},
"Tags": {
"shape": "S3"
}
}
}
},
"DeleteCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateArn"
],
"members": {
"CertificateArn": {}
}
}
},
"DescribeCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateArn"
],
"members": {
"CertificateArn": {}
}
},
"output": {
"type": "structure",
"members": {
"Certificate": {
"type": "structure",
"members": {
"CertificateArn": {},
"DomainName": {},
"SubjectAlternativeNames": {
"shape": "Sc"
},
"DomainValidationOptions": {
"shape": "Sd"
},
"Serial": {},
"Subject": {},
"Issuer": {},
"CreatedAt": {
"type": "timestamp"
},
"IssuedAt": {
"type": "timestamp"
},
"ImportedAt": {
"type": "timestamp"
},
"Status": {},
"RevokedAt": {
"type": "timestamp"
},
"RevocationReason": {},
"NotBefore": {
"type": "timestamp"
},
"NotAfter": {
"type": "timestamp"
},
"KeyAlgorithm": {},
"SignatureAlgorithm": {},
"InUseBy": {
"type": "list",
"member": {}
},
"FailureReason": {},
"Type": {},
"RenewalSummary": {
"type": "structure",
"required": [
"RenewalStatus",
"DomainValidationOptions",
"UpdatedAt"
],
"members": {
"RenewalStatus": {},
"DomainValidationOptions": {
"shape": "Sd"
},
"RenewalStatusReason": {},
"UpdatedAt": {
"type": "timestamp"
}
}
},
"KeyUsages": {
"type": "list",
"member": {
"type": "structure",
"members": {
"Name": {}
}
}
},
"ExtendedKeyUsages": {
"type": "list",
"member": {
"type": "structure",
"members": {
"Name": {},
"OID": {}
}
}
},
"CertificateAuthorityArn": {},
"RenewalEligibility": {},
"Options": {
"shape": "S11"
}
}
}
}
}
},
"ExportCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateArn",
"Passphrase"
],
"members": {
"CertificateArn": {},
"Passphrase": {
"type": "blob",
"sensitive": true
}
}
},
"output": {
"type": "structure",
"members": {
"Certificate": {},
"CertificateChain": {},
"PrivateKey": {
"type": "string",
"sensitive": true
}
}
}
},
"GetAccountConfiguration": {
"output": {
"type": "structure",
"members": {
"ExpiryEvents": {
"shape": "S1a"
}
}
}
},
"GetCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateArn"
],
"members": {
"CertificateArn": {}
}
},
"output": {
"type": "structure",
"members": {
"Certificate": {},
"CertificateChain": {}
}
}
},
"ImportCertificate": {
"input": {
"type": "structure",
"required": [
"Certificate",
"PrivateKey"
],
"members": {
"CertificateArn": {},
"Certificate": {
"type": "blob"
},
"PrivateKey": {
"type": "blob",
"sensitive": true
},
"CertificateChain": {
"type": "blob"
},
"Tags": {
"shape": "S3"
}
}
},
"output": {
"type": "structure",
"members": {
"CertificateArn": {}
}
}
},
"ListCertificates": {
"input": {
"type": "structure",
"members": {
"CertificateStatuses": {
"type": "list",
"member": {}
},
"Includes": {
"type": "structure",
"members": {
"extendedKeyUsage": {
"type": "list",
"member": {}
},
"keyUsage": {
"type": "list",
"member": {}
},
"keyTypes": {
"type": "list",
"member": {}
}
}
},
"NextToken": {},
"MaxItems": {
"type": "integer"
},
"SortBy": {},
"SortOrder": {}
}
},
"output": {
"type": "structure",
"members": {
"NextToken": {},
"CertificateSummaryList": {
"type": "list",
"member": {
"type": "structure",
"members": {
"CertificateArn": {},
"DomainName": {},
"SubjectAlternativeNameSummaries": {
"shape": "Sc"
},
"HasAdditionalSubjectAlternativeNames": {
"type": "boolean"
},
"Status": {},
"Type": {},
"KeyAlgorithm": {},
"KeyUsages": {
"type": "list",
"member": {}
},
"ExtendedKeyUsages": {
"type": "list",
"member": {}
},
"InUse": {
"type": "boolean"
},
"Exported": {
"type": "boolean"
},
"RenewalEligibility": {},
"NotBefore": {
"type": "timestamp"
},
"NotAfter": {
"type": "timestamp"
},
"CreatedAt": {
"type": "timestamp"
},
"IssuedAt": {
"type": "timestamp"
},
"ImportedAt": {
"type": "timestamp"
},
"RevokedAt": {
"type": "timestamp"
}
}
}
}
}
}
},
"ListTagsForCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateArn"
],
"members": {
"CertificateArn": {}
}
},
"output": {
"type": "structure",
"members": {
"Tags": {
"shape": "S3"
}
}
}
},
"PutAccountConfiguration": {
"input": {
"type": "structure",
"required": [
"IdempotencyToken"
],
"members": {
"ExpiryEvents": {
"shape": "S1a"
},
"IdempotencyToken": {}
}
}
},
"RemoveTagsFromCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateArn",
"Tags"
],
"members": {
"CertificateArn": {},
"Tags": {
"shape": "S3"
}
}
}
},
"RenewCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateArn"
],
"members": {
"CertificateArn": {}
}
}
},
"RequestCertificate": {
"input": {
"type": "structure",
"required": [
"DomainName"
],
"members": {
"DomainName": {},
"ValidationMethod": {},
"SubjectAlternativeNames": {
"shape": "Sc"
},
"IdempotencyToken": {},
"DomainValidationOptions": {
"type": "list",
"member": {
"type": "structure",
"required": [
"DomainName",
"ValidationDomain"
],
"members": {
"DomainName": {},
"ValidationDomain": {}
}
}
},
"Options": {
"shape": "S11"
},
"CertificateAuthorityArn": {},
"Tags": {
"shape": "S3"
},
"KeyAlgorithm": {}
}
},
"output": {
"type": "structure",
"members": {
"CertificateArn": {}
}
}
},
"ResendValidationEmail": {
"input": {
"type": "structure",
"required": [
"CertificateArn",
"Domain",
"ValidationDomain"
],
"members": {
"CertificateArn": {},
"Domain": {},
"ValidationDomain": {}
}
}
},
"UpdateCertificateOptions": {
"input": {
"type": "structure",
"required": [
"CertificateArn",
"Options"
],
"members": {
"CertificateArn": {},
"Options": {
"shape": "S11"
}
}
}
}
},
"shapes": {
"S3": {
"type": "list",
"member": {
"type": "structure",
"required": [
"Key"
],
"members": {
"Key": {},
"Value": {}
}
}
},
"Sc": {
"type": "list",
"member": {}
},
"Sd": {
"type": "list",
"member": {
"type": "structure",
"required": [
"DomainName"
],
"members": {
"DomainName": {},
"ValidationEmails": {
"type": "list",
"member": {}
},
"ValidationDomain": {},
"ValidationStatus": {},
"ResourceRecord": {
"type": "structure",
"required": [
"Name",
"Type",
"Value"
],
"members": {
"Name": {},
"Type": {},
"Value": {}
}
},
"ValidationMethod": {}
}
}
},
"S11": {
"type": "structure",
"members": {
"CertificateTransparencyLoggingPreference": {}
}
},
"S1a": {
"type": "structure",
"members": {
"DaysBeforeExpiry": {
"type": "integer"
}
}
}
}
}

View File

@@ -1,10 +0,0 @@
{
"pagination": {
"ListCertificates": {
"input_token": "NextToken",
"limit_key": "MaxItems",
"output_token": "NextToken",
"result_key": "CertificateSummaryList"
}
}
}

View File

@@ -1,35 +0,0 @@
{
"version": 2,
"waiters": {
"CertificateValidated": {
"delay": 60,
"maxAttempts": 40,
"operation": "DescribeCertificate",
"acceptors": [
{
"matcher": "pathAll",
"expected": "SUCCESS",
"argument": "Certificate.DomainValidationOptions[].ValidationStatus",
"state": "success"
},
{
"matcher": "pathAny",
"expected": "PENDING_VALIDATION",
"argument": "Certificate.DomainValidationOptions[].ValidationStatus",
"state": "retry"
},
{
"matcher": "path",
"expected": "FAILED",
"argument": "Certificate.Status",
"state": "failure"
},
{
"matcher": "error",
"expected": "ResourceNotFoundException",
"state": "failure"
}
]
}
}
}

View File

@@ -1,5 +0,0 @@
{
"version": "1.0",
"examples": {
}
}

View File

@@ -1,792 +0,0 @@
{
"version": "2.0",
"metadata": {
"apiVersion": "2017-08-22",
"endpointPrefix": "acm-pca",
"jsonVersion": "1.1",
"protocol": "json",
"serviceAbbreviation": "ACM-PCA",
"serviceFullName": "AWS Certificate Manager Private Certificate Authority",
"serviceId": "ACM PCA",
"signatureVersion": "v4",
"targetPrefix": "ACMPrivateCA",
"uid": "acm-pca-2017-08-22"
},
"operations": {
"CreateCertificateAuthority": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityConfiguration",
"CertificateAuthorityType"
],
"members": {
"CertificateAuthorityConfiguration": {
"shape": "S2"
},
"RevocationConfiguration": {
"shape": "Sv"
},
"CertificateAuthorityType": {},
"IdempotencyToken": {},
"KeyStorageSecurityStandard": {},
"Tags": {
"shape": "S15"
},
"UsageMode": {}
}
},
"output": {
"type": "structure",
"members": {
"CertificateAuthorityArn": {}
}
},
"idempotent": true
},
"CreateCertificateAuthorityAuditReport": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn",
"S3BucketName",
"AuditReportResponseFormat"
],
"members": {
"CertificateAuthorityArn": {},
"S3BucketName": {},
"AuditReportResponseFormat": {}
}
},
"output": {
"type": "structure",
"members": {
"AuditReportId": {},
"S3Key": {}
}
},
"idempotent": true
},
"CreatePermission": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn",
"Principal",
"Actions"
],
"members": {
"CertificateAuthorityArn": {},
"Principal": {},
"SourceAccount": {},
"Actions": {
"shape": "S1l"
}
}
}
},
"DeleteCertificateAuthority": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn"
],
"members": {
"CertificateAuthorityArn": {},
"PermanentDeletionTimeInDays": {
"type": "integer"
}
}
}
},
"DeletePermission": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn",
"Principal"
],
"members": {
"CertificateAuthorityArn": {},
"Principal": {},
"SourceAccount": {}
}
}
},
"DeletePolicy": {
"input": {
"type": "structure",
"required": [
"ResourceArn"
],
"members": {
"ResourceArn": {}
}
}
},
"DescribeCertificateAuthority": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn"
],
"members": {
"CertificateAuthorityArn": {}
}
},
"output": {
"type": "structure",
"members": {
"CertificateAuthority": {
"shape": "S1t"
}
}
}
},
"DescribeCertificateAuthorityAuditReport": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn",
"AuditReportId"
],
"members": {
"CertificateAuthorityArn": {},
"AuditReportId": {}
}
},
"output": {
"type": "structure",
"members": {
"AuditReportStatus": {},
"S3BucketName": {},
"S3Key": {},
"CreatedAt": {
"type": "timestamp"
}
}
}
},
"GetCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn",
"CertificateArn"
],
"members": {
"CertificateAuthorityArn": {},
"CertificateArn": {}
}
},
"output": {
"type": "structure",
"members": {
"Certificate": {},
"CertificateChain": {}
}
}
},
"GetCertificateAuthorityCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn"
],
"members": {
"CertificateAuthorityArn": {}
}
},
"output": {
"type": "structure",
"members": {
"Certificate": {},
"CertificateChain": {}
}
}
},
"GetCertificateAuthorityCsr": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn"
],
"members": {
"CertificateAuthorityArn": {}
}
},
"output": {
"type": "structure",
"members": {
"Csr": {}
}
}
},
"GetPolicy": {
"input": {
"type": "structure",
"required": [
"ResourceArn"
],
"members": {
"ResourceArn": {}
}
},
"output": {
"type": "structure",
"members": {
"Policy": {}
}
}
},
"ImportCertificateAuthorityCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn",
"Certificate"
],
"members": {
"CertificateAuthorityArn": {},
"Certificate": {
"type": "blob"
},
"CertificateChain": {
"type": "blob"
}
}
}
},
"IssueCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn",
"Csr",
"SigningAlgorithm",
"Validity"
],
"members": {
"ApiPassthrough": {
"type": "structure",
"members": {
"Extensions": {
"type": "structure",
"members": {
"CertificatePolicies": {
"type": "list",
"member": {
"type": "structure",
"required": [
"CertPolicyId"
],
"members": {
"CertPolicyId": {},
"PolicyQualifiers": {
"type": "list",
"member": {
"type": "structure",
"required": [
"PolicyQualifierId",
"Qualifier"
],
"members": {
"PolicyQualifierId": {},
"Qualifier": {
"type": "structure",
"required": [
"CpsUri"
],
"members": {
"CpsUri": {}
}
}
}
}
}
}
}
},
"ExtendedKeyUsage": {
"type": "list",
"member": {
"type": "structure",
"members": {
"ExtendedKeyUsageType": {},
"ExtendedKeyUsageObjectIdentifier": {}
}
}
},
"KeyUsage": {
"shape": "Sj"
},
"SubjectAlternativeNames": {
"type": "list",
"member": {
"shape": "Sp"
}
},
"CustomExtensions": {
"type": "list",
"member": {
"type": "structure",
"required": [
"ObjectIdentifier",
"Value"
],
"members": {
"ObjectIdentifier": {},
"Value": {},
"Critical": {
"type": "boolean"
}
}
}
}
}
},
"Subject": {
"shape": "S5"
}
}
},
"CertificateAuthorityArn": {},
"Csr": {
"type": "blob"
},
"SigningAlgorithm": {},
"TemplateArn": {},
"Validity": {
"shape": "S2x"
},
"ValidityNotBefore": {
"shape": "S2x"
},
"IdempotencyToken": {}
}
},
"output": {
"type": "structure",
"members": {
"CertificateArn": {}
}
},
"idempotent": true
},
"ListCertificateAuthorities": {
"input": {
"type": "structure",
"members": {
"NextToken": {},
"MaxResults": {
"type": "integer"
},
"ResourceOwner": {}
}
},
"output": {
"type": "structure",
"members": {
"CertificateAuthorities": {
"type": "list",
"member": {
"shape": "S1t"
}
},
"NextToken": {}
}
}
},
"ListPermissions": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn"
],
"members": {
"CertificateAuthorityArn": {},
"NextToken": {},
"MaxResults": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"Permissions": {
"type": "list",
"member": {
"type": "structure",
"members": {
"CertificateAuthorityArn": {},
"CreatedAt": {
"type": "timestamp"
},
"Principal": {},
"SourceAccount": {},
"Actions": {
"shape": "S1l"
},
"Policy": {}
}
}
},
"NextToken": {}
}
}
},
"ListTags": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn"
],
"members": {
"CertificateAuthorityArn": {},
"NextToken": {},
"MaxResults": {
"type": "integer"
}
}
},
"output": {
"type": "structure",
"members": {
"Tags": {
"shape": "S15"
},
"NextToken": {}
}
}
},
"PutPolicy": {
"input": {
"type": "structure",
"required": [
"ResourceArn",
"Policy"
],
"members": {
"ResourceArn": {},
"Policy": {}
}
}
},
"RestoreCertificateAuthority": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn"
],
"members": {
"CertificateAuthorityArn": {}
}
}
},
"RevokeCertificate": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn",
"CertificateSerial",
"RevocationReason"
],
"members": {
"CertificateAuthorityArn": {},
"CertificateSerial": {},
"RevocationReason": {}
}
}
},
"TagCertificateAuthority": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn",
"Tags"
],
"members": {
"CertificateAuthorityArn": {},
"Tags": {
"shape": "S15"
}
}
}
},
"UntagCertificateAuthority": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn",
"Tags"
],
"members": {
"CertificateAuthorityArn": {},
"Tags": {
"shape": "S15"
}
}
}
},
"UpdateCertificateAuthority": {
"input": {
"type": "structure",
"required": [
"CertificateAuthorityArn"
],
"members": {
"CertificateAuthorityArn": {},
"RevocationConfiguration": {
"shape": "Sv"
},
"Status": {}
}
}
}
},
"shapes": {
"S2": {
"type": "structure",
"required": [
"KeyAlgorithm",
"SigningAlgorithm",
"Subject"
],
"members": {
"KeyAlgorithm": {},
"SigningAlgorithm": {},
"Subject": {
"shape": "S5"
},
"CsrExtensions": {
"type": "structure",
"members": {
"KeyUsage": {
"shape": "Sj"
},
"SubjectInformationAccess": {
"type": "list",
"member": {
"type": "structure",
"required": [
"AccessMethod",
"AccessLocation"
],
"members": {
"AccessMethod": {
"type": "structure",
"members": {
"CustomObjectIdentifier": {},
"AccessMethodType": {}
}
},
"AccessLocation": {
"shape": "Sp"
}
}
}
}
}
}
}
},
"S5": {
"type": "structure",
"members": {
"Country": {},
"Organization": {},
"OrganizationalUnit": {},
"DistinguishedNameQualifier": {},
"State": {},
"CommonName": {},
"SerialNumber": {},
"Locality": {},
"Title": {},
"Surname": {},
"GivenName": {},
"Initials": {},
"Pseudonym": {},
"GenerationQualifier": {},
"CustomAttributes": {
"type": "list",
"member": {
"type": "structure",
"required": [
"ObjectIdentifier",
"Value"
],
"members": {
"ObjectIdentifier": {},
"Value": {}
}
}
}
}
},
"Sj": {
"type": "structure",
"members": {
"DigitalSignature": {
"type": "boolean"
},
"NonRepudiation": {
"type": "boolean"
},
"KeyEncipherment": {
"type": "boolean"
},
"DataEncipherment": {
"type": "boolean"
},
"KeyAgreement": {
"type": "boolean"
},
"KeyCertSign": {
"type": "boolean"
},
"CRLSign": {
"type": "boolean"
},
"EncipherOnly": {
"type": "boolean"
},
"DecipherOnly": {
"type": "boolean"
}
}
},
"Sp": {
"type": "structure",
"members": {
"OtherName": {
"type": "structure",
"required": [
"TypeId",
"Value"
],
"members": {
"TypeId": {},
"Value": {}
}
},
"Rfc822Name": {},
"DnsName": {},
"DirectoryName": {
"shape": "S5"
},
"EdiPartyName": {
"type": "structure",
"required": [
"PartyName"
],
"members": {
"PartyName": {},
"NameAssigner": {}
}
},
"UniformResourceIdentifier": {},
"IpAddress": {},
"RegisteredId": {}
}
},
"Sv": {
"type": "structure",
"members": {
"CrlConfiguration": {
"type": "structure",
"required": [
"Enabled"
],
"members": {
"Enabled": {
"type": "boolean"
},
"ExpirationInDays": {
"type": "integer"
},
"CustomCname": {},
"S3BucketName": {},
"S3ObjectAcl": {}
}
},
"OcspConfiguration": {
"type": "structure",
"required": [
"Enabled"
],
"members": {
"Enabled": {
"type": "boolean"
},
"OcspCustomCname": {}
}
}
}
},
"S15": {
"type": "list",
"member": {
"type": "structure",
"required": [
"Key"
],
"members": {
"Key": {},
"Value": {}
}
}
},
"S1l": {
"type": "list",
"member": {}
},
"S1t": {
"type": "structure",
"members": {
"Arn": {},
"OwnerAccount": {},
"CreatedAt": {
"type": "timestamp"
},
"LastStateChangeAt": {
"type": "timestamp"
},
"Type": {},
"Serial": {},
"Status": {},
"NotBefore": {
"type": "timestamp"
},
"NotAfter": {
"type": "timestamp"
},
"FailureReason": {},
"CertificateAuthorityConfiguration": {
"shape": "S2"
},
"RevocationConfiguration": {
"shape": "Sv"
},
"RestorableUntil": {
"type": "timestamp"
},
"KeyStorageSecurityStandard": {},
"UsageMode": {}
}
},
"S2x": {
"type": "structure",
"required": [
"Value",
"Type"
],
"members": {
"Value": {
"type": "long"
},
"Type": {}
}
}
}
}

View File

@@ -1,22 +0,0 @@
{
"pagination": {
"ListCertificateAuthorities": {
"input_token": "NextToken",
"limit_key": "MaxResults",
"output_token": "NextToken",
"result_key": "CertificateAuthorities"
},
"ListPermissions": {
"input_token": "NextToken",
"limit_key": "MaxResults",
"output_token": "NextToken",
"result_key": "Permissions"
},
"ListTags": {
"input_token": "NextToken",
"limit_key": "MaxResults",
"output_token": "NextToken",
"result_key": "Tags"
}
}
}

View File

@@ -1,61 +0,0 @@
{
"version": 2,
"waiters": {
"CertificateAuthorityCSRCreated": {
"description": "Wait until a Certificate Authority CSR is created",
"operation": "GetCertificateAuthorityCsr",
"delay": 3,
"maxAttempts": 60,
"acceptors": [
{
"state": "success",
"matcher": "status",
"expected": 200
},
{
"state": "retry",
"matcher": "error",
"expected": "RequestInProgressException"
}
]
},
"CertificateIssued": {
"description": "Wait until a certificate is issued",
"operation": "GetCertificate",
"delay": 3,
"maxAttempts": 60,
"acceptors": [
{
"state": "success",
"matcher": "status",
"expected": 200
},
{
"state": "retry",
"matcher": "error",
"expected": "RequestInProgressException"
}
]
},
"AuditReportCreated": {
"description": "Wait until a Audit Report is created",
"operation": "DescribeCertificateAuthorityAuditReport",
"delay": 3,
"maxAttempts": 60,
"acceptors": [
{
"state": "success",
"matcher": "path",
"argument": "AuditReportStatus",
"expected": "SUCCESS"
},
{
"state": "failure",
"matcher": "path",
"argument": "AuditReportStatus",
"expected": "FAILED"
}
]
}
}
}

View File

@@ -1,5 +0,0 @@
{
"version": "1.0",
"examples": {
}
}

View File

@@ -1,94 +0,0 @@
{
"pagination": {
"ListBusinessReportSchedules": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"ListConferenceProviders": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"ListDeviceEvents": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"ListGatewayGroups": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"ListGateways": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"ListSkills": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"ListSkillsStoreCategories": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"ListSkillsStoreSkillsByCategory": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"ListSmartHomeAppliances": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"ListTags": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"SearchAddressBooks": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"SearchContacts": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"SearchDevices": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"SearchNetworkProfiles": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"SearchProfiles": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"SearchRooms": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"SearchSkillGroups": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
},
"SearchUsers": {
"input_token": "NextToken",
"output_token": "NextToken",
"limit_key": "MaxResults"
}
}
}

View File

@@ -1,5 +0,0 @@
{
"version": "1.0",
"examples": {
}
}

View File

@@ -1,899 +0,0 @@
{
"version": "2.0",
"metadata": {
"apiVersion": "2020-08-01",
"endpointPrefix": "aps",
"jsonVersion": "1.1",
"protocol": "rest-json",
"serviceFullName": "Amazon Prometheus Service",
"serviceId": "amp",
"signatureVersion": "v4",
"signingName": "aps",
"uid": "amp-2020-08-01"
},
"operations": {
"CreateAlertManagerDefinition": {
"http": {
"requestUri": "/workspaces/{workspaceId}/alertmanager/definition",
"responseCode": 202
},
"input": {
"type": "structure",
"required": [
"workspaceId",
"data"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"data": {
"type": "blob"
},
"clientToken": {
"idempotencyToken": true
}
}
},
"output": {
"type": "structure",
"required": [
"status"
],
"members": {
"status": {
"shape": "S6"
}
}
},
"idempotent": true
},
"CreateLoggingConfiguration": {
"http": {
"requestUri": "/workspaces/{workspaceId}/logging",
"responseCode": 202
},
"input": {
"type": "structure",
"required": [
"workspaceId",
"logGroupArn"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"logGroupArn": {},
"clientToken": {
"idempotencyToken": true
}
}
},
"output": {
"type": "structure",
"required": [
"status"
],
"members": {
"status": {
"shape": "Sc"
}
}
},
"idempotent": true
},
"CreateRuleGroupsNamespace": {
"http": {
"requestUri": "/workspaces/{workspaceId}/rulegroupsnamespaces",
"responseCode": 202
},
"input": {
"type": "structure",
"required": [
"workspaceId",
"name",
"data"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"name": {},
"data": {
"type": "blob"
},
"clientToken": {
"idempotencyToken": true
},
"tags": {
"shape": "Sh"
}
}
},
"output": {
"type": "structure",
"required": [
"name",
"arn",
"status"
],
"members": {
"name": {},
"arn": {},
"status": {
"shape": "Sm"
},
"tags": {
"shape": "Sh"
}
}
},
"idempotent": true
},
"CreateWorkspace": {
"http": {
"requestUri": "/workspaces",
"responseCode": 202
},
"input": {
"type": "structure",
"members": {
"alias": {},
"clientToken": {
"idempotencyToken": true
},
"tags": {
"shape": "Sh"
}
}
},
"output": {
"type": "structure",
"required": [
"workspaceId",
"arn",
"status"
],
"members": {
"workspaceId": {},
"arn": {},
"status": {
"shape": "Ss"
},
"tags": {
"shape": "Sh"
}
}
},
"idempotent": true
},
"DeleteAlertManagerDefinition": {
"http": {
"method": "DELETE",
"requestUri": "/workspaces/{workspaceId}/alertmanager/definition",
"responseCode": 202
},
"input": {
"type": "structure",
"required": [
"workspaceId"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"clientToken": {
"idempotencyToken": true,
"location": "querystring",
"locationName": "clientToken"
}
}
},
"idempotent": true
},
"DeleteLoggingConfiguration": {
"http": {
"method": "DELETE",
"requestUri": "/workspaces/{workspaceId}/logging",
"responseCode": 202
},
"input": {
"type": "structure",
"required": [
"workspaceId"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"clientToken": {
"idempotencyToken": true,
"location": "querystring",
"locationName": "clientToken"
}
}
},
"idempotent": true
},
"DeleteRuleGroupsNamespace": {
"http": {
"method": "DELETE",
"requestUri": "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}",
"responseCode": 202
},
"input": {
"type": "structure",
"required": [
"workspaceId",
"name"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"name": {
"location": "uri",
"locationName": "name"
},
"clientToken": {
"idempotencyToken": true,
"location": "querystring",
"locationName": "clientToken"
}
}
},
"idempotent": true
},
"DeleteWorkspace": {
"http": {
"method": "DELETE",
"requestUri": "/workspaces/{workspaceId}",
"responseCode": 202
},
"input": {
"type": "structure",
"required": [
"workspaceId"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"clientToken": {
"idempotencyToken": true,
"location": "querystring",
"locationName": "clientToken"
}
}
},
"idempotent": true
},
"DescribeAlertManagerDefinition": {
"http": {
"method": "GET",
"requestUri": "/workspaces/{workspaceId}/alertmanager/definition",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"workspaceId"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
}
}
},
"output": {
"type": "structure",
"required": [
"alertManagerDefinition"
],
"members": {
"alertManagerDefinition": {
"type": "structure",
"required": [
"status",
"data",
"createdAt",
"modifiedAt"
],
"members": {
"status": {
"shape": "S6"
},
"data": {
"type": "blob"
},
"createdAt": {
"type": "timestamp"
},
"modifiedAt": {
"type": "timestamp"
}
}
}
}
}
},
"DescribeLoggingConfiguration": {
"http": {
"method": "GET",
"requestUri": "/workspaces/{workspaceId}/logging",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"workspaceId"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
}
}
},
"output": {
"type": "structure",
"required": [
"loggingConfiguration"
],
"members": {
"loggingConfiguration": {
"type": "structure",
"required": [
"status",
"workspace",
"logGroupArn",
"createdAt",
"modifiedAt"
],
"members": {
"status": {
"shape": "Sc"
},
"workspace": {},
"logGroupArn": {},
"createdAt": {
"type": "timestamp"
},
"modifiedAt": {
"type": "timestamp"
}
}
}
}
}
},
"DescribeRuleGroupsNamespace": {
"http": {
"method": "GET",
"requestUri": "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"workspaceId",
"name"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"name": {
"location": "uri",
"locationName": "name"
}
}
},
"output": {
"type": "structure",
"required": [
"ruleGroupsNamespace"
],
"members": {
"ruleGroupsNamespace": {
"type": "structure",
"required": [
"arn",
"name",
"status",
"data",
"createdAt",
"modifiedAt"
],
"members": {
"arn": {},
"name": {},
"status": {
"shape": "Sm"
},
"data": {
"type": "blob"
},
"createdAt": {
"type": "timestamp"
},
"modifiedAt": {
"type": "timestamp"
},
"tags": {
"shape": "Sh"
}
}
}
}
}
},
"DescribeWorkspace": {
"http": {
"method": "GET",
"requestUri": "/workspaces/{workspaceId}",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"workspaceId"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
}
}
},
"output": {
"type": "structure",
"required": [
"workspace"
],
"members": {
"workspace": {
"type": "structure",
"required": [
"workspaceId",
"arn",
"status",
"createdAt"
],
"members": {
"workspaceId": {},
"alias": {},
"arn": {},
"status": {
"shape": "Ss"
},
"prometheusEndpoint": {},
"createdAt": {
"type": "timestamp"
},
"tags": {
"shape": "Sh"
}
}
}
}
}
},
"ListRuleGroupsNamespaces": {
"http": {
"method": "GET",
"requestUri": "/workspaces/{workspaceId}/rulegroupsnamespaces",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"workspaceId"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"name": {
"location": "querystring",
"locationName": "name"
},
"nextToken": {
"location": "querystring",
"locationName": "nextToken"
},
"maxResults": {
"location": "querystring",
"locationName": "maxResults",
"type": "integer"
}
}
},
"output": {
"type": "structure",
"required": [
"ruleGroupsNamespaces"
],
"members": {
"ruleGroupsNamespaces": {
"type": "list",
"member": {
"type": "structure",
"required": [
"arn",
"name",
"status",
"createdAt",
"modifiedAt"
],
"members": {
"arn": {},
"name": {},
"status": {
"shape": "Sm"
},
"createdAt": {
"type": "timestamp"
},
"modifiedAt": {
"type": "timestamp"
},
"tags": {
"shape": "Sh"
}
}
}
},
"nextToken": {}
}
}
},
"ListTagsForResource": {
"http": {
"method": "GET",
"requestUri": "/tags/{resourceArn}",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"resourceArn"
],
"members": {
"resourceArn": {
"location": "uri",
"locationName": "resourceArn"
}
}
},
"output": {
"type": "structure",
"members": {
"tags": {
"shape": "Sh"
}
}
}
},
"ListWorkspaces": {
"http": {
"method": "GET",
"requestUri": "/workspaces",
"responseCode": 200
},
"input": {
"type": "structure",
"members": {
"nextToken": {
"location": "querystring",
"locationName": "nextToken"
},
"alias": {
"location": "querystring",
"locationName": "alias"
},
"maxResults": {
"location": "querystring",
"locationName": "maxResults",
"type": "integer"
}
}
},
"output": {
"type": "structure",
"required": [
"workspaces"
],
"members": {
"workspaces": {
"type": "list",
"member": {
"type": "structure",
"required": [
"workspaceId",
"arn",
"status",
"createdAt"
],
"members": {
"workspaceId": {},
"alias": {},
"arn": {},
"status": {
"shape": "Ss"
},
"createdAt": {
"type": "timestamp"
},
"tags": {
"shape": "Sh"
}
}
}
},
"nextToken": {}
}
}
},
"PutAlertManagerDefinition": {
"http": {
"method": "PUT",
"requestUri": "/workspaces/{workspaceId}/alertmanager/definition",
"responseCode": 202
},
"input": {
"type": "structure",
"required": [
"workspaceId",
"data"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"data": {
"type": "blob"
},
"clientToken": {
"idempotencyToken": true
}
}
},
"output": {
"type": "structure",
"required": [
"status"
],
"members": {
"status": {
"shape": "S6"
}
}
},
"idempotent": true
},
"PutRuleGroupsNamespace": {
"http": {
"method": "PUT",
"requestUri": "/workspaces/{workspaceId}/rulegroupsnamespaces/{name}",
"responseCode": 202
},
"input": {
"type": "structure",
"required": [
"workspaceId",
"name",
"data"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"name": {
"location": "uri",
"locationName": "name"
},
"data": {
"type": "blob"
},
"clientToken": {
"idempotencyToken": true
}
}
},
"output": {
"type": "structure",
"required": [
"name",
"arn",
"status"
],
"members": {
"name": {},
"arn": {},
"status": {
"shape": "Sm"
},
"tags": {
"shape": "Sh"
}
}
},
"idempotent": true
},
"TagResource": {
"http": {
"requestUri": "/tags/{resourceArn}",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"resourceArn",
"tags"
],
"members": {
"resourceArn": {
"location": "uri",
"locationName": "resourceArn"
},
"tags": {
"shape": "Sh"
}
}
},
"output": {
"type": "structure",
"members": {}
}
},
"UntagResource": {
"http": {
"method": "DELETE",
"requestUri": "/tags/{resourceArn}",
"responseCode": 200
},
"input": {
"type": "structure",
"required": [
"resourceArn",
"tagKeys"
],
"members": {
"resourceArn": {
"location": "uri",
"locationName": "resourceArn"
},
"tagKeys": {
"location": "querystring",
"locationName": "tagKeys",
"type": "list",
"member": {}
}
}
},
"output": {
"type": "structure",
"members": {}
},
"idempotent": true
},
"UpdateLoggingConfiguration": {
"http": {
"method": "PUT",
"requestUri": "/workspaces/{workspaceId}/logging",
"responseCode": 202
},
"input": {
"type": "structure",
"required": [
"workspaceId",
"logGroupArn"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"logGroupArn": {},
"clientToken": {
"idempotencyToken": true
}
}
},
"output": {
"type": "structure",
"required": [
"status"
],
"members": {
"status": {
"shape": "Sc"
}
}
},
"idempotent": true
},
"UpdateWorkspaceAlias": {
"http": {
"requestUri": "/workspaces/{workspaceId}/alias",
"responseCode": 204
},
"input": {
"type": "structure",
"required": [
"workspaceId"
],
"members": {
"workspaceId": {
"location": "uri",
"locationName": "workspaceId"
},
"alias": {},
"clientToken": {
"idempotencyToken": true
}
}
},
"idempotent": true
}
},
"shapes": {
"S6": {
"type": "structure",
"required": [
"statusCode"
],
"members": {
"statusCode": {},
"statusReason": {}
}
},
"Sc": {
"type": "structure",
"required": [
"statusCode"
],
"members": {
"statusCode": {},
"statusReason": {}
}
},
"Sh": {
"type": "map",
"key": {},
"value": {}
},
"Sm": {
"type": "structure",
"required": [
"statusCode"
],
"members": {
"statusCode": {},
"statusReason": {}
}
},
"Ss": {
"type": "structure",
"required": [
"statusCode"
],
"members": {
"statusCode": {}
}
}
}
}

View File

@@ -1,16 +0,0 @@
{
"pagination": {
"ListRuleGroupsNamespaces": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults",
"result_key": "ruleGroupsNamespaces"
},
"ListWorkspaces": {
"input_token": "nextToken",
"output_token": "nextToken",
"limit_key": "maxResults",
"result_key": "workspaces"
}
}
}

Some files were not shown because too many files have changed in this diff Show More