mirror of
https://github.com/oven-sh/setup-bun.git
synced 2025-07-19 13:08:27 +02:00
feat: add @actions/cache
This commit is contained in:
parent
b15fb7d098
commit
16e8c96a41
1932 changed files with 261172 additions and 10 deletions
23
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.d.ts
generated
vendored
Normal file
23
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { Context } from '../context/types';
|
||||
import { Baggage } from './types';
|
||||
/**
|
||||
* Retrieve the current baggage from the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
* @returns {Baggage} Extracted baggage from the context
|
||||
*/
|
||||
export declare function getBaggage(context: Context): Baggage | undefined;
|
||||
/**
|
||||
* Store a baggage in the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
* @param {Baggage} baggage that will be set in the actual context
|
||||
*/
|
||||
export declare function setBaggage(context: Context, baggage: Baggage): Context;
|
||||
/**
|
||||
* Delete the baggage stored in the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
*/
|
||||
export declare function deleteBaggage(context: Context): Context;
|
||||
//# sourceMappingURL=context-helpers.d.ts.map
|
47
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js
generated
vendored
Normal file
47
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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.
|
||||
*/
|
||||
import { createContextKey } from '../context/context';
|
||||
/**
|
||||
* Baggage key
|
||||
*/
|
||||
var BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');
|
||||
/**
|
||||
* Retrieve the current baggage from the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
* @returns {Baggage} Extracted baggage from the context
|
||||
*/
|
||||
export function getBaggage(context) {
|
||||
return context.getValue(BAGGAGE_KEY) || undefined;
|
||||
}
|
||||
/**
|
||||
* Store a baggage in the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
* @param {Baggage} baggage that will be set in the actual context
|
||||
*/
|
||||
export function setBaggage(context, baggage) {
|
||||
return context.setValue(BAGGAGE_KEY, baggage);
|
||||
}
|
||||
/**
|
||||
* Delete the baggage stored in the given context
|
||||
*
|
||||
* @param {Context} Context that manage all context values
|
||||
*/
|
||||
export function deleteBaggage(context) {
|
||||
return context.deleteValue(BAGGAGE_KEY);
|
||||
}
|
||||
//# sourceMappingURL=context-helpers.js.map
|
1
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"context-helpers.js","sourceRoot":"","sources":["../../../src/baggage/context-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAItD;;GAEG;AACH,IAAM,WAAW,GAAG,gBAAgB,CAAC,2BAA2B,CAAC,CAAC;AAElE;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB;IACzC,OAAQ,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa,IAAI,SAAS,CAAC;AACjE,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAgB,EAAE,OAAgB;IAC3D,OAAO,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;AAChD,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAAC,OAAgB;IAC5C,OAAO,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;AAC1C,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createContextKey } from '../context/context';\nimport { Context } from '../context/types';\nimport { Baggage } from './types';\n\n/**\n * Baggage key\n */\nconst BAGGAGE_KEY = createContextKey('OpenTelemetry Baggage Key');\n\n/**\n * Retrieve the current baggage from the given context\n *\n * @param {Context} Context that manage all context values\n * @returns {Baggage} Extracted baggage from the context\n */\nexport function getBaggage(context: Context): Baggage | undefined {\n return (context.getValue(BAGGAGE_KEY) as Baggage) || undefined;\n}\n\n/**\n * Store a baggage in the given context\n *\n * @param {Context} Context that manage all context values\n * @param {Baggage} baggage that will be set in the actual context\n */\nexport function setBaggage(context: Context, baggage: Baggage): Context {\n return context.setValue(BAGGAGE_KEY, baggage);\n}\n\n/**\n * Delete the baggage stored in the given context\n *\n * @param {Context} Context that manage all context values\n */\nexport function deleteBaggage(context: Context): Context {\n return context.deleteValue(BAGGAGE_KEY);\n}\n"]}
|
12
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.d.ts
generated
vendored
Normal file
12
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
import type { Baggage, BaggageEntry } from '../types';
|
||||
export declare class BaggageImpl implements Baggage {
|
||||
private _entries;
|
||||
constructor(entries?: Map<string, BaggageEntry>);
|
||||
getEntry(key: string): BaggageEntry | undefined;
|
||||
getAllEntries(): [string, BaggageEntry][];
|
||||
setEntry(key: string, entry: BaggageEntry): BaggageImpl;
|
||||
removeEntry(key: string): BaggageImpl;
|
||||
removeEntries(...keys: string[]): BaggageImpl;
|
||||
clear(): BaggageImpl;
|
||||
}
|
||||
//# sourceMappingURL=baggage-impl.d.ts.map
|
61
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js
generated
vendored
Normal file
61
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js
generated
vendored
Normal file
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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.
|
||||
*/
|
||||
var BaggageImpl = /** @class */ (function () {
|
||||
function BaggageImpl(entries) {
|
||||
this._entries = entries ? new Map(entries) : new Map();
|
||||
}
|
||||
BaggageImpl.prototype.getEntry = function (key) {
|
||||
var entry = this._entries.get(key);
|
||||
if (!entry) {
|
||||
return undefined;
|
||||
}
|
||||
return Object.assign({}, entry);
|
||||
};
|
||||
BaggageImpl.prototype.getAllEntries = function () {
|
||||
return Array.from(this._entries.entries()).map(function (_a) {
|
||||
var k = _a[0], v = _a[1];
|
||||
return [k, v];
|
||||
});
|
||||
};
|
||||
BaggageImpl.prototype.setEntry = function (key, entry) {
|
||||
var newBaggage = new BaggageImpl(this._entries);
|
||||
newBaggage._entries.set(key, entry);
|
||||
return newBaggage;
|
||||
};
|
||||
BaggageImpl.prototype.removeEntry = function (key) {
|
||||
var newBaggage = new BaggageImpl(this._entries);
|
||||
newBaggage._entries.delete(key);
|
||||
return newBaggage;
|
||||
};
|
||||
BaggageImpl.prototype.removeEntries = function () {
|
||||
var keys = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
keys[_i] = arguments[_i];
|
||||
}
|
||||
var newBaggage = new BaggageImpl(this._entries);
|
||||
for (var _a = 0, keys_1 = keys; _a < keys_1.length; _a++) {
|
||||
var key = keys_1[_a];
|
||||
newBaggage._entries.delete(key);
|
||||
}
|
||||
return newBaggage;
|
||||
};
|
||||
BaggageImpl.prototype.clear = function () {
|
||||
return new BaggageImpl();
|
||||
};
|
||||
return BaggageImpl;
|
||||
}());
|
||||
export { BaggageImpl };
|
||||
//# sourceMappingURL=baggage-impl.js.map
|
1
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"baggage-impl.js","sourceRoot":"","sources":["../../../../src/baggage/internal/baggage-impl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;IAGE,qBAAY,OAAmC;QAC7C,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC;IACzD,CAAC;IAED,8BAAQ,GAAR,UAAS,GAAW;QAClB,IAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACrC,IAAI,CAAC,KAAK,EAAE;YACV,OAAO,SAAS,CAAC;SAClB;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAClC,CAAC;IAED,mCAAa,GAAb;QACE,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,GAAG,CAAC,UAAC,EAAM;gBAAL,CAAC,QAAA,EAAE,CAAC,QAAA;YAAM,OAAA,CAAC,CAAC,EAAE,CAAC,CAAC;QAAN,CAAM,CAAC,CAAC;IACrE,CAAC;IAED,8BAAQ,GAAR,UAAS,GAAW,EAAE,KAAmB;QACvC,IAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACpC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,iCAAW,GAAX,UAAY,GAAW;QACrB,IAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,mCAAa,GAAb;QAAc,cAAiB;aAAjB,UAAiB,EAAjB,qBAAiB,EAAjB,IAAiB;YAAjB,yBAAiB;;QAC7B,IAAM,UAAU,GAAG,IAAI,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,KAAkB,UAAI,EAAJ,aAAI,EAAJ,kBAAI,EAAJ,IAAI,EAAE;YAAnB,IAAM,GAAG,aAAA;YACZ,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;SACjC;QACD,OAAO,UAAU,CAAC;IACpB,CAAC;IAED,2BAAK,GAAL;QACE,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;IACH,kBAAC;AAAD,CAAC,AA3CD,IA2CC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Baggage, BaggageEntry } from '../types';\n\nexport class BaggageImpl implements Baggage {\n private _entries: Map<string, BaggageEntry>;\n\n constructor(entries?: Map<string, BaggageEntry>) {\n this._entries = entries ? new Map(entries) : new Map();\n }\n\n getEntry(key: string): BaggageEntry | undefined {\n const entry = this._entries.get(key);\n if (!entry) {\n return undefined;\n }\n\n return Object.assign({}, entry);\n }\n\n getAllEntries(): [string, BaggageEntry][] {\n return Array.from(this._entries.entries()).map(([k, v]) => [k, v]);\n }\n\n setEntry(key: string, entry: BaggageEntry): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.set(key, entry);\n return newBaggage;\n }\n\n removeEntry(key: string): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n newBaggage._entries.delete(key);\n return newBaggage;\n }\n\n removeEntries(...keys: string[]): BaggageImpl {\n const newBaggage = new BaggageImpl(this._entries);\n for (const key of keys) {\n newBaggage._entries.delete(key);\n }\n return newBaggage;\n }\n\n clear(): BaggageImpl {\n return new BaggageImpl();\n }\n}\n"]}
|
5
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.d.ts
generated
vendored
Normal file
5
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
/**
|
||||
* Symbol used to make BaggageEntryMetadata an opaque type
|
||||
*/
|
||||
export declare const baggageEntryMetadataSymbol: unique symbol;
|
||||
//# sourceMappingURL=symbol.d.ts.map
|
20
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js
generated
vendored
Normal file
20
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js
generated
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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.
|
||||
*/
|
||||
/**
|
||||
* Symbol used to make BaggageEntryMetadata an opaque type
|
||||
*/
|
||||
export var baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');
|
||||
//# sourceMappingURL=symbol.js.map
|
1
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"symbol.js","sourceRoot":"","sources":["../../../../src/baggage/internal/symbol.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;GAEG;AACH,MAAM,CAAC,IAAM,0BAA0B,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Symbol used to make BaggageEntryMetadata an opaque type\n */\nexport const baggageEntryMetadataSymbol = Symbol('BaggageEntryMetadata');\n"]}
|
60
node_modules/@opentelemetry/api/build/esm/baggage/types.d.ts
generated
vendored
Normal file
60
node_modules/@opentelemetry/api/build/esm/baggage/types.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,60 @@
|
|||
import { baggageEntryMetadataSymbol } from './internal/symbol';
|
||||
export interface BaggageEntry {
|
||||
/** `String` value of the `BaggageEntry`. */
|
||||
value: string;
|
||||
/**
|
||||
* Metadata is an optional string property defined by the W3C baggage specification.
|
||||
* It currently has no special meaning defined by the specification.
|
||||
*/
|
||||
metadata?: BaggageEntryMetadata;
|
||||
}
|
||||
/**
|
||||
* Serializable Metadata defined by the W3C baggage specification.
|
||||
* It currently has no special meaning defined by the OpenTelemetry or W3C.
|
||||
*/
|
||||
export declare type BaggageEntryMetadata = {
|
||||
toString(): string;
|
||||
} & {
|
||||
__TYPE__: typeof baggageEntryMetadataSymbol;
|
||||
};
|
||||
/**
|
||||
* Baggage represents collection of key-value pairs with optional metadata.
|
||||
* Each key of Baggage is associated with exactly one value.
|
||||
* Baggage may be used to annotate and enrich telemetry data.
|
||||
*/
|
||||
export interface Baggage {
|
||||
/**
|
||||
* Get an entry from Baggage if it exists
|
||||
*
|
||||
* @param key The key which identifies the BaggageEntry
|
||||
*/
|
||||
getEntry(key: string): BaggageEntry | undefined;
|
||||
/**
|
||||
* Get a list of all entries in the Baggage
|
||||
*/
|
||||
getAllEntries(): [string, BaggageEntry][];
|
||||
/**
|
||||
* Returns a new baggage with the entries from the current bag and the specified entry
|
||||
*
|
||||
* @param key string which identifies the baggage entry
|
||||
* @param entry BaggageEntry for the given key
|
||||
*/
|
||||
setEntry(key: string, entry: BaggageEntry): Baggage;
|
||||
/**
|
||||
* Returns a new baggage with the entries from the current bag except the removed entry
|
||||
*
|
||||
* @param key key identifying the entry to be removed
|
||||
*/
|
||||
removeEntry(key: string): Baggage;
|
||||
/**
|
||||
* Returns a new baggage with the entries from the current bag except the removed entries
|
||||
*
|
||||
* @param key keys identifying the entries to be removed
|
||||
*/
|
||||
removeEntries(...key: string[]): Baggage;
|
||||
/**
|
||||
* Returns a new baggage with no entries
|
||||
*/
|
||||
clear(): Baggage;
|
||||
}
|
||||
//# sourceMappingURL=types.d.ts.map
|
17
node_modules/@opentelemetry/api/build/esm/baggage/types.js
generated
vendored
Normal file
17
node_modules/@opentelemetry/api/build/esm/baggage/types.js
generated
vendored
Normal file
|
@ -0,0 +1,17 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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.
|
||||
*/
|
||||
export {};
|
||||
//# sourceMappingURL=types.js.map
|
1
node_modules/@opentelemetry/api/build/esm/baggage/types.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/baggage/types.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/baggage/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\n\n/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport interface BaggageEntry {\n /** `String` value of the `BaggageEntry`. */\n value: string;\n /**\n * Metadata is an optional string property defined by the W3C baggage specification.\n * It currently has no special meaning defined by the specification.\n */\n metadata?: BaggageEntryMetadata;\n}\n\n/**\n * Serializable Metadata defined by the W3C baggage specification.\n * It currently has no special meaning defined by the OpenTelemetry or W3C.\n */\nexport type BaggageEntryMetadata = { toString(): string } & {\n __TYPE__: typeof baggageEntryMetadataSymbol;\n};\n\n/**\n * Baggage represents collection of key-value pairs with optional metadata.\n * Each key of Baggage is associated with exactly one value.\n * Baggage may be used to annotate and enrich telemetry data.\n */\nexport interface Baggage {\n /**\n * Get an entry from Baggage if it exists\n *\n * @param key The key which identifies the BaggageEntry\n */\n getEntry(key: string): BaggageEntry | undefined;\n\n /**\n * Get a list of all entries in the Baggage\n */\n getAllEntries(): [string, BaggageEntry][];\n\n /**\n * Returns a new baggage with the entries from the current bag and the specified entry\n *\n * @param key string which identifies the baggage entry\n * @param entry BaggageEntry for the given key\n */\n setEntry(key: string, entry: BaggageEntry): Baggage;\n\n /**\n * Returns a new baggage with the entries from the current bag except the removed entry\n *\n * @param key key identifying the entry to be removed\n */\n removeEntry(key: string): Baggage;\n\n /**\n * Returns a new baggage with the entries from the current bag except the removed entries\n *\n * @param key keys identifying the entries to be removed\n */\n removeEntries(...key: string[]): Baggage;\n\n /**\n * Returns a new baggage with no entries\n */\n clear(): Baggage;\n}\n"]}
|
15
node_modules/@opentelemetry/api/build/esm/baggage/utils.d.ts
generated
vendored
Normal file
15
node_modules/@opentelemetry/api/build/esm/baggage/utils.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,15 @@
|
|||
import { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';
|
||||
/**
|
||||
* Create a new Baggage with optional entries
|
||||
*
|
||||
* @param entries An array of baggage entries the new baggage should contain
|
||||
*/
|
||||
export declare function createBaggage(entries?: Record<string, BaggageEntry>): Baggage;
|
||||
/**
|
||||
* Create a serializable BaggageEntryMetadata object from a string.
|
||||
*
|
||||
* @param str string metadata. Format is currently not defined by the spec and has no special meaning.
|
||||
*
|
||||
*/
|
||||
export declare function baggageEntryMetadataFromString(str: string): BaggageEntryMetadata;
|
||||
//# sourceMappingURL=utils.d.ts.map
|
47
node_modules/@opentelemetry/api/build/esm/baggage/utils.js
generated
vendored
Normal file
47
node_modules/@opentelemetry/api/build/esm/baggage/utils.js
generated
vendored
Normal file
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* Copyright The OpenTelemetry Authors
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* https://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.
|
||||
*/
|
||||
import { DiagAPI } from '../api/diag';
|
||||
import { BaggageImpl } from './internal/baggage-impl';
|
||||
import { baggageEntryMetadataSymbol } from './internal/symbol';
|
||||
var diag = DiagAPI.instance();
|
||||
/**
|
||||
* Create a new Baggage with optional entries
|
||||
*
|
||||
* @param entries An array of baggage entries the new baggage should contain
|
||||
*/
|
||||
export function createBaggage(entries) {
|
||||
if (entries === void 0) { entries = {}; }
|
||||
return new BaggageImpl(new Map(Object.entries(entries)));
|
||||
}
|
||||
/**
|
||||
* Create a serializable BaggageEntryMetadata object from a string.
|
||||
*
|
||||
* @param str string metadata. Format is currently not defined by the spec and has no special meaning.
|
||||
*
|
||||
*/
|
||||
export function baggageEntryMetadataFromString(str) {
|
||||
if (typeof str !== 'string') {
|
||||
diag.error("Cannot create baggage metadata from unknown type: " + typeof str);
|
||||
str = '';
|
||||
}
|
||||
return {
|
||||
__TYPE__: baggageEntryMetadataSymbol,
|
||||
toString: function () {
|
||||
return str;
|
||||
},
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=utils.js.map
|
1
node_modules/@opentelemetry/api/build/esm/baggage/utils.js.map
generated
vendored
Normal file
1
node_modules/@opentelemetry/api/build/esm/baggage/utils.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/baggage/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,mBAAmB,CAAC;AAG/D,IAAM,IAAI,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;AAEhC;;;;GAIG;AACH,MAAM,UAAU,aAAa,CAC3B,OAA0C;IAA1C,wBAAA,EAAA,YAA0C;IAE1C,OAAO,IAAI,WAAW,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAC5C,GAAW;IAEX,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC3B,IAAI,CAAC,KAAK,CACR,uDAAqD,OAAO,GAAK,CAClE,CAAC;QACF,GAAG,GAAG,EAAE,CAAC;KACV;IAED,OAAO;QACL,QAAQ,EAAE,0BAA0B;QACpC,QAAQ;YACN,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DiagAPI } from '../api/diag';\nimport { BaggageImpl } from './internal/baggage-impl';\nimport { baggageEntryMetadataSymbol } from './internal/symbol';\nimport { Baggage, BaggageEntry, BaggageEntryMetadata } from './types';\n\nconst diag = DiagAPI.instance();\n\n/**\n * Create a new Baggage with optional entries\n *\n * @param entries An array of baggage entries the new baggage should contain\n */\nexport function createBaggage(\n entries: Record<string, BaggageEntry> = {}\n): Baggage {\n return new BaggageImpl(new Map(Object.entries(entries)));\n}\n\n/**\n * Create a serializable BaggageEntryMetadata object from a string.\n *\n * @param str string metadata. Format is currently not defined by the spec and has no special meaning.\n *\n */\nexport function baggageEntryMetadataFromString(\n str: string\n): BaggageEntryMetadata {\n if (typeof str !== 'string') {\n diag.error(\n `Cannot create baggage metadata from unknown type: ${typeof str}`\n );\n str = '';\n }\n\n return {\n __TYPE__: baggageEntryMetadataSymbol,\n toString() {\n return str;\n },\n };\n}\n"]}
|
Loading…
Add table
Add a link
Reference in a new issue