@streamlayer/sdk-web-anonymous-auth 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +20 -8
- package/lib/es/index.js +20 -8
- package/lib/index.d.ts +4 -2
- package/package.json +16 -16
package/lib/cjs/index.js
CHANGED
|
@@ -366,7 +366,8 @@ function pino(opts) {
|
|
|
366
366
|
formatters: opts.browser.formatters,
|
|
367
367
|
levels,
|
|
368
368
|
timestamp: getTimeFunction(opts),
|
|
369
|
-
messageKey: opts.messageKey || "msg"
|
|
369
|
+
messageKey: opts.messageKey || "msg",
|
|
370
|
+
onChild: opts.onChild || noop
|
|
370
371
|
};
|
|
371
372
|
logger2.levels = getLevels(opts);
|
|
372
373
|
logger2.level = level;
|
|
@@ -374,7 +375,9 @@ function pino(opts) {
|
|
|
374
375
|
logger2.serializers = serializers;
|
|
375
376
|
logger2._serialize = serialize;
|
|
376
377
|
logger2._stdErrSerialize = stdErrSerialize;
|
|
377
|
-
logger2.child =
|
|
378
|
+
logger2.child = function(...args) {
|
|
379
|
+
return child.call(this, setOpts, ...args);
|
|
380
|
+
};
|
|
378
381
|
if (transmit2) logger2._logEvent = createLogEventShape();
|
|
379
382
|
function getLevelVal() {
|
|
380
383
|
return levelToValue(this.level, this);
|
|
@@ -397,7 +400,7 @@ function pino(opts) {
|
|
|
397
400
|
set(this, setOpts, logger2, level3);
|
|
398
401
|
});
|
|
399
402
|
}
|
|
400
|
-
function child(bindings, childOptions) {
|
|
403
|
+
function child(setOpts2, bindings, childOptions) {
|
|
401
404
|
if (!bindings) {
|
|
402
405
|
throw new Error("missing bindings for child Pino");
|
|
403
406
|
}
|
|
@@ -428,7 +431,11 @@ function pino(opts) {
|
|
|
428
431
|
Child.prototype = this;
|
|
429
432
|
const newLogger = new Child(this);
|
|
430
433
|
appendChildLogger(this, newLogger);
|
|
434
|
+
newLogger.child = function(...args) {
|
|
435
|
+
return child.call(this, setOpts2, ...args);
|
|
436
|
+
};
|
|
431
437
|
newLogger.level = childOptions.level || this.level;
|
|
438
|
+
setOpts2.onChild(newLogger);
|
|
432
439
|
return newLogger;
|
|
433
440
|
}
|
|
434
441
|
return logger2;
|
|
@@ -490,8 +497,12 @@ function set(self2, opts, rootLogger, level) {
|
|
|
490
497
|
enumerable: true,
|
|
491
498
|
configurable: true
|
|
492
499
|
});
|
|
493
|
-
if (
|
|
494
|
-
return;
|
|
500
|
+
if (self2[level] === noop) {
|
|
501
|
+
if (!opts.transmit) return;
|
|
502
|
+
const transmitLevel = opts.transmit.level || self2.level;
|
|
503
|
+
const transmitValue = rootLogger.levels.values[transmitLevel];
|
|
504
|
+
const methodValue = rootLogger.levels.values[level];
|
|
505
|
+
if (methodValue < transmitValue) return;
|
|
495
506
|
}
|
|
496
507
|
self2[level] = createWrap(self2, opts, rootLogger, level);
|
|
497
508
|
const bindings = getBindingChain(self2);
|
|
@@ -755,11 +766,12 @@ const bypassAuth = (transport, params) => {
|
|
|
755
766
|
const contextValues = createRequestOptions({ retryAttempts: 0 });
|
|
756
767
|
return client.bypassAuth(params, { contextValues });
|
|
757
768
|
};
|
|
758
|
-
const anonymousAuth = async (instance, opts) => {
|
|
769
|
+
const anonymousAuth = async (instance, opts = {}) => {
|
|
759
770
|
var _a, _b;
|
|
760
771
|
const { schemaName, issuer } = {
|
|
761
772
|
schemaName: "slra",
|
|
762
|
-
issuer: "sdk-web"
|
|
773
|
+
issuer: "sdk-web",
|
|
774
|
+
...opts
|
|
763
775
|
};
|
|
764
776
|
const organization = await instance.stores.organizationSettings.getValue();
|
|
765
777
|
if (!organization) {
|
|
@@ -777,7 +789,7 @@ const anonymousAuth = async (instance, opts) => {
|
|
|
777
789
|
};
|
|
778
790
|
const anonymous = (instance, opts, done) => {
|
|
779
791
|
instance.sdk.anonymousAuthorization = async () => {
|
|
780
|
-
await anonymousAuth(instance);
|
|
792
|
+
await anonymousAuth(instance, opts);
|
|
781
793
|
};
|
|
782
794
|
done();
|
|
783
795
|
};
|
package/lib/es/index.js
CHANGED
|
@@ -364,7 +364,8 @@ function pino(opts) {
|
|
|
364
364
|
formatters: opts.browser.formatters,
|
|
365
365
|
levels,
|
|
366
366
|
timestamp: getTimeFunction(opts),
|
|
367
|
-
messageKey: opts.messageKey || "msg"
|
|
367
|
+
messageKey: opts.messageKey || "msg",
|
|
368
|
+
onChild: opts.onChild || noop
|
|
368
369
|
};
|
|
369
370
|
logger2.levels = getLevels(opts);
|
|
370
371
|
logger2.level = level;
|
|
@@ -372,7 +373,9 @@ function pino(opts) {
|
|
|
372
373
|
logger2.serializers = serializers;
|
|
373
374
|
logger2._serialize = serialize;
|
|
374
375
|
logger2._stdErrSerialize = stdErrSerialize;
|
|
375
|
-
logger2.child =
|
|
376
|
+
logger2.child = function(...args) {
|
|
377
|
+
return child.call(this, setOpts, ...args);
|
|
378
|
+
};
|
|
376
379
|
if (transmit2) logger2._logEvent = createLogEventShape();
|
|
377
380
|
function getLevelVal() {
|
|
378
381
|
return levelToValue(this.level, this);
|
|
@@ -395,7 +398,7 @@ function pino(opts) {
|
|
|
395
398
|
set(this, setOpts, logger2, level3);
|
|
396
399
|
});
|
|
397
400
|
}
|
|
398
|
-
function child(bindings, childOptions) {
|
|
401
|
+
function child(setOpts2, bindings, childOptions) {
|
|
399
402
|
if (!bindings) {
|
|
400
403
|
throw new Error("missing bindings for child Pino");
|
|
401
404
|
}
|
|
@@ -426,7 +429,11 @@ function pino(opts) {
|
|
|
426
429
|
Child.prototype = this;
|
|
427
430
|
const newLogger = new Child(this);
|
|
428
431
|
appendChildLogger(this, newLogger);
|
|
432
|
+
newLogger.child = function(...args) {
|
|
433
|
+
return child.call(this, setOpts2, ...args);
|
|
434
|
+
};
|
|
429
435
|
newLogger.level = childOptions.level || this.level;
|
|
436
|
+
setOpts2.onChild(newLogger);
|
|
430
437
|
return newLogger;
|
|
431
438
|
}
|
|
432
439
|
return logger2;
|
|
@@ -488,8 +495,12 @@ function set(self2, opts, rootLogger, level) {
|
|
|
488
495
|
enumerable: true,
|
|
489
496
|
configurable: true
|
|
490
497
|
});
|
|
491
|
-
if (
|
|
492
|
-
return;
|
|
498
|
+
if (self2[level] === noop) {
|
|
499
|
+
if (!opts.transmit) return;
|
|
500
|
+
const transmitLevel = opts.transmit.level || self2.level;
|
|
501
|
+
const transmitValue = rootLogger.levels.values[transmitLevel];
|
|
502
|
+
const methodValue = rootLogger.levels.values[level];
|
|
503
|
+
if (methodValue < transmitValue) return;
|
|
493
504
|
}
|
|
494
505
|
self2[level] = createWrap(self2, opts, rootLogger, level);
|
|
495
506
|
const bindings = getBindingChain(self2);
|
|
@@ -753,11 +764,12 @@ const bypassAuth = (transport, params) => {
|
|
|
753
764
|
const contextValues = createRequestOptions({ retryAttempts: 0 });
|
|
754
765
|
return client.bypassAuth(params, { contextValues });
|
|
755
766
|
};
|
|
756
|
-
const anonymousAuth = async (instance, opts) => {
|
|
767
|
+
const anonymousAuth = async (instance, opts = {}) => {
|
|
757
768
|
var _a, _b;
|
|
758
769
|
const { schemaName, issuer } = {
|
|
759
770
|
schemaName: "slra",
|
|
760
|
-
issuer: "sdk-web"
|
|
771
|
+
issuer: "sdk-web",
|
|
772
|
+
...opts
|
|
761
773
|
};
|
|
762
774
|
const organization = await instance.stores.organizationSettings.getValue();
|
|
763
775
|
if (!organization) {
|
|
@@ -775,7 +787,7 @@ const anonymousAuth = async (instance, opts) => {
|
|
|
775
787
|
};
|
|
776
788
|
const anonymous = (instance, opts, done) => {
|
|
777
789
|
instance.sdk.anonymousAuthorization = async () => {
|
|
778
|
-
await anonymousAuth(instance);
|
|
790
|
+
await anonymousAuth(instance, opts);
|
|
779
791
|
};
|
|
780
792
|
done();
|
|
781
793
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { StreamLayerContext } from '@streamlayer/sdk-web-interfaces';
|
|
2
|
-
|
|
3
2
|
declare module '@streamlayer/sdk-web-interfaces' {
|
|
4
3
|
interface StreamLayerSDK {
|
|
5
4
|
anonymousAuthorization: () => Promise<void>;
|
|
6
5
|
}
|
|
7
6
|
}
|
|
8
7
|
type DoneFn = Function;
|
|
9
|
-
export declare const anonymous: (instance: StreamLayerContext, opts:
|
|
8
|
+
export declare const anonymous: (instance: StreamLayerContext, opts: {
|
|
9
|
+
schemaName?: string;
|
|
10
|
+
issuer?: string;
|
|
11
|
+
}, done: DoneFn) => void;
|
|
10
12
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@streamlayer/sdk-web-anonymous-auth",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"author": "StreamLayer, Inc (https://streamlayer.io)",
|
|
5
5
|
"maintainers": [
|
|
6
6
|
{
|
|
@@ -23,24 +23,24 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"jose": "^5.
|
|
27
|
-
"@streamlayer/sdk-web": "^1.0
|
|
26
|
+
"jose": "^5.9.3",
|
|
27
|
+
"@streamlayer/sdk-web": "^1.1.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@nx/devkit": "19.
|
|
31
|
-
"@nx/playwright": "19.
|
|
32
|
-
"@nx/webpack": "19.
|
|
33
|
-
"@playwright/test": "^1.
|
|
34
|
-
"@swc/helpers": "~0.5.
|
|
30
|
+
"@nx/devkit": "19.8.0",
|
|
31
|
+
"@nx/playwright": "19.8.0",
|
|
32
|
+
"@nx/webpack": "19.8.0",
|
|
33
|
+
"@playwright/test": "^1.47.2",
|
|
34
|
+
"@swc/helpers": "~0.5.13",
|
|
35
35
|
"rollup-plugin-visualizer": "^5.12.0",
|
|
36
|
-
"url": "^0.11.
|
|
37
|
-
"vite": "5.
|
|
38
|
-
"vite-plugin-dts": "^
|
|
36
|
+
"url": "^0.11.4",
|
|
37
|
+
"vite": "5.4.7",
|
|
38
|
+
"vite-plugin-dts": "^4.2.1",
|
|
39
39
|
"vite-plugin-node-polyfills": "^0.22.0",
|
|
40
|
-
"vite-tsconfig-paths": "^
|
|
41
|
-
"webpack": "^5.
|
|
42
|
-
"@streamlayer/sdk-web-api": "^1.
|
|
43
|
-
"@streamlayer/sdk-web-core": "^1.0
|
|
44
|
-
"@streamlayer/sdk-web-interfaces": "^1.0
|
|
40
|
+
"vite-tsconfig-paths": "^5.0.1",
|
|
41
|
+
"webpack": "^5.94.0",
|
|
42
|
+
"@streamlayer/sdk-web-api": "^1.2.0",
|
|
43
|
+
"@streamlayer/sdk-web-core": "^1.1.0",
|
|
44
|
+
"@streamlayer/sdk-web-interfaces": "^1.1.0"
|
|
45
45
|
}
|
|
46
46
|
}
|