MCPcopy Create free account
hub / github.com/authzed/authzed-node / constructor

Method constructor

src/v1.ts:70–109  ·  view source on GitHub ↗
(
    private endpoint: string,
    private creds: grpc.ChannelCredentials,
    preconnect: PreconnectServices,
    options: grpc.ClientOptions | undefined,
  )

Source from the content-addressed store, hash-verified

68 private options: grpc.ClientOptions;
69
70 constructor(
71 private endpoint: string,
72 private creds: grpc.ChannelCredentials,
73 preconnect: PreconnectServices,
74 options: grpc.ClientOptions | undefined,
75 ) {
76 this.options = {
77 ...options,
78 interceptors: [
79 ...(options?.interceptors ?? []),
80
81 // We put this interceptor last because it checks if the deadline is already
82 // set and, if so, does not overwrite it.
83 deadlineInterceptor(DEFAULT_DEADLINE_MS),
84 ],
85 };
86
87 if (preconnect & PreconnectServices.PERMISSIONS_SERVICE) {
88 this.acl = new PermissionsServiceClient(this.endpoint, this.creds, options);
89 }
90 if (preconnect & PreconnectServices.SCHEMA_SERVICE) {
91 this.ns = new SchemaServiceClient(this.endpoint, this.creds, options);
92 }
93 if (preconnect & PreconnectServices.WATCH_SERVICE) {
94 this.watch = new WatchServiceClient(this.endpoint, this.creds, options);
95 }
96 if (preconnect & PreconnectServices.WATCH_PERMISSIONS_SERVICE) {
97 this.watchPermissions = new WatchPermissionsServiceClient(this.endpoint, this.creds, options);
98 }
99 if (preconnect & PreconnectServices.WATCH_PERMISSIONSETS_SERVICE) {
100 this.watchPermissionSets = new WatchPermissionSetsServiceClient(
101 this.endpoint,
102 this.creds,
103 options,
104 );
105 }
106 if (preconnect & PreconnectServices.EXPERIMENTAL_SERVICE) {
107 this.experimental = new ExperimentalServiceClient(this.endpoint, this.creds, options);
108 }
109 }
110
111 static create(
112 endpoint: string,

Callers

nothing calls this directly

Calls 1

deadlineInterceptorFunction · 0.85

Tested by

no test coverage detected